Hi
I was origionally using this connection string:
mydataadapter.SelectCommand.Connection = New SqlConnection("Data
Source=server;Initial Catalog=database;Integrated Security=SSPI;")
Which throws this error - Login failed for user '(null)'. Reason: Not
associated with a trusted SQL Server connection.
"Patrice" <no****@nowhere.com> wrote in message
news:%2****************@TK2MSFTNGP12.phx.gbl...
See a site such as http://www.connectionstrings.com/ for valid strings.
Basically :
Data Source is the server name, the database name goes in Initial Catalog.
AFAIK when using a Windows account, you just turn "intergrated security"
on. You can only connect using the currently used Windows account...
Patrice
--
"Ben" <Be*@NoSpam.com> a écrit dans le message de
news:uH**************@TK2MSFTNGP10.phx.gbl... Hi
I am updating a project from Access to run on our SQL Server DB.
Currently I am struggling to connect to the database. I have this code which is
throwing this error: SQL Server does not exist or access denied.
Dim mydataadapter As New SqlDataAdapter
mydataadapter.SelectCommand = New SqlCommand(strSQL)
mydataadapter.SelectCommand.Connection = New SqlConnection("Data
Source=servername\databasename;User ID=domain\username")
mydataadapter.Fill(myDataSet, "tblClient.Client_ID")
myDataGrid.DataSource = myDataSet.Table("tblClient.Client_ID")
myDataGrid.DataBind()
Any ideas
Thanks B