A
Andrew Hayes
I'm converting a C#.NET project that was originally written using VS2003 to
VS2005, and on the whole everything has gone well, except for the XSD
DataSets.
I have a class, SmartDataSet, defined as
public class SmartDataSet : DataSet
which has a few extra methods and properties.
I also have a dataset, PartDataSet, which is just a DataTable and 3 columns,
with 2 queries; FetchPartByPartNumber and FetchPartByStockLevel.
In VS2003, the following code is fine:
public SmartDataSet FetchDataSet( object Criteria )
{
ArrayList array = (ArrayList)Criteria;
switch( (string)array[0] )
{
case "PartNumber":
return FetchPartByPartNumber( (string)array[1] );
case "StockLevel":
return FetchPartByStockLevel( (int)array[1] );
default:
throw new Exception( "Invalid criteria supplied" );
}
}
However, in VS2005 it throws a compile error saying it cannot implicitly
convert type PartDataSet to SmartDataSet.
I tried changing the PartDataSet.Designer.cs to use SmartDataSet instead of
global::System.Data.DataSet in the class definition, but then I got a "No
overload for method 'SmartDataSet' takes '3' arguments" error.
Considering that is an auto-generated file, I'd rather not be playing around
with it when it'll just get overwritten the next time it runs the
MSDataSetGenerator custom tool.
Can anyone offer some advice on this?
VS2005, and on the whole everything has gone well, except for the XSD
DataSets.
I have a class, SmartDataSet, defined as
public class SmartDataSet : DataSet
which has a few extra methods and properties.
I also have a dataset, PartDataSet, which is just a DataTable and 3 columns,
with 2 queries; FetchPartByPartNumber and FetchPartByStockLevel.
In VS2003, the following code is fine:
public SmartDataSet FetchDataSet( object Criteria )
{
ArrayList array = (ArrayList)Criteria;
switch( (string)array[0] )
{
case "PartNumber":
return FetchPartByPartNumber( (string)array[1] );
case "StockLevel":
return FetchPartByStockLevel( (int)array[1] );
default:
throw new Exception( "Invalid criteria supplied" );
}
}
However, in VS2005 it throws a compile error saying it cannot implicitly
convert type PartDataSet to SmartDataSet.
I tried changing the PartDataSet.Designer.cs to use SmartDataSet instead of
global::System.Data.DataSet in the class definition, but then I got a "No
overload for method 'SmartDataSet' takes '3' arguments" error.
Considering that is an auto-generated file, I'd rather not be playing around
with it when it'll just get overwritten the next time it runs the
MSDataSetGenerator custom tool.
Can anyone offer some advice on this?