Web dizinde web.config dosyasından bağlantı dizesi almanın yollarını bilmek istiyorum.Web.config dosyasından bağlantı dizesini asp.net 'e getirin
Sadece aşağıdaki yolu biliyorum.
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Configuration;
namespace Sherserve.DataAccessLayer
{
public class DBGateway
{
public static string conString;
public DBGateway()
{
conString = ConfigurationManager.ConnectionStrings["test"].ToString();
}
}
}
Öyle olmalı 'ConfigurationManager.ConnectionStrings [ "test"]. ConnectionString; 'ancak bu, sahip olduğunuz tek uygun yolla ilgilidir. –
ile sorun nedir? ConString = ConfigurationManager.ConnectionStrings ["test"] ToString(); –
@Mitch lütfen [this] (http://meta.stackexchange.com/questions/76195/how-to-deal-with-have-you-tried-google-comments) - Yorumunuz kimseye gerçekten yapıcı değildir . –