Link to home
Start Free TrialLog in
Avatar of Idarac
Idarac

asked on

Use VB.Net to connect with MSDE SQL and Server 2000

I would like to know my options on using VB.Net to work with MSDE 2000 datafile. I want to be able to use the MSDE 2000 to do my devlopment work then transfer the data file to SQL 2000 in a multi-usewr environment.
Question: How do I set up the connection to VB.Net so I can connect seamlessly to the same dataset in SQL 2000 and MSDE. If possible I should not have to make any changs to the connection string whne switching from MSDE to SQL 2000 and back  
Avatar of Jeff Certain
Jeff Certain
Flag of United States of America image

The connection strings should be identical for SQL and MSDE, assuming you have the same user in both servers, with the same password and same permissions...
Avatar of Fernando Soto
And lets not forget the  Data Source in the connection string, as long as they do not differ between the two.
Good call, Fernando.

Maybe I'll just say it this way: The connection string formats are the same. Making the details match your particular server is your own responsibility... there is no way to make the two connection strings identical, since you're hitting different servers -- unless you use DSN, which will cause it's own issues.
With MSDE, isn't the server name taken from the machine name?  If so, then the connection string would be best created in an Application config file:

Storage of Connection String in .config file:
http://www.dotnet247.com/247reference/msgs/31/158640.aspx

Bob
Bob,

As a matter of personal preference, I'd store connection strings for a production machine somewhere other that the config file. Something about putting my user credentials into a plain-text file just doesn't sit well. Encrypted registry entries are a little more my style...

Jeff
I second that Jeff.
Avatar of Idarac
Idarac

ASKER

I am doing the develoment work independently and when finished sending the database and application off to the client. So I can setup my environment the same as the client.

Can anyone give me an source code example of what a conection stirng would look like?

Part of my question was the diferent options? DSN etc.
ASKER CERTIFIED SOLUTION
Avatar of Fernando Soto
Fernando Soto
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Hi Bob;

I too would like a resolution on this question.

Thanks;
Fernando