is this code is corerct to retrive the data into text box
Revision 1
public string user(AddInfoModel info)
{
SqlConnection con = new SqlConnection(ConfigurationManager.ConnectionStrings["MyConsString"].ConnectionString);
con.Open();
SqlCommand cmd = new SqlCommand("Resource_sp", con);
cmd.CommandType = CommandType.StoredProcedure;
SqlDataReader reader = cmd.ExecuteReader();
if (reader.Read())
{
FirstName.Text = reader["FirstName"].ToString();
LastName.Text = reader["LastName"].ToString();
reader.Close();
con.Close();
}
}
}
}
Posted 18-Jan-13 22:21pm
by
Dhritirao's.