title image


Smiley Re: Delete in 2 Tabellen
Hier mal der Code:



string deleteQuery = "DELETE FROM tblfile WHERE startnow = 'yes'";

string deleteTblU = "DELETE FROM tbluser WHERE fileid = (Select fileid FROM tblfile WHERE startnow = 'yes')";



SqlConnection myConn = new SqlConnection(strDeleteFileUser);

myConn.Open();



SqlCommand cmdD2 = new SqlCommand(deleteTblU);

cmdD2.Connection = myConn;

cmdD2.ExecuteNonQuery();

cmdD2.Dispose();



SqlCommand cmdD = new SqlCommand(deleteQuery);

cmdD.Connection = myConn;

cmdD.ExecuteNonQuery();

cmdD.Dispose();



myConn.Close();



geschrieben von

Login

E-Mail:
  

Passwort:
  

Beitrag anfügen

Symbol:
 
 
 
 
 
 
 
 
 
 
 
 
 

Überschrift: