ちょうどそれのハックのために、これを試してみてください。
Using conn As New SqlConnection("sqlServer Conn string - connectionstrings.com")
Dim sql As String = "DELETE FROM [orgDefaults] WHERE [orgcode] = @1 AND [ctlName] = @2"
Using cmd As New SqlCommand(sql, conn)
cmd.Parameters.AddWithValue("@1", "NEW")
cmd.Parameters.AddWithValue("@2", "AllowReportables")
cmd.CommandType = CommandType.Text
conn.Open()
Dim retVal As Integer = cmd.ExecuteNonQuery()
If retVal > 0 Then
Debug.WriteLine("Success - deleted 1 or more records")
' remeber, retVal may not match num of rows deleted.
' Rather, it indicates total rows affected
Else
Debug.WriteLine("Still Success - deleted Nothing")
End If
End Using
End Using
SQLは、この方法は、より良い自分の価値観とフィールドタイプと一致します実行しているため、[あなたには、いくつかの「特別な」問題を持っている場合]これはあなたに、より良い画像を与える必要があります。
.netとsqlサーバーを使用している場合、なぜoleDbとJetを使用しますか? 'SqlClient'を使います。これにより、あなたの問題も解決する可能性があります。 –
JetはMicrosoft Access用であり、SQL Server用ではありません。プロバイダを変更する必要があります。 – Greg