Please check the following link for examples:
http://www.csharpfriends.com/Article...x?articleID=78
http://www.dotnetspider.com/forum/39...rocedures.aspx
Example:
Code:
string username = ... // get username from user
string password = ... // get password from user
SqlConnection conn = new SqlConnection("Data
Source=localhost;Database=MyDB;Integrated Security=SSPI");
SqlCommand command = new SqlCommand("InsertUser", conn);
command.CommandType = CommandType.StoredProcedure;
command.Parameters.Add("@Username", SqlDbType.VarChar).Value = username;
command.Parameters.Add("@Password", SqlDbType.VarChar).Value = password;
conn.Open();
int rows = command.ExecuteNonQuery();
conn.Close();
You can write SP which will accept the required parameters and insert data in one or more tables.