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. DataGridViewRow using Dataset

DataGridViewRow using Dataset

Scheduled Pinned Locked Moved C#
10 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.
  • C Offline
    C Offline
    C Coudou
    wrote on last edited by
    #1

    Dudes, Is it possible to show the data in datagridviewrow /datagridview using the dataset(not using the wizard). ex. DataSet ds; ds = new DataSet(); ... if it is. can you give me the order of codings. thanks u so much, jeof

    ****************************** I just want to know everything

    A 1 Reply Last reply
    0
    • C C Coudou

      Dudes, Is it possible to show the data in datagridviewrow /datagridview using the dataset(not using the wizard). ex. DataSet ds; ds = new DataSet(); ... if it is. can you give me the order of codings. thanks u so much, jeof

      ****************************** I just want to know everything

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

      Just give the dtg.. the DataSource and DataMember "dtgCreditInfo.DataSource = ds; dtgCreditInfo.DataMember = "TableName";"

      Assaf

      C 1 Reply Last reply
      0
      • A Assaf82

        Just give the dtg.. the DataSource and DataMember "dtgCreditInfo.DataSource = ds; dtgCreditInfo.DataMember = "TableName";"

        Assaf

        C Offline
        C Offline
        C Coudou
        wrote on last edited by
        #3

        thanks assaf for your quick reply. one more thing. what should i put in datagrid. ex. (i used this using textbox) txtUsrName_pca.Text = dataSet.Tables[0].Rows[0][3].ToString(); in datagrid, what will i used? is it the same?

        ****************************** I just want to know everything

        T A 2 Replies Last reply
        0
        • C C Coudou

          thanks assaf for your quick reply. one more thing. what should i put in datagrid. ex. (i used this using textbox) txtUsrName_pca.Text = dataSet.Tables[0].Rows[0][3].ToString(); in datagrid, what will i used? is it the same?

          ****************************** I just want to know everything

          T Offline
          T Offline
          T EDY
          wrote on last edited by
          #4

          YourDataGridName.DataSource = YourDataSet; Try this for example : dgvAllData.DataSource = myDataSet; dgvAllData.DataMember = "ID"; Hope can help

          Regards, Tomi

          C 1 Reply Last reply
          0
          • T T EDY

            YourDataGridName.DataSource = YourDataSet; Try this for example : dgvAllData.DataSource = myDataSet; dgvAllData.DataMember = "ID"; Hope can help

            Regards, Tomi

            C Offline
            C Offline
            C Coudou
            wrote on last edited by
            #5

            thanks tomi, should i still use Fill method right. heres my new code: adp = new SqlDataAdapter(cmd); ds = new DataSet(); <- should i comment this line? dtg.DataSource = ds; dtg.DataMember = "M_CUSTOMER"; adp.Fill(ds); btw, i dont want to use statement in my code.

            ****************************** I just want to know everything

            1 Reply Last reply
            0
            • C C Coudou

              thanks assaf for your quick reply. one more thing. what should i put in datagrid. ex. (i used this using textbox) txtUsrName_pca.Text = dataSet.Tables[0].Rows[0][3].ToString(); in datagrid, what will i used? is it the same?

              ****************************** I just want to know everything

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

              in yur code you assign a value for the txt... from the dataset if you want the to do the same from the datagrid: txtUsrName_pca.Text = dtg.Rows[i].Cells["CreditCardOwner"].Value.ToString();

              Assaf

              C 1 Reply Last reply
              0
              • A Assaf82

                in yur code you assign a value for the txt... from the dataset if you want the to do the same from the datagrid: txtUsrName_pca.Text = dtg.Rows[i].Cells["CreditCardOwner"].Value.ToString();

                Assaf

                C Offline
                C Offline
                C Coudou
                wrote on last edited by
                #7

                thanks assaf,

                Assaf82 wrote:

                from the dataset if you want the to do the same from the datagrid: txtUsrName_pca.Text = dtg.Rows[i].Cells["CreditCardOwner"].Value.ToString();

                yes. i got it. ;)whew:doh:

                ****************************** I just want to know everything

                A 1 Reply Last reply
                0
                • C C Coudou

                  thanks assaf,

                  Assaf82 wrote:

                  from the dataset if you want the to do the same from the datagrid: txtUsrName_pca.Text = dtg.Rows[i].Cells["CreditCardOwner"].Value.ToString();

                  yes. i got it. ;)whew:doh:

                  ****************************** I just want to know everything

                  A Offline
                  A Offline
                  Assaf82
                  wrote on last edited by
                  #8

                  you're welcome

                  Assaf

                  C 1 Reply Last reply
                  0
                  • A Assaf82

                    you're welcome

                    Assaf

                    C Offline
                    C Offline
                    C Coudou
                    wrote on last edited by
                    #9

                    hi assaf, got an error when compiling. 'System.ArgumentException' in this line adp = new SqlDataAdapter(cmd); ds = new DataSet(); dtg.DataSource = ds; dtg.DataMember = "M_CUSTOMER"; --> got an error here! adp.Fill(ds);

                    ****************************** I just want to know everything

                    A 1 Reply Last reply
                    0
                    • C C Coudou

                      hi assaf, got an error when compiling. 'System.ArgumentException' in this line adp = new SqlDataAdapter(cmd); ds = new DataSet(); dtg.DataSource = ds; dtg.DataMember = "M_CUSTOMER"; --> got an error here! adp.Fill(ds);

                      ****************************** I just want to know everything

                      A Offline
                      A Offline
                      Assaf82
                      wrote on last edited by
                      #10

                      This Exception here mean that the table "M_CUSTOMER" doesn't belong to the dataset "ds" So verify when you run the program that the dataset contain this table and check his Name hope that this help you ...

                      Assaf

                      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