views:

44

answers:

3

My app fails at this line of code:

Dim objConnection As New SqlConnection(Application("ConnString"))

My connection string is:

"Server=testAITSQL;Database=SSCommerce;UID=PlanoWebApp;PWD=XXXXXXXX;"

I googled this problem and the solution for it was having a malformed connection string where the "provider" was being specified when it shouldn't have. Example conn string:

Provider=SQLOLEDB.1;Integrated Security=SSPI;DATABASE=APInquiry;SERVER=SqlServer

I'm not specifying the Provider so I think I have a different problem...???

A: 

maybe, for sh!7s and giggles, try Application("ConnString").tostring

You are connecting to a SQL Server, right? My ConnString has the following options: Server Database User ID Password

Sage
Doesn't work...
Which thing doesnt work? The .tostring() or using the 4 keywords I provided?
Sage
EG: Server=ServerName;Database=DBName;User ID=Username;Password=PWD;
Sage
The ToString didn't work and I checked my conn string for the 4 keywords too.
+1  A: 

Provider=xxxx is not a valid .net connection string token.

You are already implicitly specifying the provider by instantiating a SqlConnection.

Drop the provider pair and you will be golden.

Sky Sanders
Assuming @user408869 posted the right connection string, @user408869 said they weren't using Provider in the conn string
LittleBobbyTables
@lit - right you are. I think the fact that you actually read the question might have something to do with your likely correct answer. ;-)
Sky Sanders
@Sky - When all is said and done, you may end up being technically correct as well, which is the best kind of correct
LittleBobbyTables
+2  A: 

Does your test server have the exact same configuration file as your development machine? I suspect the configuration file on your test machine may have a different set of values for ConnString than you are expecting.

LittleBobbyTables
yes. this is likely the problem. seems obvious when one actually reads the question ;-)
Sky Sanders
@Sky - The way I've been reading questions today, I'll be happy to get one right :)
LittleBobbyTables
the app on the test server had it's own global.asa, and i merged my changes into a sub-directory of that app with it's own global.asax (didn't know that was possible - app is classic asp though, and my changes were .NET). anyway, the app's global was overwriting my global.