How insert DBNULL for MYSQL table?

  • Thread starter Thread starter Bobby Edward
  • Start date Start date
B

Bobby Edward

Latest version of Visual Studio.NET, ASP.NET, MySql, MyDirect.Net
Connector... Using an XSD dataset to access the data and a Business Logic
Layer class to call the queries.

I have a datetime field in a table. Whenever I try to run the INSERT and
leave the datetime blank/null it gives me this error....

System.InvalidCastException: Conversion from string "" to type 'Date' is not
valid.

How do I get around this? I assume it's a property I can set within the XSD
designer (preferred)...
 
Latest version of Visual Studio.NET, ASP.NET, MySql, MyDirect.Net
Connector...  Using an XSD dataset to access the data and a Business Logic
Layer class to call the queries.

I have a datetime field in a table.  Whenever I try to run the INSERT and
leave the datetime blank/null it gives me this error....

System.InvalidCastException: Conversion from string "" to type 'Date' is not
valid.

How do I get around this?  I assume it's a property I can set within the XSD
designer (preferred)...

In schema:
<xs:element name="element_name" type="xs:date" nillable="true"/>

In document:
<element_name xsi:nil="true"/>
 
But when I pass the date param to the query and the date happens to be "" it
doesn't work even though it's setup to take nulls...

Latest version of Visual Studio.NET, ASP.NET, MySql, MyDirect.Net
Connector... Using an XSD dataset to access the data and a Business Logic
Layer class to call the queries.

I have a datetime field in a table. Whenever I try to run the INSERT and
leave the datetime blank/null it gives me this error....

System.InvalidCastException: Conversion from string "" to type 'Date' is
not
valid.

How do I get around this? I assume it's a property I can set within the
XSD
designer (preferred)...

In schema:
<xs:element name="element_name" type="xs:date" nillable="true"/>

In document:
<element_name xsi:nil="true"/>
 
Back
Top