Click here to Skip to main content
15,905,874 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
please me are the bigner and your valuable sugistion and help us to promote.your sinscer Mian Sahib jan
Posted

 
Share this answer
 
C#
var connectionString="Persist Security Info=False;Integrated Security=true;Initial Catalog=Northwind;server=(local)";

//then use it for sqlConnection
var con=new SqlConnection(connectionString);


try to read this for you to know the basic in connection string.



you can also set it in web config
C#
<appsettings>
<add key="myConnectionString" value="server=localhost;database=myDb;uid=myUser;password=myPass;" />
</appsettings>

//then call it in code behind

string connStr = ConfigurationSettings.AppSettings("myConnectionString");


make this as reference. . :)
 
Share this answer
 
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900