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. How can I bind to a database with Dataset

How can I bind to a database with Dataset

Scheduled Pinned Locked Moved C#
helpdatabasequestion
4 Posts 3 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.
  • M Offline
    M Offline
    mghiassi
    wrote on last edited by
    #1

    Hi all, I use this code to fill the DataGridView but this code has error in the Underlined line private void Form1_Load(object sender, EventArgs e) { DataSet1TableAdapters.ExpParamsTA ExpParamsTA= new Datam.DataSet1TableAdapters.ExpParamsTA(); ExpParamsTA.Fill(DataSet1.ExpParamsDataTable); BindingSource Exp = new BindingSource(DataSet1, "ExpParams"); dataGridView1.DataSource = Exp; } Please help me Thanks in advance

    K M 2 Replies Last reply
    0
    • M mghiassi

      Hi all, I use this code to fill the DataGridView but this code has error in the Underlined line private void Form1_Load(object sender, EventArgs e) { DataSet1TableAdapters.ExpParamsTA ExpParamsTA= new Datam.DataSet1TableAdapters.ExpParamsTA(); ExpParamsTA.Fill(DataSet1.ExpParamsDataTable); BindingSource Exp = new BindingSource(DataSet1, "ExpParams"); dataGridView1.DataSource = Exp; } Please help me Thanks in advance

      K Offline
      K Offline
      kubben
      wrote on last edited by
      #2

      You only fill a dataset, it will populate the table. I will assume only one table is returned. So something like: ExpParamsTA.Fill(DataSet1); DataGridView1.DataSource = DataSet1.Tables[0].DefaultView; Hope that helps. Ben

      1 Reply Last reply
      0
      • M mghiassi

        Hi all, I use this code to fill the DataGridView but this code has error in the Underlined line private void Form1_Load(object sender, EventArgs e) { DataSet1TableAdapters.ExpParamsTA ExpParamsTA= new Datam.DataSet1TableAdapters.ExpParamsTA(); ExpParamsTA.Fill(DataSet1.ExpParamsDataTable); BindingSource Exp = new BindingSource(DataSet1, "ExpParams"); dataGridView1.DataSource = Exp; } Please help me Thanks in advance

        M Offline
        M Offline
        Muammar
        wrote on last edited by
        #3

        Maybe this can help.


        Smile: A curve that can set a lot of things straight! (\ /) (O.o) (><)

        M 1 Reply Last reply
        0
        • M Muammar

          Maybe this can help.


          Smile: A curve that can set a lot of things straight! (\ /) (O.o) (><)

          M Offline
          M Offline
          mghiassi
          wrote on last edited by
          #4

          Thanks in advance :-D:rose:

          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