Update requires a valid UpdateCommand when passed DataRow collection …

Posted by Troy on October 29, 2009 under .net, Microsoft, csharp | Be the First to Comment

 

I have been creating an application for work over the last couple of days which requires ADO.Net.  I work in the Business Intelligence field so I do not code verify often unless I need a custom script for an SSIS package.  Most of the Microsoft BI products just require a solid understanding of SQL or MDX and of course the customers business requirements.   While creating the application I ran into the following error when updating the databases with changes in the dataset.  I am using Visual Studio 2008 Express Edition and the database is a Compact Database. 

I only received the error when I tried to update a record in the database.  If I added a new record (INSERT) and saved my changes the application worked fine.  Below is a screenshot of the simple app:

image 

When you hit the save button it executes the following code:

try
{
 
this.Validate();
  this.rulesBindingSource.EndEdit();
  this.rulesTableAdapter.Update(this.ruleEngineDataSet.Rules);

  MessageBox.Show("Update successful!");

}

catch (System.Exception ex)
{
  MessageBox.Show("Update failed:\n" + ex.Message + "\n" + ex.StackTrace );

}

I placed a breakpoint on: this.Validate(); line.  When I ran the program  the program failed on: this.rulesTableAdapter.Update(this.ruleEngineDataSet.Rules);.  Below is a print screen of the message:

 

image 

The issue is with the TableAdapter.  There was no UpdateCommand (which is mentioned in the error message) or DeleteCommand for the TableAdapter:

 image

Create a new UpdateCommand by click (new) in the dropdown box.  You can use the query designer to create the update statement for the CommandText property:

image

Once the the CommandText property was set for the UpdateCommand the program worked. Below is a link to the issue found on msdn forums:

http://social.msdn.microsoft.com/Forums/en-US/Vsexpressvcs/thread/6d4de721-7571-49ca-a1fc-8689ec19a94e/

Troy

Error Installing the Blackberry Plug-in for Eclipse

Posted by Troy on July 13, 2009 under BlackBerry, IT, Mobile, Web | Read the First Comment

 

If you try installing the BlackBerry JDE Plug-in for Eclipse using the BlackBerry update site you will probably receive the following error:

An error occurred while collecting items to be installed Error closing the output stream for net.rim.EclipseJDE/org.eclipse.update.feature/1.0.0.67 on repository file:/C:/eclipse-SDK-3.4.1-win32/eclipse/. Error unzipping C:\DOCUME~1\scottt\LOCALS~1\Temp\net.rim.EclipseJDE_1.0.0.674162146521096327961.jar: Invalid zip file format Problems ...

 

There is a post on the BlackBerry support forum which says that the issue is related to their update site and that you need to download the plug-in:

http://na.blackberry.com/eng/developers/javaappdev/javaeclipseplug.jsp

It is also important to make sure that you have a valid version of Eclipse.  You need Ganymede 3.4 or 3.4.1.  You can download it here.  

I didn’t have much luck with the Full Installer.  I downloaded one of the component packs instead and manually added the packages to Eclipse.  When I ran the full installer the video display on my computer froze.

image

Go to Windows/Preferences once you have copied the correct files to the features and plugins folders in Eclipse.

Troy

Sharing Your Blog on Windows Live

Posted by Troy on July 12, 2009 under Blogging, Microsoft, Web | Be the First to Comment

 

In yesterday’s post as I was walking through the Windows Live Writer configuration and there was a step that allowed you to add your blog to your Window’s Live site (you need to have a Windows Live account for this).   When I tried sharing my WordPress site it failed.

The reason it failed is that blog was not set up as a feed.  To fix the issue I used feedburner to set up the blog as an RSS 2.0 feed.  Once it was set up I was able to share my WordPress blog on my Windows Live Profile page:

share_windowslive

The area highlighted in yellow shows my last post.

 

Troy

Using Windows Live Writer with WordPress

Posted by Troy on July 11, 2009 under Blogging, Microsoft | Be the First to Comment

 

Windows Live Writer is a great tool for writing and posting your blogs.  Creating a blog post using the WordPress online interface can be cumbersome especially if you need to add images and tables.   It also allows you to write when you do not have internet access. 

While writing your post you can easily toggle between edit, preview and source (html view).  It also allows you to set the publish date of the blog.   This feature is useful when you want to write a series a blogs in one sitting and then publish them a few days a part instead at the same time.

Liver Writer Preview Mode:

LiveWriter_Preview

Configuring Liver Writer with WordPress:

Here are some screen shots on how to configure your site:

LiveWriter_AddBlog

  • Enter the address and the username and password for the site
  • For example my address is : http://troyscott.ca

LiveWriter_AddBlog2

  • Wait while it tries to setup your site
  • This can take a couple of minutes

LiveWriter_AddBlog3

  • Once your blog is set up click Finish to start blogging

On the last setup page there is an option to Share your blog on Windows Live.  I tried setting this up but I couldn’t get it to work.  It may be because my WordPress site is self hosted.  Let me know if you experience the same issue.  Here is the error I received:

We can’t get your information for this web activity. Make sure the information you entered is correct, and try again.

WindowsLive_Blog_error

 

Troy

Windows Live One Care - File and Printer Sharing Issue

Posted by Troy on January 25, 2009 under Microsoft | Be the First to Comment

I have been using Windows Live Once Care for about a year now and I am impressed with the product.  It is easy to install and setup file and printer sharing.  Until recently this worked well.   It looks like there has been an update to the product which provides tighter security around file and printer sharing.  If I turned off my One Care firewall the file and printer sharing works fine but if the firewall is on it does not work.    However , don’t disable your firewall to test this out unless you have a router that protects your network.  If you want to try this make sure you are not connected to the Internet.

Thanks to the post below I was able to get local network sharing working again:

http://social.microsoft.com/Forums/en-US/onecareprintersharing/thread/8258915e-c350-4802-8cc9-0c60b5322193/

Read the second post by Stephen boots to get the details.  To summarize, you need to set your local network to the Home and Work Zone (not Public)  and open the ports for Inbound and outbound ICMPv4.

Troy