Google Brother Up

2008/08/14

ConnectionString in Web.Config

(configuration)
(appSettings)
(add key="mstrConnectionString" value="user id=abcd; password=1234; server=VAIJAYANTA-PC\SQLEXPRESS; database="VaijayantaTest" /)
(/appSettings)
(/configuration)

or

(configuration)
(connectionStrings)
(add name="mstrConnectionString" connectionString="user id=abcd; password=1234 server=VAIJAYANTA-PC\SQLEXPRESS; database="VaijayantaTest" /)
(/connectionStrings)
(/configuration)

string StrCon;

StrCon = ConfigurationSettings.AppSettings.Get("mstrConnectionString");

Sqlconnection conn = new SqlConnection(StrCon );
conn.Open();
SqlCommand cmd = new SqlCommand(select,conn);

rest follows.........

72 unique visitors

No comments:

Drop Down List

1. http://www.janetsystems.co.uk/Articles/NetArticles/tabid/74/itemid/161/modid/449/Default.aspx