Try the following :
...
sqlcmd.CommandText = "set identity_insert gl_Transaction On;";
sqlcmd.CommandText += "insert into Gl_Transaction(Compcode,Branchcode,Accountno,Acct_Name,SerialNo,Acct_Nirration,Value_Date,Voucher_No,Vchrtype,Dr_Amount,Cr_Amount,AddDate,UserId,pflag,InstrumentNo) values('" + dr.Cells[0].Value.ToString() + "','" + dr.Cells[1].Value.ToString() + "','" + dr.Cells[2].Value.ToString() + "','" + dr.Cells[3].Value.ToString() + "','" + dr.Cells[4].Value.ToString() + "','" + dr.Cells[5].Value.ToString() + "','" + dr.Cells[6].Value.ToString() + "','" + dr.Cells[7].Value.ToString() + "','" + dr.Cells[8].Value.ToString() + "','" + dr.Cells[9].Value.ToString() + "','" + dr.Cells[10].Value.ToString() + "','" + dr.Cells[11].Value.ToString() + "','" + dr.Cells[12].Value.ToString() + "','" + dr.Cells[13].Value.ToString() + "','" + dr.Cells[14].Value.ToString() + "')";
sqlcmd.CommandText += ";set identity_insert gl_Transaction Off";
...
[Edit]
If you need to use compound sql statements i.e. more than 1 then each one should end with a ';' semicolon.
Also in the case above you need to concat strings for the
CommandText
with
+=
otherwise they get overwritten.