I am able to connect to an sql server from my server explorer. Can't seem to connect
to an sql server from my code.
this is what i am doing
String strConnection = "server=FRANK;database=Northwind;integrated security=true;";
SqlConnection objConnection = new SqlConnection(strConnection);
objConnection.Open
objConnection.Close();
error Login Failure for user FRANK
I know that my server name is FRANK because thats what it says on my Sql Service manager.
And i use that same server name when i connect from my Server Explorer(using Visual Studio.NET) and then i get a listing of the the Databases that are associated with my SQL Server.
I have no problems coonecting to an Access dataBase using OLedbConnectionI'm not sure if "server" is the same as "Data Source", but try using "Data Source" instead:
String strConnection = "Data Source=FRANK;database=Northwind;integrated security=true";sql
No comments:
Post a Comment