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. local database connection string

local database connection string

Scheduled Pinned Locked Moved C#
databasecsharpsql-servervisual-studiosysadmin
6 Posts 2 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.
  • D Offline
    D Offline
    Deresen
    wrote on last edited by
    #1

    Hello everyone, I'm working with a database. Currently I am using the "Microsoft SQL Server 2005". But I would like to work with a database which is inside Visual studio. So I thought about using the "Local Database". In my solution I added a new item called "Local Database". I created a new table and tried to connect with it in the same way as I used with the SQL server, but it didn't work. I use this connectionstring with the SQL server: connectionString = "server=DERESEN\\SQLEXPRESS;Trusted_Connection=yes;database=master;" And I use this connection string for the local database: connectionString3 = "server=Datatbase.sdf;Trusted_Connection=yes;" The list in SQL server looks like this: DERESEN\SQLEXPRESS -> Databases -> System Databases -> master -> Tables -> myTable The list in server Explorer looks like this: Data Connections -> Database.sdf -> Tables -> myTable Does anyone know how to get this working? I cannot find it anywhere on internet.

    A 1 Reply Last reply
    0
    • D Deresen

      Hello everyone, I'm working with a database. Currently I am using the "Microsoft SQL Server 2005". But I would like to work with a database which is inside Visual studio. So I thought about using the "Local Database". In my solution I added a new item called "Local Database". I created a new table and tried to connect with it in the same way as I used with the SQL server, but it didn't work. I use this connectionstring with the SQL server: connectionString = "server=DERESEN\\SQLEXPRESS;Trusted_Connection=yes;database=master;" And I use this connection string for the local database: connectionString3 = "server=Datatbase.sdf;Trusted_Connection=yes;" The list in SQL server looks like this: DERESEN\SQLEXPRESS -> Databases -> System Databases -> master -> Tables -> myTable The list in server Explorer looks like this: Data Connections -> Database.sdf -> Tables -> myTable Does anyone know how to get this working? I cannot find it anywhere on internet.

      A Offline
      A Offline
      Ashfield
      wrote on last edited by
      #2

      Connections to SQL Server don't work like that. Have a look at http://www.connectionstrings.com/[^]

      Bob Ashfield Consultants Ltd

      D 1 Reply Last reply
      0
      • A Ashfield

        Connections to SQL Server don't work like that. Have a look at http://www.connectionstrings.com/[^]

        Bob Ashfield Consultants Ltd

        D Offline
        D Offline
        Deresen
        wrote on last edited by
        #3

        Well, I can allready connect to a database. But do you know how to use the Local Database which is embedded in visual studio?

        A 1 Reply Last reply
        0
        • D Deresen

          Well, I can allready connect to a database. But do you know how to use the Local Database which is embedded in visual studio?

          A Offline
          A Offline
          Ashfield
          wrote on last edited by
          #4

          AFAIK there is no database embedded within Visual studio - unless you are talking about datasets?

          Bob Ashfield Consultants Ltd

          D 1 Reply Last reply
          0
          • A Ashfield

            AFAIK there is no database embedded within Visual studio - unless you are talking about datasets?

            Bob Ashfield Consultants Ltd

            D Offline
            D Offline
            Deresen
            wrote on last edited by
            #5

            Well I really am talking about a database. When you go to your project and add an item, there is also an item called "local database". This is the database I am talking about. I've never heard of dataset's though, does this has to do something with databases too?

            A 1 Reply Last reply
            0
            • D Deresen

              Well I really am talking about a database. When you go to your project and add an item, there is also an item called "local database". This is the database I am talking about. I've never heard of dataset's though, does this has to do something with databases too?

              A Offline
              A Offline
              Ashfield
              wrote on last edited by
              #6

              The thing you are referring to is 'An empty SQL Server Compact Edition database for local data' So presumably you need to look at connection strings for that, but its not embedded within your app. Datasets are collections of datatables. Try Google.

              Bob Ashfield Consultants Ltd

              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