Click here to Skip to main content
15,878,809 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more: , +
Hello,

My question is,

what will be username and password in connection string for sql server authentication when using window authentication?

Thanks
Posted
Updated 8-Dec-12 20:22pm
v2
Comments
Surendra0x2 9-Dec-12 2:36am    
We don't Need UserName and Password For Windows Authentication

 
Share this answer
 
Comments
ExpertITM 9-Dec-12 2:26am    
hello Krunal,

I know that bt What will be username password for when using window authentication?

Thanks.
[no name] 9-Dec-12 2:28am    
Your windows username and password..
ExpertITM 9-Dec-12 4:01am    
username : xyz
password : abc
We Do not need to Add username and Password

just write in web.config-

XML
<connectionstrings>
		<add name="Connect" connectionstring="Data Source=.\sqlexpress;database=Musicmania;integrated security=true;MultipleActiveResultSets=True" providername="System.Data.SqlClient" />
	</connectionstrings>

or in CS-

C#
SqlConnection sqlconn = new SqlConnection("server=.\\sqlexpress;database=db;integrated security=true");

In Case if you're Using Sql server Authentication then-

C#
SqlConnection sqlconn = new SqlConnection("server=.\\sqlexpress;database=db;user id=ur userid;password=ur password;");
 
Share this answer
 
v3
hi ,

please follow this steps
step1.
open page like test.aspx ,

step2.
on a Design of a page drag and drop any table from database , it will display like gridview dont worry.

step3.

go to web.config file you can see your connection string.
 
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