DataGrid and the WDA Base Class
Thearon, thank you for the reply.
Unless I misunderstood thr code, this initializes the Command object in the EDABase class:
PublicSub InitializeCommand()
If Command IsNothingThen
Try
Command = New OleDbCommand(SQL, Connection)
'See if this is a stored procedure
IfNot SQL.ToUpper.StartsWith("SELECT ") _
AndNot SQL.ToUpper.StartsWith("INSERT ") _
AndNot SQL.ToUpper.StartsWith("UPDATE ") _
AndNot SQL.ToUpper.StartsWith("DELETE ") Then
Command.CommandType = CommandType.StoredProcedure
EndIf
Catch OleDbExceptionErr As OleDbException
ThrowNew System.Exception(OleDbExceptionErr.Message, _
OleDbExceptionErr.InnerException)
EndTry
EndIf
EndSub
I get the error at this line of code:
objData.Command.CommandText = "Query1"
|