Generate Dataset Error: 'string' does not contain a definition for 'Convert'

D

Doug

I have a strongly typed dataset that contains a table that links to a
complex type in another dataset. One, and only one of the fields, in
the complex type has a minOccurs = 0. When I go to the dataset that
has the datatable that references the complex type, click generate
dataset, and compile I get the following error:

(1165): 'string' does not contain a definition for 'Convert'

For this line of code:

public void SetPhysicalRolesNull() {
this[this.tablev_cap_Request.PhysicalRolesColumn] =
System.Convert.DBNull;
}

If I change the System.Convert.DBNull to String.Empty, it compiles and
runs just fine. Only problem is, I cannot leave it like that because
the next guy that comes along and changes the dataset then regenerates
it is going to get the same error.

I have several other complex types that have fields that define
minOccurs = 0 and they have the same System.Convert.DBNull in the code
behind with no problem.

I have tried deleting the dataset and recreating it, removing the
complex type and recreating it and no luck. Please help me!!
 
S

sk

I got exactly the same error. The problem is with one of my columns
having the name "System". I changed the column name and the error
disappeared.

-SK
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top