Data Table Problem
-
how to assing data to a DataTable. plz help me.
-
how to assing data to a DataTable. plz help me.
what do you want to do exactly ?? Tamimi - Code
-
what do you want to do exactly ?? Tamimi - Code
want to put values in a datatable.
-
want to put values in a datatable.
Use following syntax DataTable.Rows[index].Columns[name/index]=value; If you need more guidance, feel free to reply again Wasif Ehsan
-
want to put values in a datatable.
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
-
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
Actualy want to put the values of DataGrid into a DataTable.how is it possible.plz help me.
-
Actualy want to put the values of DataGrid into a DataTable.how is it possible.plz help me.
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
-
Actualy want to put the values of DataGrid into a DataTable.how is it possible.plz help me.
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