Connecting with .Net in SQL Server 2005 (Winforms)
I diong a typical Windows integrated connection from a .Net Winforms application:
Dim sqlConnetion As New SqlConnection ("Server = jupiter; Database = io; Integrated Security = True;") sqlConnetion.Open ()
I keep getting the following error:
Unable to open database "io" requested at login. Login failed. Login failed for user "MARS \ viking".
I've also tried the following connection string variations with the same results:
Data source = jupiter; Home directory = io; Integrated Security = True;
Data source = MSSGDEV; Home directory = MSSQLSERVER; Integrated Security = SSPI;
Unfortunately I can connect to the db using SQL Management Studio with the same user from the same computer using built-in security. Is there a mistake in my connection code? Or is there some special configuration parameter on the SQL server that I have to set in order to allow connections to the code?
a source to share
Try "Data Source = Jupiter; Initial Directory = io; Integrated Security = True; instead. If you are using Integrated Security, you need to use Source Source / Initial Catalog. If you are using Trusted_Connection, you can use Server / Database. ConnectionStrings.com is fantastic.
a source to share