TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
Monica Priyadharshini
NA
103
5k
Tell me where i am wrong
Sep 19 2017 9:55 AM
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);
}
Reply
Answers (
11
)
How to close an excel application if it is already opened ?.
How to Filter Today,Month, Year with combobox?