PC Review


Reply
Thread Tools Rate Thread

Connections String Questions

 
 
Mike TI
Guest
Posts: n/a
 
      31st Oct 2007
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


 
Reply With Quote
 
 
 
 
Mary Chipman [MSFT]
Guest
Posts: n/a
 
      31st Oct 2007
As far as Q1 - always use SqlClient with a SQL Server or SQL Express
database.

You can supply connection strings in a variety of ways. I'd search the
Help on connection strings to see what best suits your application.

-Mary

On Wed, 31 Oct 2007 04:53:29 -0800, "Mike TI" <(E-Mail Removed)>
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
>

 
Reply With Quote
 
=?Utf-8?B?QW5kcmV3IEZhdXN0?=
Guest
Posts: n/a
 
      1st Nov 2007
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


"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
>
>
>

 
Reply With Quote
 
Cor Ligthert[MVP]
Guest
Posts: n/a
 
      3rd Nov 2007
In addition to Andrew,

....................and even set that in a combobox.

Cor
 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Array of db connections with string subscription John Microsoft Dot NET Framework Forms 7 8th Jan 2008 11:52 AM
network connections options/questions Steven Wabik Windows XP General 4 28th Aug 2006 02:30 AM
Connections String Charles A. Lackman Microsoft ADO .NET 3 21st Feb 2005 06:24 PM
Where to store connections string Simon Harvey Microsoft ASP .NET 5 16th Feb 2004 06:09 AM
Questions on P4P800 Deluxe Internal USB Header Connections da_xanadu Asus Motherboards 1 17th Jul 2003 09:06 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 09:46 AM.