I use the following code to create a datatable which becomes the data source for a dataGridView in a C# Windows Form.
The datable is created using an SQL command - shown below - which retrieve data from two tables (Staff and Distribution).
Now I need an SQL command to delete the part of the record created in Distribution table without affecting the staff table.
Please advise. Thank you
public DataTable DataForDestination()
SqlConnection con = null;
con = new SqlConnection("Server=SQL-Server2;;Database=SupportProject;integrated security=True");
SqlCommand comm = new SqlCommand("Select Staff.fName + ' ' + Staff.lName As Name,Staff.extention,Staff.office as Office,Staff.Department,Staff.Email,Distribution.ID ,Distribution.sSubject as Subject,Distribution.compName as Computer,Distribution.ticketContent as Ticket, Distribution.desDepartment from Staff join Distribution on Staff.ID= Distribution.userID", con);
SqlDataAdapter dataAdapter2 = new SqlDataAdapter(comm);
DataSet ds1 = new DataSet();
// release any resoutrces
if (con != null)