RE: sql server express connection



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
.



Relevant Pages

  • Re: sql server express connection
    ... is that though the data has been refreshed and the win app ... reconnects to the database to collect the updates it does not ... better way of 2 apps using the same database without having to attach it. ...
    (microsoft.public.dotnet.languages.csharp)
  • Re: Locking a database file prior to copying it
    ... My application updates a sql server 2005 express database prior to ... file properly prior to copying it. ... Did you attach the db file in your connection string? ...
    (microsoft.public.dotnet.languages.csharp)
  • RE: Detach SQL Server Express 2005 Database on Form Startup
    ... I want to attach one database on the file system within my ... then I can try calling the same connection string with the ... corrupted somehow during development and I can't attach the DB. ... not been attached to the user instance. ...
    (microsoft.public.dotnet.framework.windowsforms)
  • Re: secure my DLL against use by others
    ... A DLL is not an executable. ... which case it may access the database using the context of the user account ... Connection String with valid credentials into the DLL itself. ... Presumably your DLL performs updates to a database when its methods are ...
    (microsoft.public.dotnet.general)
  • Re: Change Connection String at runtime.
    ... easily moved to another database, or have versions for each database. ... connection string to the connectionobject before the connection opens. ... *The Server IP number is different for every deployment. ... It appears that the generated code uses the application settings to ...
    (microsoft.public.dotnet.framework.adonet)