try { connectionString = cnn; sqlConnection = new SqlConnection(connectionString); sqlConnection.Open(); SqlCommand cmdDelete = new SqlCommand(); string Delete = "DELETE FROM Teacher_Major WHERE Teacher_Major.major_id=@id"; cmdDelete.Connection = sqlConnection; cmdDelete.CommandText = Delete; int id = int.Parse(gvMajor.Rows[e.RowIndex].Cells[1].Text.ToString()); cmdDelete.Parameters.AddWithValue("@id", id); cmdDelete.ExecuteNonQuery(); } catch (Exception exceptionObj) { }
Deleting is not supported by data source 'SqlDataSource1' unless DeleteCommand is specified.
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)