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

Discussion in 'ASP .Net' started by Kivak Wolf, Jun 28, 2005.

  1. Kivak Wolf

    Kivak Wolf Guest

    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
     
    Kivak Wolf, Jun 28, 2005
    #1
    1. Advertising

  2. 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!
    ***************************


    "Kivak Wolf" wrote:

    > 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
    >
    >
     
    =?Utf-8?B?Q293Ym95IChHcmVnb3J5IEEuIEJlYW1lcikgLSBN, Jun 28, 2005
    #2
    1. Advertising

  3. Kivak Wolf

    Kivak Wolf Guest

    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.
     
    Kivak Wolf, Jun 28, 2005
    #3
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. =?Utf-8?B?Um9iZXJ0IFdpbGxoaXRl?=

    smalldatetime Null in SQL for ASP.net Page

    =?Utf-8?B?Um9iZXJ0IFdpbGxoaXRl?=, Oct 6, 2005, in forum: ASP .Net
    Replies:
    3
    Views:
    2,921
    Patirck Ige
    Oct 6, 2005
  2. Replies:
    5
    Views:
    26,702
    Mike Schilling
    Mar 29, 2006
  3. =?Utf-8?B?bWdvbnphbGVzMw==?=

    GridView Hierarchical View - Gridview in Gridview

    =?Utf-8?B?bWdvbnphbGVzMw==?=, May 9, 2006, in forum: ASP .Net
    Replies:
    1
    Views:
    17,982
    =?Utf-8?B?UGhpbGxpcCBXaWxsaWFtcw==?=
    May 9, 2006
  4. ecoolone
    Replies:
    0
    Views:
    766
    ecoolone
    Jan 3, 2008
  5. jobs
    Replies:
    2
    Views:
    1,605
Loading...

Share This Page