how to creat store procedure

Posted by Suneel161 under Sql Server on 2/9/2010 | Views : 1110 | Status : [Member] | Replies : 5
hii

how to creat store procedure..and how to cal store procedure in asp 3.5 with c#




Responses

Posted by: Raja on: 2/9/2010 [Member] Starter

Up
0
Down
Read this article

http://www.dotnetfunda.com/articles/article375-insert-data-using-parameters-through-stored-procedure.aspx

Thanks

Regards,
Raja, USA

Suneel161, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Suneel161 on: 2/9/2010 [Member] Starter

Up
0
Down
thank u....its working

Suneel161, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Raja on: 2/9/2010 [Member] Starter

Up
0
Down
Please "Mark as Answer" to my response.

Thanks

Regards,
Raja, USA

Suneel161, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Sagarp on: 2/9/2010 [Member] Bronze

Up
0
Down
CREATE PROCEDURE Proc_Insertdata

@name varchar(50),
@address varchar(50)
AS
BEGIN
insert into table1 (Name,Address)values(@name,@address)

END

---------------------------------------------.Net Code 3.5-------------------------------
.cs
button_click

{
SqlConnection sqlconn = new SqlConnection("Data Source=xxx;Initial Catalog=xyz;Integrated Security=True");
SqlCommand cmdIns = new SqlCommand();
cmdIns.Connection = sqlconn;
cmdIns.CommandType = CommandType.Text;
cmdIns.CommandText = "exec proc_inserdata 'abc','pune' ";
cmdIns.ExecuteNonQuery();
}


Thanks
SagarP
http://www.emanonsolutions.net
http://emanonsolutions.blogspot.com/

Suneel161, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Vuyiswamb on: 2/10/2010 [Member] [MVP] [Administrator] NotApplicable

Up
0
Down
Good Day Guys

Please don't forget to Put your code inside the code tags when you post a code. Please edit your post.

Thank you for being part of Dotnetfunda


Vuyiswa Maseko

Thank you for posting at Dotnetfunda
[Administrator]

Suneel161, if this helps please login to Mark As Answer. | Alert Moderator

Login to post response