aneeshjohn
July 24th, 2006, 04:36 AM
hi...
i m using the DataReader statement :
SqlConnection cn = myConnect();
string query = "select e_id from employee where e_name = @name";
SqlDataReader dr = SqlHelper.ExecuteReader(cn,CommandType.Text,query,new SqlParameter("@name",TextBox1.Text.ToString()));
if(dr.HasRows)
{
TextBox2.Text = dr.GetInt16(0).ToString();
}
but it is giving me the error
Server Error in '/The DataList' Application.
--------------------------------------------------------------------------------
Specified cast is not valid.
i m using the DataReader statement :
SqlConnection cn = myConnect();
string query = "select e_id from employee where e_name = @name";
SqlDataReader dr = SqlHelper.ExecuteReader(cn,CommandType.Text,query,new SqlParameter("@name",TextBox1.Text.ToString()));
if(dr.HasRows)
{
TextBox2.Text = dr.GetInt16(0).ToString();
}
but it is giving me the error
Server Error in '/The DataList' Application.
--------------------------------------------------------------------------------
Specified cast is not valid.