pass connection string in user control
-
Hi How do i pass sql connectionstring as parameter in asp.net user control Thanks in Advance
-
Hi, Put it in web.config file under appsettings and use it whereever you want in your application. Hope this will solve the problem. Best Regards, Apurva Kaushal
You can write code in web.config as then in user control write namespace using System.Configuration and then u can write code witten below where you want to access connection as ConfigurationSetting(appSettings[con]); rajkumar Sharma
-
You can write code in web.config as then in user control write namespace using System.Configuration and then u can write code witten below where you want to access connection as ConfigurationSetting(appSettings[con]); rajkumar Sharma
-
then Use Session Object as Session["conection"]="Connectionstring"; and in user coontrol u can retrieve it by string x=Session["conection"].ToString(); rajkumar Sharma
-
Hi, You can create a public property and then you can access through that. Best Regards, Apurva Kaushal