An exception of type 'System.FormatException' occurred in mscorlib.dll but was not handled in user code
Additional information: Input string was not in a correct format.
- /DATA ACCESS LAYER
-
- public DataSet StdCourseBindDAL(int Uid)
- {
- SqlConnection con = new SqlConnection(constring);
- con.Open();
- SqlCommand cmd = new SqlCommand("spGetRegCourses", con);
- cmd.CommandType = CommandType.StoredProcedure;
- SqlDataAdapter sqlda = new SqlDataAdapter(cmd);
- cmd.Parameters.Add(new SqlParameter("@UserID", Uid));
- DataSet ds = new DataSet();
- sqlda.Fill(ds);
- return ds;
- }
-
- /BLL
- public DataSet StdCourseRegBindBLL(int Uid)
- {
- return da.StdCourseBindDAL(Uid);
- }
-
- /code behind
- protected void Page_Load(object sender, EventArgs e)
- {
- DataSet StudentDetails = new DataSet();
- string UName = Session["username"].ToString();
- StudentDetails = sbl.GetStudentDetailInLable(UName);
- LblS_ID.Text = StudentDetails.Tables[0].Rows[0]["StudentID"].ToString() + "";
- LblS_Name.Text = StudentDetails.Tables[0].Rows[0]["StudentName"].ToString() + "";
- LblS_eMailID.Text = StudentDetails.Tables[0].Rows[0]["EmailID"].ToString() + "";
- LblPhnNum.Text = StudentDetails.Tables[0].Rows[0]["PhnNo"].ToString() + "";
- LblS_City.Text = StudentDetails.Tables[0].Rows[0]["city"].ToString() + "
- ";
- }
- public void GridBindCourseStdReg(int ID)
- {
- DataSet bda = sbl.StdCourseRegBindBLL(ID);
- GrdCourseStdReg.DataSource = bda;
- GrdCourseStdReg.DataBind();
- }
- protected void BtnCompCourses_Click(object sender, EventArgs e)
- {
- int UID;
- UID =Convert.ToInt32(LblS_ID.Text);
- GridBindCourseStdReg(UID);
- }