Hi Aamir,
Thanx for ur reply and it is useful for me...
but in the below statement
myRow.Columns["Col1"].Value = "Abc";
I think Columns is not applicable bcoz when when I keep dot
after
myRow, I am not able to see the Columns...
Looking forward for ur reply...
Regards,
Prince
Aamir wrote:
Hi
To insert recorde you will have to create a DataRow object and append
it to the data table...
For Eg
DataRow myRow;
myRow = myDataTable.NewRow();
myRow.Columns["Col1"].Value = "Abc";
myRow.Columns["Col2"].Value = "Xyz";
myDataTable.Rows.Add(myRow);
To update datatable
myDataTable.Rows[0]["Col1"].value = "abc..."; //Thats enough;
To delete from datatable
myDataTable.Rows.RemoveAt(2);
or
myDataTable.Rows.Remove(myRow);
Hope this is helpfull
Thanx
Aamir