All,
I'm having an issue with the DataSet/TableAdapter code that was auto-generated by Visual Studio Professional 2005.
Here is a snippet from the DataSet.Designer.cs file that was created by the software:
[System.Diagnostics.De****NonUserCodeAttribute()] public void SetTaskOrderNoNull() { this[this.tableTaskOrder.TaskOrderNoColumn] = System.Convert.DBNull; }
The build error I get is: 'byte' does not contain a definition for 'Convert'. I've done nothing to the above code. It's straight from the mouth of Microsoft.
I've been looking through the Help system, and I've seen how the DBNull is a static member in the System.Convert class. Everything looks right to me.
One other build error that is related to this...here is the snippet:
if ((TaskOrderNo == null)) { this.Adapter.InsertCommand.Parameters[2].Value = System.DBNull.Value; } else { this.Adapter.InsertCommand.Parameters[2].Value = ((string)(TaskOrderNo)); }
With this code, I get the following error: 'System.Nullable<byte>' does not contain a definition for 'DBNull'.
In both cases above, I understand that the code is attempting to pass a valid NULL value to the INSERT statement that will update the database, if the data item in question happens to be a null. Both data items are strings in the code (and defined as varchar types in SQL Server 2000 database).
Can anyone shed some light here In every single place where this statement occurs (I've got about 30 parameters in the INSERT statement), I get these errors. Something that I really thought would take me 2 minutes to troubleshoot has blossomed into 2 hours. And, I'm totally stumped. For the most part, I don't like auto-generated code, but I'm playing with Visual Studio 2005 for the first time and attempting to learn the differences between DataSets/TableAdapters in the two Studios (2003 and 2005).
Thanks in advance for anyone's help on this!
.NET Development24
|