DataGridView dgv = new DataGridView();
DataTable dt=new DataTable();
dt.Clear();
dt.Columns.Add("Name");
dt.Columns.Add("Marks");
DataRow _ravi = dt.NewRow();
_ravi["Name"] = "ravi";
_ravi["Marks"] = "500";
dt.Rows.Add(_ravi)
DataRow _ravi1 = dt.NewRow();
_ravi1["Name"] = "ravi";
_ravi1["Marks"] = "500";
dt.Rows.Add(_ravi1);
dgv.DataSource = dt;