Skip to main content
edited tags
Link
pnuts
  • 59.8k
  • 11
  • 93
  • 141
edited tags
Link
John Koerner
  • 38.2k
  • 8
  • 92
  • 142
Source Link
Kruug
  • 449
  • 2
  • 9
  • 20

Connecting to Microsoft SQL Server from Visual Basic

I am attempting to connect to Microsoft SQL Server 2008 R2 from within Microsoft Visual Studio 2010. My connection string is as follows:

connection = New SqlConnection("Server=localhost;Database=greenapplication;User ID=WindowsID;Password=WindowsPassword")

I keep getting this exception: System.Data.SqlClient.SqlException:

Login failed for user 'WindowsID'.

What am I doing wrong? Are there certain permissions that I have to set up?