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
Vijay
NA
150
90.8k
SQL Command type
Aug 1 2013 1:56 AM
I create an stored procedure like dis....
CREATE PROCEDURE sp_Personal
@ID int,@Name varchar(50)@Gender varchar(6),@Address varchar(75),
@Phone bigint,@Status varchar(15)
AS
BEGIN
IF @Status='Create'
BEGIN
INSERT INTO Student1(Name,Gender,Address,Phone) VALUES
(@Name,@Gender,@Address,@Phone)
END
IF @Status='Update'
BEGIN
UPDATE Student1 SET Name=@NameGender=@Gender,Address=@Address,Phone=@Phone
WHERE ID=@ID
END
END
Now my issue is want to connect to frontend usind ADO.net
public Create(Personal pers)
{
SqlConnection con = new SqlConnection("Data Source=SamplePC;Initial Catalog=Sample;Integrated Security=True");
SqlCommand com = new SqlCommand("sp_Personal", con);
com.CommandType = CommandType.StoredProcedure;
}
How to call a "Create" query only using Status parameter in frontend. am using MVC4 asp.net
Reply
Answers (
11
)
DatagridView SAVE Funtion
i got a error like this but it's saving in database