|
Home > Archive > MS SQL Server > October 2006 > Sql Server Express in a Winforms Application
You are viewing an archived Text-only version of the thread.
To view this thread in it's original format and/or if you want to reply to
this thread please [click here]
| Author |
Sql Server Express in a Winforms Application
|
|
| Yaakov 2006-10-31, 12:15 am |
| We are thinking of using a Sql Server Express database (.mdb) as a data
resource in a Windows Forms application that we will be distributing to
clients. When the application is built, the mdb file is copied to the
bin directory.
In order for clients to access this database, will they need to have an
instance of the SQLEXPRESS server installed on their computer? Or since
the mdb file is being accessed from a .Net 2.0 application, there is no
need to install a separate db component?
If I do have to separately install the db component on the client end,
is this the way to go about it:
http://msdn.microsoft.com/library/d...qlexcustapp.asp
? Or is there a different/better way?
Thanks!
| |
| Erland Sommarskog 2006-10-31, 12:15 am |
| Yaakov (yellis@gmail.com) writes:
> In order for clients to access this database, will they need to have an
> instance of the SQLEXPRESS server installed on their computer? Or since
> the mdb file is being accessed from a .Net 2.0 application, there is no
> need to install a separate db component?
The former. SQL Server is a client-server application. .Net 2.0 talks to
the server, it does not access the database file directly.
> If I do have to separately install the db component on the client end,
> is this the way to go about it:
> http://msdn.microsoft.com/library/d...rl=/library/en-
> us/dnsse/html/emsqlexcustapp.asp
> ? Or is there a different/better way?
I have no experience of building applications with SQL Express, embedded,
but looking at the title, this article appears to hit the target.
--
Erland Sommarskog, SQL Server MVP, esquel@sommarskog.se
Books Online for SQL Server 2005 at
http://www.microsoft.com/technet/pr...oads/books.mspx
Books Online for SQL Server 2000 at
http://www.microsoft.com/sql/prodin...ions/books.mspx
| |
| Norman Yuan 2006-10-31, 12:15 am |
| Database file for SQL Server Express (the same as SQL Server) is *.mdf and
*ldf, not *.mdb.
Yes, you need to install an instance of SQL Server/SQL Server Express, that
attach the *.mdf/*.ldf file to the SQL Server/Express instance, before your
application can connect to the database (contained in the *.mdf/*.ldf
files).
Making the SQL Server Express's installation into the single setup package
as your app is a bit cmoplicated task, as the article you referred shows.
I'd prefer install the SQL Server Express seperately.
"Yaakov" <yellis@gmail.com> wrote in message
news:1162132353.862676.181850@m73g2000cwd.googlegroups.com...
> We are thinking of using a Sql Server Express database (.mdb) as a data
> resource in a Windows Forms application that we will be distributing to
> clients. When the application is built, the mdb file is copied to the
> bin directory.
>
> In order for clients to access this database, will they need to have an
> instance of the SQLEXPRESS server installed on their computer? Or since
> the mdb file is being accessed from a .Net 2.0 application, there is no
> need to install a separate db component?
>
> If I do have to separately install the db component on the client end,
> is this the way to go about it:
> http://msdn.microsoft.com/library/d...qlexcustapp.asp
> ? Or is there a different/better way?
>
> Thanks!
>
| |
| Yaakov 2006-10-31, 12:15 am |
| Norman - you are right - mdf, not mdb
Given our client-base, the installation routine needs to be as simple
as possible. Requiring them to install Sql Server Express and then
install our problem will definitely cause problems.
Do you know how it is possible to attach an mdf/ldf file to a Sql
Express instance, on a remote machine?
Norman Yuan wrote:
> Database file for SQL Server Express (the same as SQL Server) is *.mdf and
> *ldf, not *.mdb.
>
> Yes, you need to install an instance of SQL Server/SQL Server Express, that
> attach the *.mdf/*.ldf file to the SQL Server/Express instance, before your
> application can connect to the database (contained in the *.mdf/*.ldf
> files).
>
> Making the SQL Server Express's installation into the single setup package
> as your app is a bit cmoplicated task, as the article you referred shows.
> I'd prefer install the SQL Server Express seperately.
| |
|
| If you are coding in .Net 2.0 you can connect to the db server within
the application, either remotely or on the client. And if you are
wanting to collectively store the data from each of these clients into
a collectively onto a single database you can still do this either way.
You will either have to configure the database or the application. It
just depends on your requirements. Each of these has its benefit and
added complexity on different ends of the architecture.
Kat
Yaakov wrote:
> We are thinking of using a Sql Server Express database (.mdb) as a data
> resource in a Windows Forms application that we will be distributing to
> clients. When the application is built, the mdb file is copied to the
> bin directory.
>
> In order for clients to access this database, will they need to have an
> instance of the SQLEXPRESS server installed on their computer? Or since
> the mdb file is being accessed from a .Net 2.0 application, there is no
> need to install a separate db component?
>
> If I do have to separately install the db component on the client end,
> is this the way to go about it:
> http://msdn.microsoft.com/library/d...qlexcustapp.asp
> ? Or is there a different/better way?
>
> Thanks!
| |
| Arnie Rowland 2006-10-31, 12:15 am |
| You may find this article useful for unattended installations:
SQL Server 2005 UnAttended Installations
http://www.devx.com/dbzone/Article/31648
And yes, you can attach a database file (*.mdf) to an existing SQL Server
instance.
Look in Books Online for sp_attach_db.
--
Arnie Rowland, Ph.D.
Westwood Consulting, Inc
Most good judgment comes from experience.
Most experience comes from bad judgment.
- Anonymous
You can't help someone get up a hill without getting a little closer to the
top yourself.
- H. Norman Schwarzkopf
"Yaakov" <yellis@gmail.com> wrote in message
news:1162136707.845482.111650@m7g2000cwm.googlegroups.com...
> Norman - you are right - mdf, not mdb
>
> Given our client-base, the installation routine needs to be as simple
> as possible. Requiring them to install Sql Server Express and then
> install our problem will definitely cause problems.
>
> Do you know how it is possible to attach an mdf/ldf file to a Sql
> Express instance, on a remote machine?
>
> Norman Yuan wrote:
>
| |
| Erland Sommarskog 2006-10-31, 12:15 am |
| Yaakov (yellis@gmail.com) writes:
> Given our client-base, the installation routine needs to be as simple
> as possible. Requiring them to install Sql Server Express and then
> install our problem will definitely cause problems.
The user-friendly way to do it, would be to install SQL Express as part
of your installation. That appears to be discussed in the article you
referred to in your original post.
--
Erland Sommarskog, SQL Server MVP, esquel@sommarskog.se
Books Online for SQL Server 2005 at
http://www.microsoft.com/technet/pr...oads/books.mspx
Books Online for SQL Server 2000 at
http://www.microsoft.com/sql/prodin...ions/books.mspx
|
|
|
|
|