L
Lacka
Hi,
My connection string is
"server='(local)'; trusted_connection=true; database=Lexiko; user id=lexiko;
pwd=lexiko"
but at the line "dataAdapter.Fill(dataSet)" I get the error: Login failed
for user 'LSW2KP\ASPNET' until I create this user for the database.
Why do my application want to connect with the user "ASPNET" insteed of
using "lexiko" described in the connection string? What's wrong?
Here is the complete sequence (the connection string mentioned above is in
the app setting "DB"):
Dim dbConnection As System.Data.IDbConnection = New
System.Data.SqlClient.SqlConnection(ConfigurationSettings.AppSettings("DB"))
Dim dbCommand As System.Data.IDbCommand = New
System.Data.SqlClient.SqlCommand
Dim dataAdapter As System.Data.IDbDataAdapter = New
System.Data.SqlClient.SqlDataAdapter
Dim dataSet As System.Data.DataSet = New System.Data.DataSet
dbCommand.Connection = dbConnection
dbCommand.CommandText = "SELECT * FROM MY_TABLE"
dataAdapter.SelectCommand = dbCommand
dataAdapter.Fill(dataSet)
thanks,
Lacka
My connection string is
"server='(local)'; trusted_connection=true; database=Lexiko; user id=lexiko;
pwd=lexiko"
but at the line "dataAdapter.Fill(dataSet)" I get the error: Login failed
for user 'LSW2KP\ASPNET' until I create this user for the database.
Why do my application want to connect with the user "ASPNET" insteed of
using "lexiko" described in the connection string? What's wrong?
Here is the complete sequence (the connection string mentioned above is in
the app setting "DB"):
Dim dbConnection As System.Data.IDbConnection = New
System.Data.SqlClient.SqlConnection(ConfigurationSettings.AppSettings("DB"))
Dim dbCommand As System.Data.IDbCommand = New
System.Data.SqlClient.SqlCommand
Dim dataAdapter As System.Data.IDbDataAdapter = New
System.Data.SqlClient.SqlDataAdapter
Dim dataSet As System.Data.DataSet = New System.Data.DataSet
dbCommand.Connection = dbConnection
dbCommand.CommandText = "SELECT * FROM MY_TABLE"
dataAdapter.SelectCommand = dbCommand
dataAdapter.Fill(dataSet)
thanks,
Lacka