|
-
Feb 1st, 2011, 10:09 AM
#1
Thread Starter
New Member
SQL Server 2005 Connection String Problem
I'm having problem with my connection string .
I'm trying to connect to the database through my web application of my site but it gives the following error message.
" [DBNETLIB][ConnectionOpen (ParseConnectParams()).]Invalid connection.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
Exception Details: System.Data.OleDb.OleDbException: [DBNETLIB][ConnectionOpen (ParseConnectParams()).]Invalid connection. "
I'm using the following connection string:
Server=myServerAddress;Database=myDataBase;User ID=myUsername;Password=myPassword;Trusted_Connection=False;
-
Feb 1st, 2011, 12:37 PM
#2
Re: SQL Server 2005 Connection String Problem
Two things:
1) What kind of database are you connecting to?
2) The reason it fails is because no provider has been declared. OLEDB isn't database specific (like the way ORACLIENT or SQLCLient or MySQLCLient are) so you need to specify what provider to use in order to complete the connection. So this goes back to my #1 point... what kind of database are you trying to connect to?
-tg
-
Feb 1st, 2011, 01:26 PM
#3
Thread Starter
New Member
Re: SQL Server 2005 Connection String Problem
i'm using a ms sql server 2005 database. for this i'm using SQLOLEDB.1 provider.
-
Feb 1st, 2011, 02:38 PM
#4
Re: SQL Server 2005 Connection String Problem
Well, first, no you're not... you didn't specify a provider in your connection string. oledbclient doesn't use a provider by default... you need to specify it.
Secondly: Why? Use the SQLClient namespace instead... It's there for you already to use. It's designed specifically to be used going against SQL Server databases (I wasn't paying attention to the subject line the first time around).
If you got to the Database FAQ & Tutorials section in the Database Forums, you'll find plenty there to show you how it all goes together.
-tg
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|