Whats wrong in following code for inserting row with value in gridview
public void GRID(string abcd, string mat, string ilength, string llength,
string mount, string style, string tip, string root, string thread)
{
string aaaa = abcd;
string mattype = mat;
string ilength = ilength;
string lglength = llength;
string mountc = mount, ;
string style = style;
string tipd = tip;
string rootd = root;
string thread = thread;
DataTable dt = new DataTable();
bool flag = false;
if (!flag)
{
dt.Columns.Add("Model", typeof(string));
dt.Columns.Add("Code", typeof(string));
dt.Columns.Add(" Type", typeof(string));
dt.Columns.Add("MatType", typeof(string));
dt.Columns.Add("ILength", typeof(string));
dt.Columns.Add("LLength", typeof(string));
dt.Columns.Add("Specification", typeof(string));
dt.Columns.Add(" Style", typeof(string));
dt.Columns.Add("Tip ", typeof(string));
dt.Columns.Add("Root ", typeof(string));
dt.Columns.Add("Instru", typeof(string));
DataRow row = dt.NewRow();
row["Model"] = TxtCCode.Text;
row["Code"] = TxtMoCode.Text;
row["Type"] = aaaa;
row["MatType"] = mattype;
row["ILength"] = ilength;
row["LLength"] = lglength;
row["Specification"] = mountc;
row["Style"] = style;
row["Tip"] = tipd;
row["Root"] = rootd;
row["Instr"] = thread;
dt.Rows.Add(row);
Grd.DataSource = dt;
Grd.DataBind();
}
}
public void get()
{
GRID(tstyle, mattype, ilength, laglength, mountf, sttyle, tip, root, insthread);
}