hi folks can anyone help me
dr is field used as a method
con.Open();
cmd = new SqlCommand("select count(*) from tblUsers where UserId='" + txtUserName.Text + "'", con);
dr = cmd.ExecuteReader();
int count;
if ((dr.Read()))
{
count = (dr(0));
//Here im getting an error
}
con.Close();
if (count > 0)
{
}
else
{
}
AlanPosted Sep 22, 2008, 5:43 AM
To get the value of the first column as an integer, try:
count = (int)dr[0];
suhas kPosted Sep 22, 2008, 4:48 AM
or
dr. check the option