Q1) Use the SQL Server Provider.
Q2) Depends on your needs. There's really no "best" method for this. I
currently have apps that use App.Config, web sites that use Web.Config apps
that use a custom xml configuration files and a whole series of apps that
store the last 10 connection strings in the registry. It all depends on the
nature of your app.
A connection string is just a string. In terms of storing it and handing it
around your app it's really no different from any other string variable. That
being the case, you can store it literally anywhere else you might choose to
store a string.
--
Andrew Faust
http://www.andrewfaust.com [quoted text, click to view] "Mike TI" wrote:
> Oct 31, 2007
>
> Hi all
>
> Sorry for repeating my previous posting. I am new to VB Net.
>
> Q1. Which provider should be preferred when defining a connection, Data
> provider for SQL server or Data provider for OLEDB. I intend to use SQL
> Express 2005.
>
> Q2. I have a database on my local PC (SQL Server Express) and the same
> database on a remote PC. I built a simple form with a grid. Now I want to
> define the connection string in such a way that I am able to use any one of
> the above two by changing the connection string definition on one place.
>
> How do I go about this.
>
> Thank you in advance.
>
> Mike TI
>
>