DELETE statement with ASP.NET
When I execute the SQL statement, I got an error message:
message "Specify the table containing the records you want to delete."
The SQL statement is:
string strSQL = "DELETE FROM Project, Location, ProjectType, Registration, ";
strSQL += @"UserType, UserProject ";
strSQL += @"WHERE (Project.ProjectID=" +Convert.ToInt32(ProjectID)+ "AND ";
strSQL += @"Location.LocationID = Project.LocationID AND ";
strSQL += @"ProjectType.ProjectTypeCode = Project.ProjectTypeCode AND ";
strSQL += @"Registration.ProjectID= Project.ProjectID AND ";
strSQL += @"UserType.UserTypeCode = Registration.UserTypeCode AND ";
strSQL += @"UserProject.ProjectID = Project.ProjectID)";
I added the table names after "DELETE FROM", but why??? Could you tell me how to fix the problem?
Thank you,
|