Click here to Skip to main content
15,898,010 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I am biggener to use store procedure. I want to insert data using store procedure in MSSQL2008R2 using class. I write code in class file as belove
C#
public static void insertdata(string storeprocName, int no, string name)
{
    sqlcommend cmd= new sqlcommend(storeprocName, connection);
    cmd.commandtype= system. data.commandtype.storeprocedure;
    cmd.parameters.add("@no", sqldbtype.int)value= no;
    cmd.parameters.add("@name", sqldbtype.text)value= name;
    con.open();
    cmd.executenonquery();
    con.close();
}

now how to catch values from frontend on insert button click
I am not sure for above code please suggest me solution.
Posted
Updated 2-Jan-15 22:12pm
v2

1 solution

 
Share this answer
 
Comments
deepika wani 3-Jan-15 4:18am    
I have store procedure , Ijust want to return values from frontend
Richard MacCutchan 3-Jan-15 4:31am    
Then go and read some of those links and see how to do it. You will learn much to help you.
deepika wani 3-Jan-15 4:37am    
Yes I do the Same But it gives me info about server side...I want to return value from frontend. M quite searching on Google I get code on button click...But I want to declare d function in class in then pass value from insert button click

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900