Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
Author |
Topic |
nitish
Starting Member
1 Post |
Posted - 2007-01-16 : 02:18:13
|
hi im using asp.net for my final year project.actually im having trouble to open my database. My connection sting is the default one - obtained from the properties: [myconnection = New SqlConnection("Data Source=.\SQLEXPRESS;AttachDbFilename=C:\HOL\Web\Starter\VB\asf\App_Data\asfdb.mdf;Integrated Security=True;Connect Timeout=30;User Instance=True;"]And im having the msg Cannot open user default database. Login failed.Login failed for user 'USERNAME'. plz can any1 help me out. Plzthanks |
|
SwePeso
Patron Saint of Lost Yaks
30421 Posts |
Posted - 2007-01-16 : 02:22:04
|
According to www.connectionstrings.com, your connection string should look like (using ODBC)Driver={SQL Native Client};Server=.\SQLExpress;AttachDbFilename=c:\asd\qwe\mydbfile.mdf;Database=dbname;Trusted_Connection=Yes;or using OLE DB providerProvider=SQLNCLI;Server=.\SQLExpress;AttachDbFilename=c:\asd\qwe\mydbfile.mdf;Database=dbname;Trusted_Connection=Yes;Peter LarssonHelsingborg, Sweden |
 |
|
SwePeso
Patron Saint of Lost Yaks
30421 Posts |
Posted - 2007-01-16 : 02:22:59
|
Also make sure the default account for ASP (iusr_machine) has appropriate permission on the sql server.Peter LarssonHelsingborg, Sweden |
 |
|
SwePeso
Patron Saint of Lost Yaks
30421 Posts |
Posted - 2007-01-16 : 02:29:07
|
Or using .NetServer=.\SQLExpress;AttachDbFilename=c:\asd\qwe\mydbfile.mdf;Database=dbname;Trusted_Connection=Yes;Peter LarssonHelsingborg, Sweden |
 |
|
|
|
|