Skip to Content
author's profile photo Former Member
Former Member

Adding batch records using DI API 6.7

I am trying to add multiple records to a UDT using the DI API. When I add the second and subsequent records and do not specify the values for certain of the fields, they contain the old values when I add the record to the table. I tried using "" as the value but this sets the char fields to empty strings and the numeric fields to 0's. I would like to have these values be null in the DB but the statement:

tbl.UserFields.Fields.Item(k).Value = System.DBNull.Value;

Does not work. Only the following seems to work but is not what I want.

tbl.UserFields.Fields.Item(k).Value = "";

Do I have to delete and recreate the tbl object for each record?

Add a comment
10|10000 characters needed characters exceeded

Related questions

1 Answer

  • Best Answer
    Posted on Feb 10, 2005 at 07:26 AM

    Hi Gary,

    Unfortunately you are right and found a gap:

    DI API does not support setting Value back to "empty"/"null"... - except for memo fields.

    I.e. the only way to get this is currently to delete / recreate the tbl object for each record - or use a SQL statement in case this is not tolerable in terms of performance.

    Regards,

    Frank

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.