Set column to null

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance

From: Eric V (anonymous_at_discussions.microsoft.com)
Date: 03/02/04


Date: Tue, 2 Mar 2004 11:21:05 -0800

how do i set a column to null in a datatable? i tried this:

foreach(DataRow row in myTable.Rows)
{
       row["myColumn"]=null;
}

but it fails. myColumn is a Long type. i know it can accept nulls because i get some nulls from the database.

thanks



Relevant Pages

  • Re: Same error number
    ... store subtotal values of some records in a database. ... > Run-Time Error '-2147217873 ': ... column does not allow nulls. ... INSERT fails." ...
    (microsoft.public.vb.database.ado)
  • Re: Set column to null
    ... You have to use the DbNull value instead of null ... myColumn is a Long type. ... i get some nulls from the database. ...
    (microsoft.public.dotnet.framework.adonet)
  • RE: Set column to null
    ... For database stuff, ... but it fails. ... myColumn is a Long type. ... i know it can accept nulls because i get some nulls from the database. ...
    (microsoft.public.dotnet.framework.adonet)
  • Re: error sql 2000
    ... Are you running sp_helpdb with a database name or without? ... does it work if you explicitly set a database name that you have access to? ... > column does not allow nulls. ... INSERT fails. ...
    (microsoft.public.sqlserver.server)
  • Re: Fehler beim Diagramm speichern (SQL Server 2005)
    ... Speichern möchte, bekomme ich folgenden Fehler: ... column does not allow nulls. ... fails. ...
    (microsoft.public.de.sqlserver)