Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C#
  4. connctionstring

connctionstring

Scheduled Pinned Locked Moved C#
databasecsharphelp
5 Posts 5 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • F Offline
    F Offline
    farokhian
    wrote on last edited by
    #1

    Hi Please somebody help me. I need a connectionstring for c#windows application that connect to my database(my database near exe files in bin)without attach my database in microsoft sql 2005.

    P D L K 4 Replies Last reply
    0
    • F farokhian

      Hi Please somebody help me. I need a connectionstring for c#windows application that connect to my database(my database near exe files in bin)without attach my database in microsoft sql 2005.

      P Offline
      P Offline
      PIEBALDconsult
      wrote on last edited by
      #2

      An SQL Server database must be attached to an SQL Server in order to access it. There are databases don't rely on a server, you could try one of those, but I don't recommend it. Why don't you want to attach it? You could attach it only for the duration of your application.

      1 Reply Last reply
      0
      • F farokhian

        Hi Please somebody help me. I need a connectionstring for c#windows application that connect to my database(my database near exe files in bin)without attach my database in microsoft sql 2005.

        D Offline
        D Offline
        dan sh
        wrote on last edited by
        #3

        Why would you need to do that?

        50-50-90 rule: Anytime I have a 50-50 chance of getting something right, there's a 90% probability I'll get it wrong...!!

        1 Reply Last reply
        0
        • F farokhian

          Hi Please somebody help me. I need a connectionstring for c#windows application that connect to my database(my database near exe files in bin)without attach my database in microsoft sql 2005.

          L Offline
          L Offline
          Lost User
          wrote on last edited by
          #4

          There's two items: your database, and a database-server. You can only manipulate databases that are (temporarily) attached. You can talk to a database-file after you informed the server where the file is located. Try something like this;

          Server=.\SQLExpress;
          AttachDbFilename=|DataDirectory|\myDatabase.mdf;
          Database=DatabaseAlias;
          Trusted_Connection=Yes;

          The "AttachDbFilename" makes sure that you can access the database-file without having to "attach" it. Good luck :)

          I are Troll :suss:

          1 Reply Last reply
          0
          • F farokhian

            Hi Please somebody help me. I need a connectionstring for c#windows application that connect to my database(my database near exe files in bin)without attach my database in microsoft sql 2005.

            K Offline
            K Offline
            kstls
            wrote on last edited by
            #5

            If you don't want to rely on a DB server, you can us a smaler DBMS like SQLite I use that from time to time with minor apps.

            1 Reply Last reply
            0
            Reply
            • Reply as topic
            Log in to reply
            • Oldest to Newest
            • Newest to Oldest
            • Most Votes


            • Login

            • Don't have an account? Register

            • Login or register to search.
            • First post
              Last post
            0
            • Categories
            • Recent
            • Tags
            • Popular
            • World
            • Users
            • Groups