N
Nathan Kovac
I have a field in a table that allows nulls. I used the wizard to create a dataset for this table. I now want to add a new row to the dataset and default in some of the values, but leave some of them null.
The Neither of the following lines work:
ticketDataSet1.Ticket.AddTicketRow(1, Session.Instance.employeeID, 1, 1, DBNull.Value, 1, DateTime.Today, DateTime.Today, 0, "");
ticketDataSet1.Ticket.AddTicketRow(1, Session.Instance.employeeID, 1, 1, null, 1, DateTime.Today, DateTime.Today, 0, "");
I always get an error saying can't convert DBNull.Value to data type int or cannot convert null to datatype int. In the xsd which defines the datatype for that element I see this line. Do I need to add something to allow it to be null?
<xs:element name="SubprojectID" type="xs:int" minOccurs="0" />
Your help is appreciated.
Thanks,
Nathan
The Neither of the following lines work:
ticketDataSet1.Ticket.AddTicketRow(1, Session.Instance.employeeID, 1, 1, DBNull.Value, 1, DateTime.Today, DateTime.Today, 0, "");
ticketDataSet1.Ticket.AddTicketRow(1, Session.Instance.employeeID, 1, 1, null, 1, DateTime.Today, DateTime.Today, 0, "");
I always get an error saying can't convert DBNull.Value to data type int or cannot convert null to datatype int. In the xsd which defines the datatype for that element I see this line. Do I need to add something to allow it to be null?
<xs:element name="SubprojectID" type="xs:int" minOccurs="0" />
Your help is appreciated.
Thanks,
Nathan