Click here to Skip to main content
11,637,415 members (67,760 online)
Rate this: bad
good
Please Sign up or sign in to vote.
See more: C# ASP.NET SQL SQL-Server , +
Hello,

My question is,

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

Thanks
Posted 8-Dec-12 20:21pm
ExpertITM1.2K
Edited 8-Dec-12 20:22pm
v2
Comments
Surendra0x2 at 9-Dec-12 2:36am
   
We don't Need UserName and Password For Windows Authentication
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 1

  Permalink  
Comments
Maulesh1 at 9-Dec-12 2:26am
   
hello Krunal,

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

Thanks.
Krunal Rohit at 9-Dec-12 2:28am
   
Your windows username and password..
Maulesh1 at 9-Dec-12 4:01am
   
username : xyz
password : abc
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 2

We Do not need to Add username and Password

just write in web.config-

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

 
SqlConnection sqlconn = new SqlConnection("server=.\\sqlexpress;database=db;integrated security=true");
In Case if you're Using Sql server Authentication then-

SqlConnection sqlconn = new SqlConnection("server=.\\sqlexpress;database=db;user id=ur userid;password=ur password;");
  Permalink  
v3
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 3

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.
  Permalink  

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

  Print Answers RSS
0 Sergey Alexandrovich Kryukov 344
1 OriginalGriff 295
2 stibee 288
3 jyo.net 270
4 himanshu agarwal 209
0 OriginalGriff 9,031
1 Sergey Alexandrovich Kryukov 8,643
2 Mika Wendelius 6,959
3 F-ES Sitecore 2,388
4 Suvendu Shekhar Giri 2,320


Advertise | Privacy | Mobile
Web01 | 2.8.150728.1 | Last Updated 9 Dec 2012
Copyright © CodeProject, 1999-2015
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100