Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- protected void GridView1_RowUpdating(object sender, GridViewUpdateEventArgs e)
- {
- GridViewRow row = GridView1.SelectedRow;
- string Username = row.Cells[3].Text;
- string Password = row.Cells[4].Text;
- string Email = row.Cells[5].Text;
- string ID_Inscricao = row.Cells[1].Text;
- SqlConnection sqlConn = new SqlConnection(
- ConfigurationManager.ConnectionStrings["FormacaoConnectionString"].ToString());
- SqlCommand sqlComm = new SqlCommand();
- sqlComm = sqlConn.CreateCommand();
- sqlComm.Parameters.Add("@Username", SqlDbType.Text);
- sqlComm.Parameters.Add("@Password", SqlDbType.Text);
- sqlComm.Parameters.Add("@Email", SqlDbType.Text);
- sqlComm.Parameters.Add("@ID_Inscricao", SqlDbType.Text);
- sqlComm.Parameters["@Username"].Value = Username;
- sqlComm.Parameters["@Password"].Value = Password;
- sqlComm.Parameters["@Email"].Value = Email;
- sqlComm.Parameters["@ID_Inscricao"].Value = ID_Inscricao;
- string sql = "INSERT INTO Utilizadores " +
- "(Username, Password, Email,ID_Inscricao) " +
- "VALUES (@Username, @Password, @Email, @ID_Inscricao)";
- sqlComm.CommandText = sql;
- sqlConn.Open();
- sqlComm.ExecuteNonQuery();
- sqlConn.Close();
- }
- sqlComm.Parameters["@Username"].Value = Username;
- sqlComm.Parameters.Add("@Username", SqlDbType.Text);
- string Username = row.Cells[3].Text;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement