VB.NET Null to SQL Null (ASP.NET 2.0 GridView)

  • Thread starter Thread starter Kivak Wolf
  • Start date Start date
K

Kivak Wolf

Hey,

I have everything working now except for this. I have some fields that
I am getting data from, then I am sending them to a SQL database. Now
the empty string and VB.NET null are different than the SQL Null (type:
"System.DBNull"). So, i need some way of cenverting the values into a
"System.DBNull" object and then send them to the database. Any ideas?

BTW: The parameter called: "ConvertEmptyStringToNull" does not work.
Microsoft said there is a bug and it will be fixed for the release
date.

Thanks,
Kivak Wolf
 
One option is to create your own wrapper and have it take the VB Null and
make it a SQL null. This will allow you to switch to
ConvertEmptyStringToNull() when it is fixed without having a major
application rewrite (change in your wrapper method only).

--
Gregory A. Beamer
MVP; MCP: +I, SE, SD, DBA

***************************
Think Outside the Box!
***************************
 
I understand that is what I have to do. It is just a matter of
implementing it. I have no idea how to do it because I don't know how
to access the data members in the GridView.
 
Back
Top