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
CODE PROJECT For Those Who Code
  • Home
  • Articles
  • FAQ
Community
  1. Home
  2. General Programming
  3. C#
  4. New in C# and SQL Server (Express Editions)

New in C# and SQL Server (Express Editions)

Scheduled Pinned Locked Moved C#
tutoriallearningcsharpcssdatabase
3 Posts 3 Posters 1 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
    twickl
    wrote on last edited by
    #1

    Hello, I´m trying to use the SQL Server 2005 Express in my C# 2005 Express Project and I´m getting nuts! In my project I created the Tables I need but know I really don´t know hoe to establish a connection and make select or insert statements?! In the learning Videos from microsoft the do everything with Databinding in the Designer but I have to leran how to make those things manually by code. In my Book about c# they use OleDBConnectio, OleDBDataReader and OleDBCommand to connect and work with an Access MDB. But I have to use SQL Server. In other examples I found they use DataAdapter...an I really don´t know what´s the correct way? Is there anywhere a simple example that shows how to connect to a local installed SQL Server and make a select statement, show the Data from the selectstatement in a grid or something else and make in insert into a table? Or can anyone show me how to do that? Normaly it´s not my way to ask such questions but I really become nuts and be doubt about my programming knowledge...:sigh: Thank you very much twickl

    C M 2 Replies Last reply
    0
    • T twickl

      Hello, I´m trying to use the SQL Server 2005 Express in my C# 2005 Express Project and I´m getting nuts! In my project I created the Tables I need but know I really don´t know hoe to establish a connection and make select or insert statements?! In the learning Videos from microsoft the do everything with Databinding in the Designer but I have to leran how to make those things manually by code. In my Book about c# they use OleDBConnectio, OleDBDataReader and OleDBCommand to connect and work with an Access MDB. But I have to use SQL Server. In other examples I found they use DataAdapter...an I really don´t know what´s the correct way? Is there anywhere a simple example that shows how to connect to a local installed SQL Server and make a select statement, show the Data from the selectstatement in a grid or something else and make in insert into a table? Or can anyone show me how to do that? Normaly it´s not my way to ask such questions but I really become nuts and be doubt about my programming knowledge...:sigh: Thank you very much twickl

      C Offline
      C Offline
      CodyGen
      wrote on last edited by
      #2

      Don't loose hope. Internet is a jungle. You just need a patient finding anything you need. Try google. Also try this: http://www.c-sharpcorner.com/Code/2004/Oct/DataSourceControls.asp[^]

      1 Reply Last reply
      0
      • T twickl

        Hello, I´m trying to use the SQL Server 2005 Express in my C# 2005 Express Project and I´m getting nuts! In my project I created the Tables I need but know I really don´t know hoe to establish a connection and make select or insert statements?! In the learning Videos from microsoft the do everything with Databinding in the Designer but I have to leran how to make those things manually by code. In my Book about c# they use OleDBConnectio, OleDBDataReader and OleDBCommand to connect and work with an Access MDB. But I have to use SQL Server. In other examples I found they use DataAdapter...an I really don´t know what´s the correct way? Is there anywhere a simple example that shows how to connect to a local installed SQL Server and make a select statement, show the Data from the selectstatement in a grid or something else and make in insert into a table? Or can anyone show me how to do that? Normaly it´s not my way to ask such questions but I really become nuts and be doubt about my programming knowledge...:sigh: Thank you very much twickl

        M Offline
        M Offline
        mav northwind
        wrote on last edited by
        #3

        Hi! Yes, starting can be a bitch... :) You can't say one choice is "the correct" way, because you can achieve what you want in many different ways. You can use the OleDB* classes to communicate with a SQL Server just like you would with Access. The only thing that's different (in the beginning, at least) is the connection string you'll have to specify. With an mdb file you just include datasource='...path to your file...', but that doesn't work with SQL server. Since I can't remember all the parts of a connection string for a given database, I usually take a look at http://www.connectionstrings.com/[^] to find the correct connection string. Everything else is just a matter of reading the class documentation... Regards, mav

        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