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
ToBe
NA
164
94.1k
How to created edit page by calling values inserted by Sp?
Mar 26 2013 7:40 AM
Hi every body
I did one webform for insertion details by passing the values using stored procedure to my database .
I want to create an edit page for the same details so when a user select a recored from gridview it will take him/her to that recored details for editing (Note: My form has checkboxes ,dropdownmenues,radiobuttons,etc..):
this the code I'm using for insertion in the save button :
cmd =
new
SqlCommand
(
"sp_Main_Information"
, con);
cmd.CommandType =
CommandType
.StoredProcedure;
cmd.Parameters.AddWithValue(
"@REG_Date"
, dt);
cmd.Parameters.AddWithValue(
"@NAME"
, name);
cmd.Parameters.AddWithValue(
"@ADDRESS"
, Address);
cmd.Parameters.AddWithValue(
"@YEAR"
, Year);
cmd.Parameters.AddWithValue(
"@CURRENT_GPA "
, gpa);
cmd.Parameters.AddWithValue(
"@ATTCH_ID1"
, img1);
cmd.Parameters.AddWithValue(
"@ATTCH_ID2 ,
img2);
cmd.Parameters.AddWithValue(
"@REMARKS"
, remarks.Text);
dr = cmd.ExecuteReader();
dr.Read();
int
xx =
int
.Parse(dr[0].ToString());
Response.Write(xx);
for
(i = 0; i < chktype.Items.Count; i++)
{
if
(chktype.Items[i].Selected ==
true
)
{
cmd =
new
SqlCommand
();
cmd.CommandText =
"insert into tblItemstb values ('"
+ chktype.Items[i].Text +
"',"
+ xx +
")"
;
cmd.Connection = con;
cmd.ExecuteNonQuery();
}
}
dr.Close();
cmd.ExecuteNonQuery();
dr = cmd.ExecuteReader();
dr.Read();
int
yy =
int
.Parse(dr[0].ToString());
Response.Write(yy);
for
(i = 0; i < chkoption.Items.Count; i++)
{
if
(chkoption.Items[i].Selected ==
true
)
{
cmd =
new
SqlCommand
();
cmd.CommandText =
"insert into tbloptions values ('"
+ chkoption.Items[i].Text +
"',"
+ yy +
")"
;
cmd.Connection = con;
cmd.ExecuteNonQuery();
}
}
dr.Close();
cmd.ExecuteNonQuery();
con.Close();
lbldone.Text =
"Record Added Successfully!"
;
}
}
can anybody help me in how to Create Edit Form with the same format of the insertion form . :(
Reply
Answers (
0
)
Datagridview not showing data
Image map with razor mvc .net 4.0