The problem "MSDatasetGenerator failed" with System.Guid DefaultValue  
Author Message
kolja2003





PostPosted: .NET Framework Data Access and Storage, The problem "MSDatasetGenerator failed" with System.Guid DefaultValue Top

Hi,

I create Dataset with field of "System.Guid" type in VS2005. Then I put down the "DefaultValue" for the field equals to "00000000-0000-0000-0000-000000000000".

When I click to build the project with this Dataset, so AFAIK VisualStudio makes my Dataset but fails and gives me the following error message:

"Error 1 Custom tool error: Failed to generate code. Failed to generate code. Object of type 'System.Guid' cannot be converted to type 'System.String'. Object of type 'System.Guid' cannot be converted to type 'System.String'..."

Notice if I put down the "DefaultValue" equaled to <DBNull> then everything goes fine and the project is bult OK. SO something wrong with my default value. Probably I used the wrong format.

What the format would be TIA.



.NET Development10  
 
 
Bill Lin - MSFT





PostPosted: .NET Framework Data Access and Storage, The problem "MSDatasetGenerator failed" with System.Guid DefaultValue Top

It seems the workaround is to convert the Guid value to string when you assign it to DefaultValue of the datacolumn.