TypeCasting Error in Wizard

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Christopher Weaver

    #1

    TypeCasting Error in Wizard

    The data form wizard created this:

    public void LoadDataSet()
    {
    FollowUpApp.dsA ssignedTo objService;
    objService = new FollowUpApp.dsA ssignedTo();
    // Create a new dataset to hold the records returned from the call to
    FillDataSet.
    // A temporary dataset is used because filling the existing dataset would
    // require the databindings to be rebound.
    FollowUpApp.dsN ames objDataSetTemp;
    objDataSetTemp = new FollowUpApp.dsN ames();
    try
    {
    // Attempt to fill the temporary dataset.
    objDataSetTemp = ((FollowUpApp.d sNames)(objServ ice.Clone()));

    It crashes with an 'invalid cast' exception on the last line shown. I've
    examined the .xsd for both dsNames and dsAssignedTo and they are identical.
    When I created this form using the wizard it asked if I wanted to use an
    existing ds and I chose dsAssignedTo.

    Any ideas on why the 'invalid cast' exception and what to do about it?


Working...