none
an error occurred while creating the new datasource SQL CE + Win CE 5.0 RRS feed

  • Question

  • Hi Guys,

    I am experiencing the same problem as described above: "an error occurred while creating the new datasource".  I have followed the above suggestions and have the same dev platform i.e. VS2008 Professional with SP1 installed.

    I am not sure if my problem is a little different.  I am able to create a Windows application with a SQL CE database connection and create a dataset referencing the SQL CE database.  If however I create a Windows CE smartdevice application (.NET Framework 3.5) I am still able to create the SQL CE database and open and edit it.  The error is thrown when I try to create a dataset...

    I create a connection string to the database (local project folder).  Select the tables I want in the dataset.  When I click FINISH I get this error.  In the project error list the following error is displayed: Error 1 Custom tool error: Failed to generate code. Object reference not set to an instance of an object. 

    Are you actually able to create a dataset for a SQL CE database on Windows CE 5.0??  If you are can someone tell me where I should start looking for the problem?

    Many thanks

    Les

    Sunday, March 15, 2009 8:19 PM

Answers

  • I think your VS instllation is broken, try another PC or try repairing your installation.
    Erik Ejlskov Jensen, MCTS: WM App, MCITP: SQL 2008 Dev - http://erikej.blogspot.com Please mark as answer, if this was it.
    Tuesday, March 17, 2009 6:57 PM
    Moderator
  • Hi Erik,

    OK to resolve the problem on my development machine I tried doing an upgrade from VISTA Business to VISTA Ultimate.  Then reinstall VS2008 + VS2008 SP1.  This did not work...!

    What I had to do was a clean install of VISTA and re-install VS + VS SP1 and now everything is working fine.

    My conclusion is that something in the Windows registry was broken that required a total re-install.

    Les
    • Marked as answer by Les C Sharp Monday, March 23, 2009 11:02 AM
    Monday, March 23, 2009 11:02 AM

All replies

  • Pleeeeeease can someone help me with this one...! 
    Monday, March 16, 2009 2:50 PM
  • I am able to create a dataset pointing to SQL Compact Northwind.sdf in a Windows CE SmartDevice Compact Framework 3.5 project using VS 2008 SP1. Are you able to browse the database in Server Explorer?
    Erik Ejlskov Jensen, MCTS: WM App, MCITP: SQL 2008 Dev - http://erikej.blogspot.com Please mark as answer, if this was it.
    Monday, March 16, 2009 4:54 PM
    Moderator
  • Hi Erik,

    Thanks for replying.  Yes I am able to connect to the database browse it and even modify it!  Just won't create a dataset...

    Les
    Monday, March 16, 2009 5:13 PM
  • And you have downloaded and installed SQL Compact 3.5 SP1 Windows Mobile runtime ? ( http://www.microsoft.com/downloads/details.aspx?FamilyID=FCE9ABBF-F807-45D6-A457-AB5615001C8F&displaylang=en )
    Erik Ejlskov Jensen, MCTS: WM App, MCITP: SQL 2008 Dev - http://erikej.blogspot.com Please mark as answer, if this was it.
    Monday, March 16, 2009 6:34 PM
    Moderator
  • Hi Erik,

    Yes.  Just to make sure I have just uninstalled the SQL CE runtime, SQL CE for devices & Design Tools and reinstalled all of them.  But ...still getting the error.... :(

    OK also been playing around a bit and found the following:
    1. Even with the error a dataset is created in the project (Project Explorer) but doesn't appear under Dataset view
    2. When I compare that dataset to the one that is sucessfully created in a normal Windows App (to the same database) there is no "Northwind.dataset.designer" file.  Not sure if there should be one?
    3. If I double click on the dataset it opens in designer and shows the tables I selected.
    4. If I right-click on the dataset and select "Run Custom Tool" I get an error: "The custom tool 'MSDataSetGenerator' failed. Object reference not set to an instance of an object"

    This "tool" that is being referred to seems to be the problem.

    Les

    Monday, March 16, 2009 7:29 PM
  • Can you create a dataset based on Northwind.sdf ?
    DataSets are not ideal for devices, (consume toomuch memory) - could you try to change the tool name to: MSResultSetGenerator
    Erik Ejlskov Jensen, MCTS: WM App, MCITP: SQL 2008 Dev - http://erikej.blogspot.com Please mark as answer, if this was it.
    Tuesday, March 17, 2009 9:22 AM
    Moderator
  • Hi Erik,

    In my previous post point 2. you will see I tried the Northwind database with the same result!

    What would you suggest for using on the CE device?  Need to populate dropdown lists...

    I am convinced that it is this tool that is the problem.  Where do I change the name?  How can I check that it is healthy?  Setting in VS? Registry?

    Please I have a project that I have to complete today and this is causing me such grief!!!

    Thanks

    Les

    Tuesday, March 17, 2009 4:07 PM
  •  Sorry, I missed the Northwind test. You change the Custom Tool name on the XSD properties in Solution Explorer.
    Erik Ejlskov Jensen, MCTS: WM App, MCITP: SQL 2008 Dev - http://erikej.blogspot.com Please mark as answer, if this was it.
    Tuesday, March 17, 2009 4:19 PM
    Moderator
  • Erik,

    Tried chenging the Custom tool to: MSResultSetGenerator and when I run it I get the same error "The custom tool 'MSResultSetGenerator' failed. Object reference not set to an instance of an object"

    Les
    Tuesday, March 17, 2009 5:00 PM
  • I think your VS instllation is broken, try another PC or try repairing your installation.
    Erik Ejlskov Jensen, MCTS: WM App, MCITP: SQL 2008 Dev - http://erikej.blogspot.com Please mark as answer, if this was it.
    Tuesday, March 17, 2009 6:57 PM
    Moderator
  • Hi Erik,

    I've tried completely uninstalling VS + All SQL CE components and re-installing.  That didn't work.  As I've said before I think it's a registry setting that is not changed by uninstall + re-install.  I think it could be a VS bug... I found this on MS Connect...

    https://connect.microsoft.com/VisualStudio/feedback/ViewFeedback.aspx?FeedbackID=391012&wa=wsignin1.0

    I'm gonna try on another machine... will let you know of the results...  I'm almost convinced it will work.

    Les
    Tuesday, March 17, 2009 7:42 PM
  • Hi Erik,

    OK from a clean install on a different machine it works fine.  The only differences on the other machine are that it's running VISTA Ultimate (I'm running VISTA Business) and on my machine I have UAC disabled.

    As I said before a total uninstall and re-install of VS did not resolve the problem.  I will try this weekend to reinstall VISTA and then re-install VS.  I'll give you feedback after that.

    Les
    Thursday, March 19, 2009 7:26 AM
  • Hi Erik,

    OK to resolve the problem on my development machine I tried doing an upgrade from VISTA Business to VISTA Ultimate.  Then reinstall VS2008 + VS2008 SP1.  This did not work...!

    What I had to do was a clean install of VISTA and re-install VS + VS SP1 and now everything is working fine.

    My conclusion is that something in the Windows registry was broken that required a total re-install.

    Les
    • Marked as answer by Les C Sharp Monday, March 23, 2009 11:02 AM
    Monday, March 23, 2009 11:02 AM
  • Hi Les

    I realise this reply is too late for you but in case anyone else stumbles on it, I had the same issue. Fortunately what is left of my hair is too short to get a good grip on. I didn't want to reinstall my whole environment so I used an existing virtual machine to generate the designer.cs file for my dataset. Then I found the next problem, the webservice I was attempting to update also failed with error "The custom tool 'MSDiscoCodeGenerator' failed". Googling on that error was more successful, obviously there are more people trying to connect from a mobile device to a webservice than create datasets. Anyway, I found this link . Opening a Visual Studio command prompt and entering "devenv /resetskippkgs" resolved both the MSDataSetGenerator error and the MSDiscoCodeGenerator error.

    Dave

    Wednesday, May 5, 2010 8:27 PM
  • Hi David_Clarke

    thanks for your answer "devenv /resetskippkgs". It works correctly. Really good! I have spent about 3 days on this problem.

    Wednesday, September 22, 2010 3:15 PM
  • The devenv /resetskippkgs did not work for me. However, I did check the most recent change to my dataset; the query I had just added had ExecuteMode = Reader, when I changed that the error went away.

    Looks like a very misleading error message. I'd suggest checking any recent changes/additions to the dataset before reinstalling everything.

    Hope this helps someone else coming across this.

    JDS

    Friday, June 17, 2011 9:08 AM
  • Hi David_Clarke

    thanks for your answer "devenv /resetskippkgs". It works correctly. Really good! I have spent about 3 days on this problem.

     "devenv /resetskippkgs" works fine. 
    Tuesday, August 23, 2011 7:14 PM