How to add rows into a datatable dynamically?
I created some columns with this code:
DataTable obj_dt_grdvw = new DataTable();
obj_dt_grdvw.Columns.Add("_Pur_Product_Id", typeof(string));
obj_dt_grdvw.Columns.Add("Product_pur_Name", typeof(string));
Now I tried to add a row of data but showing error "there is no row at 0"
obj_dt_grdvw.Rows[0]["_Pur_Product_Id"] ="12";
obj_dt_grdvw.Rows[0]["Product_pur_Name"] ="milk";
What is my mistake?