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. Data Table Problem

Data Table Problem

Scheduled Pinned Locked Moved C#
helptutorial
8 Posts 4 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.
  • F Offline
    F Offline
    foysal mamun
    wrote on last edited by
    #1

    how to assing data to a DataTable. plz help me.

    T 1 Reply Last reply
    0
    • F foysal mamun

      how to assing data to a DataTable. plz help me.

      T Offline
      T Offline
      Tamimi Code
      wrote on last edited by
      #2

      what do you want to do exactly ?? Tamimi - Code

      F 1 Reply Last reply
      0
      • T Tamimi Code

        what do you want to do exactly ?? Tamimi - Code

        F Offline
        F Offline
        foysal mamun
        wrote on last edited by
        #3

        want to put values in a datatable.

        M T 2 Replies Last reply
        0
        • F foysal mamun

          want to put values in a datatable.

          M Offline
          M Offline
          malikjhangirahmed hotmail com
          wrote on last edited by
          #4

          Use following syntax DataTable.Rows[index].Columns[name/index]=value; If you need more guidance, feel free to reply again Wasif Ehsan

          1 Reply Last reply
          0
          • F foysal mamun

            want to put values in a datatable.

            T Offline
            T Offline
            Tamimi Code
            wrote on last edited by
            #5

            hi: DataTable objTable = new DataTable(); DataColumn col1 = new DataColumn("id"); DataColumn col2 = new DataColumn("Name"); objTable.Columns.Add(col1); objTable.Columns.Add(col2); DataRow objRow = objTable.NewRow(); objRow["id"] = "1"; objRow["Name"] = "Tamimi"; objTable.Rows.Add(objRow); Tamimi - Code

            F 1 Reply Last reply
            0
            • T Tamimi Code

              hi: DataTable objTable = new DataTable(); DataColumn col1 = new DataColumn("id"); DataColumn col2 = new DataColumn("Name"); objTable.Columns.Add(col1); objTable.Columns.Add(col2); DataRow objRow = objTable.NewRow(); objRow["id"] = "1"; objRow["Name"] = "Tamimi"; objTable.Rows.Add(objRow); Tamimi - Code

              F Offline
              F Offline
              foysal mamun
              wrote on last edited by
              #6

              Actualy want to put the values of DataGrid into a DataTable.how is it possible.plz help me.

              R T 2 Replies Last reply
              0
              • F foysal mamun

                Actualy want to put the values of DataGrid into a DataTable.how is it possible.plz help me.

                R Offline
                R Offline
                ranandbe
                wrote on last edited by
                #7

                Hi foysal cool, I think you want to build the data table with only selected data's from datagrid ok, if it is true then you have to get the datagrid row(cell's) value by travelling through whole datagrid. To get the datagrid cell value: Create obj for datagrid item for that datagrid then get the value of that particular row. foreach(DataGridItem dgi in DataGrid1.Item) { string name=dgi.cells["column name1"].ToString(); ............ .......... } Best Regards., ranandbe -- modified at 5:06 Monday 5th June, 2006

                1 Reply Last reply
                0
                • F foysal mamun

                  Actualy want to put the values of DataGrid into a DataTable.how is it possible.plz help me.

                  T Offline
                  T Offline
                  Tamimi Code
                  wrote on last edited by
                  #8

                  lets say datatable1 and datagrid1 ... put the the datasource for datagrid1 = datatable then whatever you change in the grid will reflect on the datatable1 , then use datarow.rowstatus or datatable.getchanges to get all the changed rows Tamimi - Code

                  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