Need some help with adding a row to a data table with a data type of date and number type. All the examples I find are for fields that are strings. Here is the code:
This is part of the error I get for the date:
I am sure this is rather simple but I can't locate any examples of adding new rows with one of these types. Thanks for any help in advance.
VB.NET:
drNew.Item("Unique Key") = "Unique Key" 'number type, does not work
drNew.Item("Player") = "Player" 'string type, works
drNew.Item("Picked") = "Picked" 'date type, does not work
This is part of the error I get for the date:
VB.NET:
An unhandled exception of type 'System.ArgumentException' occurred in system.data.dll
Additional information: System.FormatException: The string was not recognized as a valid DateTime. There is a unknown word starting at index 0.
I am sure this is rather simple but I can't locate any examples of adding new rows with one of these types. Thanks for any help in advance.