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
umair mohsin
1.3k
392
68.6k
REcord is not inserting as supplies
May 6 2017 4:34 AM
here is my stored procedure
CREATE PROCEDURE [dbo].[InsertRecord]
-- Add the parameters for the stored procedure here
@name varchar,
@gender varchar
AS
BEGIN
-- SET NOCOUNT ON added to prevent extra result sets from
-- interfering with SELECT statements.
SET NOCOUNT ON;
-- Insert statements for procedure here
insert into Test values('@name','@gender');
END
here is my code behind
string constr = ConfigurationManager.ConnectionStrings["JPConstr"].ConnectionString.ToString();
SqlConnection conn = new SqlConnection(constr);
conn.Open();
SqlCommand cmd = new SqlCommand("InsertRecord", conn);
cmd.CommandType = CommandType.StoredProcedure;
cmd.Parameters.AddWithValue("@name",TextBox1.Text);
cmd.Parameters.AddWithValue("@gender",TextBox2.Text);
cmd.ExecuteNonQuery();
Label2.Text = "Record inserted";
conn.Close();
record inserted in database like this
name=@name
gender=@gender
what is the problem with my code can anyone please tell
Reply
Answers (
2
)
I want to learn SEO
I want to learn ASP MVC from Webforms