Load SQL Server db when application starts

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • =?Utf-8?B?UGhpbCBKb2huc29u?=

    Load SQL Server db when application starts

    I have a C# app using a SQL Server db which is attached to my SQL Server,
    when I deploy though I want the app to lift (or load) the SQL Server at
    runtime so the user does not have to attach to the mdf file, I can just
    include it in my application folder and it will load when the application
    runs.

    Am I right in thinking I can just detach my current mdf file from SQL server
    and put it in the application folder (or is there a better sub floder to put
    it in)?

    Also, does anybody have any examples of connection strings that will load a
    db file in this way, rather than containing the server name etc?

    --
    Regards,

    Phillip Johnson (MCSD For .NET)
    PJ Software Development

  • =?Utf-8?B?UGhpbCBKb2huc29u?=

    #2
    RE: Load SQL Server db when application starts

    Found an answer to this one myself....

    Find links to Help for older versions of the SQL Server products and services.


    --
    Regards,

    Phillip Johnson (MCSD For .NET)
    PJ Software Development



    "Phil Johnson" wrote:
    I have a C# app using a SQL Server db which is attached to my SQL Server,
    when I deploy though I want the app to lift (or load) the SQL Server at
    runtime so the user does not have to attach to the mdf file, I can just
    include it in my application folder and it will load when the application
    runs.
    >
    Am I right in thinking I can just detach my current mdf file from SQL server
    and put it in the application folder (or is there a better sub floder to put
    it in)?
    >
    Also, does anybody have any examples of connection strings that will load a
    db file in this way, rather than containing the server name etc?
    >
    --
    Regards,
    >
    Phillip Johnson (MCSD For .NET)
    PJ Software Development
    www.pjsoftwaredevelopment.com

    Comment

    Working...