Hi,
I'm really new to sql server. I just installed MSDE 2000 on our company's network server. Then I quickly wrote a VB.Net program to access a database on the server. I used this code:
Dim objConn As New SqlConnection("workstation id=steve;packet size=4096;integrated security=SSPI;data source=SQLSERVER;persist security info=False;initial catalog=TXNIC")
Dim objCommand As New SqlCommand
Dim objDa As New SqlDataAdapter
Dim objDs As New DataSet
objCommand.CommandText = "Select * From Candidates"
objCommand.Connection = objConn
objDa.SelectCommand = objCommand
objDa.Fill(objDs, "Table1")
MessageBox.Show(objDs.Tables("Table1").Rows(10).Item("LastName"))
objConn.Close()
The above Code Worked perfectly!!!
Then I took the same code as above, (except for the Messagebox line), and placed in an ASP.Net web page. It bombed with this error:
Login failed for user '(null)'. Reason: Not associated with a trusted SQL Server connection.
Does anyone know how to fix this?
Thanks.
Steve
I'm really new to sql server. I just installed MSDE 2000 on our company's network server. Then I quickly wrote a VB.Net program to access a database on the server. I used this code:
Dim objConn As New SqlConnection("workstation id=steve;packet size=4096;integrated security=SSPI;data source=SQLSERVER;persist security info=False;initial catalog=TXNIC")
Dim objCommand As New SqlCommand
Dim objDa As New SqlDataAdapter
Dim objDs As New DataSet
objCommand.CommandText = "Select * From Candidates"
objCommand.Connection = objConn
objDa.SelectCommand = objCommand
objDa.Fill(objDs, "Table1")
MessageBox.Show(objDs.Tables("Table1").Rows(10).Item("LastName"))
objConn.Close()
The above Code Worked perfectly!!!
Then I took the same code as above, (except for the Messagebox line), and placed in an ASP.Net web page. It bombed with this error:
Login failed for user '(null)'. Reason: Not associated with a trusted SQL Server connection.
Does anyone know how to fix this?
Thanks.
Steve