About Author
|
 |
Chintankumar Patel
09 Jun, 2008
|
 |
Contact Me
|
Working as a Technical Consultant for Conchango.
Having experience in to IT from 7+ years and working on Microsoft Technologies
|
Tags
|
|
.Net , .Net Framework 2.0 , .Net Graphics , Asp.Net , Boot , C# , Class Library , Coding Standards , Convert File System , Database , DATEDIFF , DATEDIFF Function , Disk Management , Embedded Resources , EnableEventValidation , EnableViewState , EncoderParameter , FAT32 to NTFS , Form Authentication , HDD , High Quality Thumbnail , Intellisense , Linux , Microsoft Access , Microsoft's SQL , Partition , ReadyBoost , ReSharper , Resize Image , Resize Partition , Security , SQLDataReader , SuperFetch , USB , Usb device not recognized , Vista , Visual Studio 2005 , What's New , Windows , Windows Application , Windows Errors , Windows Vista , Windows XP , YouTube
|
|
Connecting to Microsoft SQL Server using Windows Authentication
|
Mon, 09 Jun, 2008
|
|
|
To connect to MS SQL Server use the following connection string...
SqlConnection _connection = new SqlConnection("data source=localhost;initial catalog=blog;integrated security=SSPI;persist security info=False;Trusted_Connection=Yes");
When using ASP.Net application you may get an error of SqlDataReader or SqlCommand that
e.g. There is already an open DataReader associated with this Command which must be closed first
In this case use the following connection string to avoid such errors...
SqlConnection _connection = new SqlConnection("MultipleActiveResultSets=True;data source=.;initial catalog=blog;integrated security=SSPI;persist security info=False;Trusted_Connection=Yes");
|
Connecting to Microsoft SQL Server using Windows Authentication
|
|
Comments
|
|
Connecting to Microsoft SQL Server using Windows Authentication
Wed, 18 Jun, 2008 - 00:08:38 by tejas tank
|
|
| |
my sql server have user name and password as windows authonticate mode , now how to connect asp.net with sql server databse , i have require connection string for that.
|
| |
|
Re : Connecting to Microsoft SQL Server using Windows Authentication
Wed, 18 Jun, 2008 - 10:41:34 by Chintankumar Patel
|
|
| |
hi.. tejas
if you have user name and password for windows authentication then it should be SQL authentication not Windows authentication....
here is the connection string for SQL Authentication, just replace the capitalized values with yours...
SqlConnection _connection = new SqlConnection("MultipleActiveResultSets=True;Server=SERVERNAME;Database=YOURDBNAME;Uid=YOURUSERNAME;Password=YOURPASSWORD");
|
| |
|
Re : Connecting to Microsoft SQL Server using Windows Authentication
Sat, 13 Sep, 2008 - 22:37:12 by vignesh kumar
|
|
| |
the above code for window authentication doesnt works it shows an error
|
| |
|
|
|
|