while (dr.Read()) { adcode = dr[0]; } dr.Close();
while (dr.Read()) { adcode = (int)dr[0]; } dr.Close(); If it is String then, adcode = (string)dr[0];
adcode = Convert.ToInt32(dr[0]);
int ord = dr.GetOrdinal("FieldName"); adcode = dr.GetSqlInt32(ord).Value;
scmd=new SqlCommand("select * from AdminUser",scon); scon.Open(); sdr = scmd.ExecuteReader(CommandBehavior.KeyInfo); sdr.Read(); dt = sdr.GetSchemaTable(); scon.Close();
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)