How i use the connection string for making a connection object..
-
Hi , i made a connection string in app.config file. and i want to use this into my .cs file while creating connection object... objSqlConnection1.ConnectionString = ? please post the solution..
-
Hi , i made a connection string in app.config file. and i want to use this into my .cs file while creating connection object... objSqlConnection1.ConnectionString = ? please post the solution..
if your connection string is like this add name="conn1" connectionString="string1" ur access will be like this. string conn = ConfigurationManager.ConnectionStrings[conn1].ConnectionString;
-
if your connection string is like this add name="conn1" connectionString="string1" ur access will be like this. string conn = ConfigurationManager.ConnectionStrings[conn1].ConnectionString;
thanks ! but it gives an error "ConfigurationManager" does not exist into current context
-
thanks ! but it gives an error "ConfigurationManager" does not exist into current context
add a reference in ur class file. using System.Configuration;