Help-VB.NET and SQL Server 2005

Help-VB.NET and SQL Server 2005

am 23.01.2008 11:30:50 von sheenitmathew

Hai all,

I developed an application software using VB 6.0 at front end and MS
Access 2000 at the

back end. The application runs very slow as the size of the database
increses. I used

ODBC to link the front and back ends, and copied the data base file to
the user's

machine.

Now I plan to re-write the application using VB.NET and SQL Server
2005. Here comes my

problem. My application is a stand alone one. There is no server or
client machines. It

runs on a single computer system. When I develop it I use the
connection string

something like: "Data Source=COM3\SQLEXPRESS;Initial
Catalog=ImgDB;Integrated

Security=True". Even if I use OLEDB or ODBC, I am asked to connect to
the SQL Server. In

my machine I have installed it, so it runs without any problem.

My doubt is this: When I make exe files of my application and install
it on another

machine, that do not have SQL Server, the connection string will be
wrong. Besides, even

if my user's system has SQL Server the computer's name may be
different. So the Data

Source=COM3\SQLEXPRESS part will make an error. It is not possible to
edit the

connection string in an exe file. And I would like to know how can I
port my specific

database to the user's system.

I am a new face in VB.NET and SQL Server 2005. Please help me to solve
this problem.

Thanks in advance for your valuable replies.

Re: Help-VB.NET and SQL Server 2005

am 23.01.2008 14:12:38 von Dan Guzman

First, I suggest you use SqlClient rather than OleDb ir ODBC for SQL Server
database access in .NET.

The Best Practice is to make database connection strings and other
environment-specific items configurable instead of hard-coding those in your
application. The .NET framework provides a number of options, such as
application settings, to facilitate storing and loading configuration data.
You can prompt for and set the proper values during installation and/or
provide a UI for the user to change the settings. See the Visual Studio
documentation for more information.

If your application reqiures SQL Server, you might consider providing the
option to install SQL Express in cases where the company does not have an
existing SQL Server. See
http://www.microsoft.com/sql/editions/express/redistregister .mspx for
redistribution information.

--
Hope this helps.

Dan Guzman
SQL Server MVP

wrote in message
news:4daef045-4013-4e16-a1cd-f949e846e8f9@d4g2000prg.googleg roups.com...
> Hai all,
>
> I developed an application software using VB 6.0 at front end and MS
> Access 2000 at the
>
> back end. The application runs very slow as the size of the database
> increses. I used
>
> ODBC to link the front and back ends, and copied the data base file to
> the user's
>
> machine.
>
> Now I plan to re-write the application using VB.NET and SQL Server
> 2005. Here comes my
>
> problem. My application is a stand alone one. There is no server or
> client machines. It
>
> runs on a single computer system. When I develop it I use the
> connection string
>
> something like: "Data Source=COM3\SQLEXPRESS;Initial
> Catalog=ImgDB;Integrated
>
> Security=True". Even if I use OLEDB or ODBC, I am asked to connect to
> the SQL Server. In
>
> my machine I have installed it, so it runs without any problem.
>
> My doubt is this: When I make exe files of my application and install
> it on another
>
> machine, that do not have SQL Server, the connection string will be
> wrong. Besides, even
>
> if my user's system has SQL Server the computer's name may be
> different. So the Data
>
> Source=COM3\SQLEXPRESS part will make an error. It is not possible to
> edit the
>
> connection string in an exe file. And I would like to know how can I
> port my specific
>
> database to the user's system.
>
> I am a new face in VB.NET and SQL Server 2005. Please help me to solve
> this problem.
>
> Thanks in advance for your valuable replies.