IIS Manager and Connection String

Posted by Bhupentiwari under ASP.NET on 7/27/2012 | Points: 10 | Views : 2519 | Status : [Member] | Replies : 2
Hi frnds nweed urgent help.
i have created connection string in IIs Manager-Default website.
but i m not able to use that. please tell me some way by which i can retriev the connection string in asp.net using c#

Thanks n Regards
Bhupendra Tiwari



Responses

Posted by: Vijayakumarp on: 7/27/2012 [Member] Starter | Points: 25

Up
0
Down
Hi

Try this

string connString = System.Configuration.ConfigurationManager.ConnectionStrings["Connectionstringname"].ConnectionString();

Thanks


Bhupentiwari, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Jasminpatel on: 7/28/2012 [Member] Starter | Points: 25

Up
0
Down
<connectionStrings>

<add name="ConnectionString" connectionString="Data Source=Your ServerName;Initial Catalog=DATABASENAME;Integrated Security=True"/>
</connectionStrings>


<appSettings>

<add key="ConnectionString" value="Data Source=SERVERNAME;Initial Catalog=DATABASENAME;Integrated Security=True"/>
</appSettings>


Now Call This In to C# page Like

string ConString=ConfigurationManager.AppSettings["ConnectionString"];



jasmin patel

Bhupentiwari, if this helps please login to Mark As Answer. | Alert Moderator

Login to post response