Hi all,
Does anyone have any idea how to use count(*) in a dynamic query with the Enterprise Library Data Access Application Block?
I am using:
Public Shared Function selectCount(ByVal code As String) As Integer
Dim query As String = "SELECT COUNT(*) " & _
"FROM " & _
"Data " & _
"WHERE " & _
"Code = '" & code & "'"
Dim db As Database = DatabaseFactory.CreateDatabase()
Return db.ExecuteScalar(System.Data.CommandType.Text, query)
End Function
This error gets thrown:
The ITransactionLocal interface is not supported by the 'Microsoft.Jet.OLEDB.4.0' provider. Local transactions are unavailable with the current provider.