Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 General SQL Server Forums
 New to SQL Server Programming
 unable to connect to SQL

Author  Topic 

iworkonline
Starting Member

3 Posts

Posted - 2010-04-15 : 16:41:55
Hey Guys

I am using the following connection string
_connectionString = "Provider=SQLOLEDB;Data Source=MyServer;Initial Catalog=MyDB;User Id=MyUername;password=;Trusted_Connection=yes"


The above line was working just fine and I tried to use a diff. database and it gave me a valid error from VS2005 then I changed the connection string to original form and now getting the following error error

End of Stream encountered before parsing was completed.


I dont hav a password setup so that optin is blank, I also tried to remove the password option but that did not work.
Thanks.

tkizer
Almighty SQL Goddess

38200 Posts

Posted - 2010-04-15 : 19:20:13
You can't use both a trusted connection and pass userid/password. It's one or the other. Trusted connection means to use Windows authentication. Userid/password combo means to use SQL authentication. So which one are you supposed to be using?

For more information on valid SQL Server connection strings, check this out: http://connectionstrings.com/sql-server-2008

Tara Kizer
Microsoft MVP for Windows Server System - SQL Server
http://weblogs.sqlteam.com/tarad/

Subscribe to my blog
Go to Top of Page

Sachin.Nand

2937 Posts

Posted - 2010-04-16 : 03:25:39
But you didnt mention anything for the password.Change the password part to
 password=''
and try.

PBUH
Go to Top of Page
   

- Advertisement -