Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public UserEntity DeleteUser(int userId) {
- SqlConnection oCon = null;
- SqlCommand oCmd = null;
- UserEntity user = null;
- try
- {
- oCon = _connection.openConn();
- string sqlDelete = string.Format("DELETE FROM Users WHERE usr_id = @userId");
- oCmd = new SqlCommand(sqlDelete, oCon);
- oCmd.Parameters.Add(new SqlParameter("@userId", user.usr_Id));
- oCmd.ExecuteNonQuery();
- }
- catch (Exception ex)
- {
- throw ex;
- }
- return user;
- }
Add Comment
Please, Sign In to add comment