Cita:
Tengo tres tablas, historialinventario, inventario_compra e inventario_oficina. Resulta que tengo que borrar un registro por medio de su codigo. Lo que pasa es que esa consulta de mysql me borra el registro que yo deseo solamente en el inventario de oficina, y en las otras tablas me borra todos los registros T.T. If MsgBox("¿Está seguro de eliminar el registro? ", MsgBoxStyle.YesNo) = MsgBoxResult.No Then
Else
If RadioButton3.Checked Then
CONEXION.Open()
Try
ELIMINAR = New MySql.Data.MySqlClient.MySqlCommand(SQL, CONEXION)
ELIMINAR.CommandType = CommandType.Text
ELIMINAR.CommandText = "DELETE inventario_oficina.codprodu FROM inventario_compra,inventario_oficina USING inventario_compra,inventario_oficina WHERE codprodu= " & Me.TextBox2.Text.ToString
Try
If ((ELIMINAR.ExecuteNonQuery <> 0)) Then
MsgBox("DATOS ELIMINADOS")
End If
Catch ex As Exception
MsgBox(ex.ToString)
End Try
Catch ex As Exception
End Try
CONEXION.Close()
NomprovTextBox.Clear()
NombreproductoTextBox.Clear()
PrecTextBox.Clear()
NumfacturaTextBox.Clear()
End If
Else
If RadioButton3.Checked Then
CONEXION.Open()
Try
ELIMINAR = New MySql.Data.MySqlClient.MySqlCommand(SQL, CONEXION)
ELIMINAR.CommandType = CommandType.Text
ELIMINAR.CommandText = "DELETE inventario_oficina.codprodu FROM inventario_compra,inventario_oficina USING inventario_compra,inventario_oficina WHERE codprodu= " & Me.TextBox2.Text.ToString
Try
If ((ELIMINAR.ExecuteNonQuery <> 0)) Then
MsgBox("DATOS ELIMINADOS")
End If
Catch ex As Exception
MsgBox(ex.ToString)
End Try
Catch ex As Exception
End Try
CONEXION.Close()
NomprovTextBox.Clear()
NombreproductoTextBox.Clear()
PrecTextBox.Clear()
NumfacturaTextBox.Clear()
End If
Si me pudieran ayudar con la sintaxis de esa consulta se los agradecería