How to add data to Datatable and show in grid view c#
问题 I need to add data to datatable and show it in a gridview. After entering each item, gridview should update automatically. DataTable obj_dt_grdvw = new DataTable(); DataRow obj_dt_row = obj_dt_grdvw.NewRow(); obj_dt_grdvw.Columns.Add("_Pur_Product_Id", typeof(string)); obj_dt_grdvw.Columns.Add("Product_pur_Name", typeof(string)); obj_dt_row["_Pur_Product_Id"] = _Pur_Product_Id; obj_dt_row["Product_pur_Name"] = Product_pur_Name; obj_dt_grdvw.Rows.Add(obj_dt_row); return obj_dt_grdvw; After