protected void btnsubmit_Click(object sender, EventArgs e) { try { SqlConnection vcon = new SqlConnection(ConfigurationManager.ConnectionStrings["surendra"].ToString()); vcon.Open(); SqlCommand vcmd = new SqlCommand(); vcmd.Connection = vcon; vcmd.CommandType = CommandType.StoredProcedure; vcmd.CommandText = "register_sp "; SqlParameter sp1 = new SqlParameter("@emailid", SqlDbType.VarChar, 100); sp1.Direction = ParameterDirection.Input; sp1.Value = Txteid.Text; vcmd.Parameters.Add(sp1); SqlParameter sp2 = new SqlParameter("@password", SqlDbType.Int); sp2.Direction = ParameterDirection.InputOutput; sp2.Value = Txtpwd.Text; vcmd.Parameters.Add(sp2); SqlParameter sp3 = new SqlParameter("@firstname", SqlDbType.VarChar, 100); sp3.Direction = ParameterDirection.Input; sp3.Value = txtfname.Text; vcmd.Parameters.Add(sp3); SqlParameter sp4 = new SqlParameter("@lastname", SqlDbType.VarChar, 100); sp4.Direction = ParameterDirection.Input; sp4.Value = Txtlname.Text; vcmd.Parameters.Add(sp4); vcmd.ExecuteNonQuery(); Response.Write("http://www.facebook.com"); vcon.Close(); } catch(Exception ex) { Response.Write(ex.Message); }
ALTER procedure [dbo].[register_sp] @emailid varchar(100),@password int,@firstname varchar(100),@lastname varchar(100) as insert into Users(emailid,Password,firstname,lastname) values (@emailid,@password,@firstname,@lastname) select * from users
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)