Properties in VB = Parameters in .NET??

  • Thread starter Thread starter Pablo Ricco
  • Start date Start date
P

Pablo Ricco

Hi!
I have this problem...
In Visual Basic I am work with ADODB and the next code work perfectly...

Dim cmd as New ADODB.Command
cmd.Properties(15).Value = 2
....

But in .NET..

OleDbCommand cmd = new OleDbCommand();
cmd.Parameters.add("15",2);
....

this code throws an error:
"An unhandled exception of type 'System.InvalidOperationException' occurred
in system.data.dll
Additional information: The ICommandWithParameters interface is not
supported by the 'GXPublic.GXPublic.3' provider. Command parameters are
unsupported with the current provider."

How I can work with properties en .NET?


thanks...
pablo
 
Try this article:

ms-help://MS.VSCC.2003/MS.MSDNQTR.2003FEB.1033/cpref/html/frlrfSystemDataOle
DbOleDbCommandClassParametersTopic.htm

Marc
 
Pablo
That message is saying that the provider does not support parameters for that datasource. In other words, you cannot use parameters

Tu-Thac
www.ongtech.co

----- Pablo Ricco wrote: ----

Hi
I have this problem..
In Visual Basic I am work with ADODB and the next code work perfectly..

Dim cmd as New ADODB.Comman
cmd.Properties(15).Value =
...

But in .NET.

OleDbCommand cmd = new OleDbCommand()
cmd.Parameters.add("15",2)
...

this code throws an error
"An unhandled exception of type 'System.InvalidOperationException' occurre
in system.data.dl
Additional information: The ICommandWithParameters interface is no
supported by the 'GXPublic.GXPublic.3' provider. Command parameters ar
unsupported with the current provider.

How I can work with properties en .NET


thanks..
pabl
 
Ok...
but in Visual Basic (6.0) no have problems....
How I can use properties like en Visual Basic 6.0???

Tu-Thach said:
Pablo,
That message is saying that the provider does not support parameters for
that datasource. In other words, you cannot use parameters.
 
¤ Hi!
¤ I have this problem...
¤ In Visual Basic I am work with ADODB and the next code work perfectly...
¤
¤ Dim cmd as New ADODB.Command
¤ cmd.Properties(15).Value = 2
¤ ...
¤
¤ But in .NET..
¤
¤ OleDbCommand cmd = new OleDbCommand();
¤ cmd.Parameters.add("15",2);
¤ ...
¤
¤ this code throws an error:
¤ "An unhandled exception of type 'System.InvalidOperationException' occurred
¤ in system.data.dll
¤ Additional information: The ICommandWithParameters interface is not
¤ supported by the 'GXPublic.GXPublic.3' provider. Command parameters are
¤ unsupported with the current provider."
¤

Are you certain the parameter data type is correct? It appears you are using a string data type,
which probably should be Data.OleDb.OleDbType.VarWChar. Your example is declaring
System.Data.OleDb.OleDbType.SmallInt (2).


Paul ~~~ (e-mail address removed)
Microsoft MVP (Visual Basic)
 
Back
Top