Update a null value into database
-
I have this piece of code, I want to set this parameter could be a null value: OleDbParameter myParam = new OleDbParameter ( "Description", OleDbType.BigInt, 100 ); myParam.IsNullable = true; myParam.Direction = ParameterDirection.Input; } It did not work on my Visual Studio .Net 2003 even though I already using System.Data.OleDb; I saw there was something like set_IsNullable. I tried use myParam.set_IsNullable(true). It throws me this error:"cannot explicitly call operator or accessor". Is there an alternative way ? Also, if there is a solution how I can I set the value is null
-
I have this piece of code, I want to set this parameter could be a null value: OleDbParameter myParam = new OleDbParameter ( "Description", OleDbType.BigInt, 100 ); myParam.IsNullable = true; myParam.Direction = ParameterDirection.Input; } It did not work on my Visual Studio .Net 2003 even though I already using System.Data.OleDb; I saw there was something like set_IsNullable. I tried use myParam.set_IsNullable(true). It throws me this error:"cannot explicitly call operator or accessor". Is there an alternative way ? Also, if there is a solution how I can I set the value is null
There is an object called
DBNull
. UseDBNull.Value
when you need to use a null value in the database.set_IsNullable
is the internal name of the setter part of theIsNullable
property. Does this help? --Colin Mackay--EuroCPian Spring 2004 Get Together[^] "You can have everything in life you want if you will just help enough other people get what they want." --Zig Ziglar