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. Database & SysAdmin
  3. Database
  4. How to set up a database and use it

How to set up a database and use it

Scheduled Pinned Locked Moved Database
helpdatabasetutorialcsharpsql-server
4 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.
  • T Offline
    T Offline
    toprogramminguy
    wrote on last edited by
    #1

    Hi, I've been stuck for some time trying to set up a database and access it from a program. I don't know which database to use which is part of my problem. I've tried using sql server but I don't know how to create a connection to it from a program. For example I have a connection string but I don't know what to use as a user id or password. I had an oleDb database set up and it was working fine but I don't know how to write data to it. Could somebody give me advice on which database to use and how to set it up? Any help would be appreciated. Thanks oh by the way I'm using c#

    W 1 Reply Last reply
    0
    • T toprogramminguy

      Hi, I've been stuck for some time trying to set up a database and access it from a program. I don't know which database to use which is part of my problem. I've tried using sql server but I don't know how to create a connection to it from a program. For example I have a connection string but I don't know what to use as a user id or password. I had an oleDb database set up and it was working fine but I don't know how to write data to it. Could somebody give me advice on which database to use and how to set it up? Any help would be appreciated. Thanks oh by the way I'm using c#

      W Offline
      W Offline
      Wendelius
      wrote on last edited by
      #2

      I would advise you to get a few good books, but to your questions:

      toprogramminguy wrote:

      I don't know which database to use which is part of my problem

      You could use SQL Server Express Edition. Download, install it and start using by creating a db, tables etc.

      toprogramminguy wrote:

      I've tried using sql server but I don't know how to create a connection to it from a program

      You use SqlConnection[^]. Define a connection string and open the connection. Good example in the link in examples.

      toprogramminguy wrote:

      I don't know what to use as a user id or password

      If you use integrated security, you don't need separate username and password. If you use SQL Server authentication, you use SA as user and the password is defined during setup.

      toprogramminguy wrote:

      I had an oleDb database set up and it was working fine but I don't know how to write data to it

      Don't know what this means. OleDb is a way to connect to a database, not a database. One book you could start with is: Beginning C# 2008 Databases: From Novice to Professional [^]

      The need to optimize rises from a bad design.My articles[^]

      T 1 Reply Last reply
      0
      • W Wendelius

        I would advise you to get a few good books, but to your questions:

        toprogramminguy wrote:

        I don't know which database to use which is part of my problem

        You could use SQL Server Express Edition. Download, install it and start using by creating a db, tables etc.

        toprogramminguy wrote:

        I've tried using sql server but I don't know how to create a connection to it from a program

        You use SqlConnection[^]. Define a connection string and open the connection. Good example in the link in examples.

        toprogramminguy wrote:

        I don't know what to use as a user id or password

        If you use integrated security, you don't need separate username and password. If you use SQL Server authentication, you use SA as user and the password is defined during setup.

        toprogramminguy wrote:

        I had an oleDb database set up and it was working fine but I don't know how to write data to it

        Don't know what this means. OleDb is a way to connect to a database, not a database. One book you could start with is: Beginning C# 2008 Databases: From Novice to Professional [^]

        The need to optimize rises from a bad design.My articles[^]

        T Offline
        T Offline
        toprogramminguy
        wrote on last edited by
        #3

        I mean an mdb database. I thought that was an ole db database. Thanks anyway :-)

        W 1 Reply Last reply
        0
        • T toprogramminguy

          I mean an mdb database. I thought that was an ole db database. Thanks anyway :-)

          W Offline
          W Offline
          Wendelius
          wrote on last edited by
          #4

          toprogramminguy wrote:

          I mean an mdb database

          Okay, I see. Mdb is a SQL Server database file which can be attached to an existing SQL Server instance and then it can be used.

          toprogramminguy wrote:

          Thanks anyway

          You're welcome :)

          The need to optimize rises from a bad design.My articles[^]

          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