if(password == confirmpassword) { try { SqlConnection connection = new SqlConnection("Data Source=VASPAAN2-PC;Initial Catalog=employee;User ID=sa;Password=2012"); connection.Open(); SqlCommand cmd = new SqlCommand("insetuser", connection); //SqlCommand cmd=new SqlCommand("insert into tbluser(username,password,address)values(@username,@password,@address)",sql); cmd.CommandType = CommandType.StoredProcedure; cmd.Parameters.AddWithValue("@username", username); cmd.Parameters.AddWithValue("@password", password); cmd.Parameters.AddWithValue("@address", address); cmd.ExecuteNonQuery(); AlertDialog.Builder alert = new AlertDialog.Builder(this); alert.SetMessage("data is inserted"); alert.Create(); alert.Show(); connection.Close(); } catch (Exception ex) { string err = ex.Message; AlertDialog.Builder alertbox = new AlertDialog.Builder(this); alertbox.SetMessage(err); alertbox.Create(); alertbox.Show(); } } else { Toast.MakeText(this,"enter does not match", ToastLength.Short).Show(); }
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)