RE: sql server express connection
- From: Peter Bromberg [C# MVP] <pbromberg@xxxxxxxxxxxxxxxxxxxx>
- Date: Tue, 26 Feb 2008 13:56:00 -0800
Richard,
The AttachDbFilename= and UserInstance type of connection string creates a
UserInstance host process for the database, and is really designed for ease
of development. In production, you want to attach the MDF file from sql
server management console and use a "regular" connection string, e.g.
server=(local);database=mydb;uid=username;pwd=pass
-- Peter
Site: http://www.eggheadcafe.com
UnBlog: htp://petesbloggerama.blogspot.com
Short Urls & more: http://ittyurl.net
"Richard Steele" wrote:
Hi.
I have a win app (allways running 24x7) (.net 2 c#) that uses sql server
express.
and i use the following connection string to attach it in the app.config
<connectionStrings>
<add name="Browser.Properties.Settings.DataConnectionString"
connectionString="Data
Source=.\SQLEXPRESS;AttachDbFilename=C:\data\Data.mdf;Integrated
Security=True;Connect Timeout=60;Database=papdata;User Instance=False;"
providerName="System.Data.SqlClient" />
</connectionStrings>
Every day a win service, using the same MDB updates/imports the data from
another source. This all works as expected. when the windows service has
completed its update, the win app is notified to refresh its data and show
the updates.
My issue, is that though the data has been refreshed and the win app
reconnects to the database to collect the updates (new datasets) it does not
reflect the updates, simply the older version. I think it is the way I have
attached the database (the win app starts first on sys reboot) is there a
better way of 2 apps using the same database without having to attach it.
Hope this makes sense
--
Thanks
Richard
- Prev by Date: Re: How do I Invoke a ListViewItem thread?
- Next by Date: Re: Generic Delegate Meltdown From Constraint
- Previous by thread: Re: sql server express connection
- Next by thread: Name of an instance in designer mode
- Index(es):
Relevant Pages
|
|