assign a parameter

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I use the parameter command,

cmd.Parameters.Add("@var_new", OleDbType.Int32).Value= t_var;

I receive the error,

CS0117: 'System.Data.OleDb.OleDbType' does not contain a definition for
'Int32'

What's the problem?
 
David,

There is no value Int32 in the OleDbType enumeration. Instead, you will
want to use the OleDbType.Integer value.

Hope this helps.
 
I changed the line to,

cmd.Parameters.Add("@var_new", OleDbType.Integer).Value= t_var;

Now I receive the error,

Compiler Error Message: CS0029: Cannot implicitly convert type 'int' to
'System.Data.OleDb.OleDbDataReader'

Nicholas Paldino said:
David,

There is no value Int32 in the OleDbType enumeration. Instead, you will
want to use the OleDbType.Integer value.

Hope this helps.


--
- Nicholas Paldino [.NET/C# MVP]
- (e-mail address removed)

I use the parameter command,

cmd.Parameters.Add("@var_new", OleDbType.Int32).Value= t_var;

I receive the error,

CS0117: 'System.Data.OleDb.OleDbType' does not contain a definition for
'Int32'

What's the problem?
 
Back
Top