DataTable dt = new DataTable(); //this is used to add columns in the database, means columns in your GridView dt.Columns.Add(new DataColumn("column_name", typeof(string))); //this is used to initialise datarow DataRow Dr = dt.NewRow(); //specify column value Dr["column_name"] = "column_value"; //now you are adding a row in the datatable along with value(s) you specified. dt.Rows.Add(Dr); GridView1.DataSource = dt; GridView1.DataBind();
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)