• Home
  • My College Team Blog
  • My Poetic Feelings
Blue Orange Green Pink Purple

welcome!

 

My follow up to you're listening!




Checkout the original xkcd comic here : http://xkcd.com/525/
Read More 0 comments | Posted by Geethan edit post

Inkscape And Hand Tool

If you have ever wondered and wanted to use the hand tool in Inkscape, you can do so by the following techniques :

1. You middle click and drag your mouse for panning the document.
2. Or go to, File->Inkscape Preferences->Scrolling. Then check on the "Left click pans when space is pressed". Presto! Now you can use the spacebar to pan the document, as you would normally do!
Read More 0 comments | Posted by Geethan edit post

Gmail and <eom>

Gmail is interestingly smart. I always hated when gmail pops up the question "Send this message without text in the body?". But recently I discovered that the question can be suppressed by adding the end of mail slang <eom> to the subject line.

A time saver.
Read More 1 Comment | Posted by Geethan edit post

ToolTip and "Cannot access a disposed object" exception


The "Cannot access a disposed object" exception is a nightmare for .NET developers. ;) Sometimes, this exception causes the worst backslash for a development project. And looking at exception details, we will find that the call stack will point to

"at System.Windows.Forms.Control.CreateHandle()
 at System.Windows.Forms.Control.get_Handle() "

Or

"at System.Windows.Forms.Form.CreateHandle()
 at System.Windows.Forms.Form.get_Handle() "

Since, we do not know from where the problem stems, it becomes a trial-and-error method to find out the source of the problem. After some days of research, I found out the following facts about the problem. Here it goes.


Reason :

   This exception occurs only when we try to access any disposed object, as it says. But the problem is, we would have never written statements that explicitly access a disposed object! So the real reason would be some unseen code that accesses the disposed Form or Object. In my case, the black sheep was the ToolTip control.

   I had used the ToolTip to show messages on different forms. But the internal architecture of the ToolTip has been coded by a novice at Microsoft i guess, and its faulty. By going through reflection i found that it uses a variable to store the current form in which it the message is being displayed. I had used the same instance of ToolTip to show messages on other forms too. When I used the ToolTip to show messages on another form after the previous form has been closed, the ToolTip tries to access the form in its private variable (the closed/disposed form) and boom! It throws the exception!

   Another instance where this can happen is - Dockable Container, this happens with ToolTip when the container is changed/docked to another parent. Now since, the parent is changed, when the ToolTip tries to access the parent and it is already disposed. So the exception is thrown.

Solution:

   The solution I devised was to create a new ToolTip instance for every Form that I showed on the screen. This worked around the problem and it was solved. For those, with Dockable Container problem, try to recreate the controls when they are moved or docked. This will solve the problem.

   And microsoft is supposed to have corrected this problem in v3.5 framework. But I haven't checked it out yet.
Read More 0 comments | Posted by Geethan edit post

Finding whether its Design Mode or Runtime Mode in VB.NET

Sometimes, while creating controls, either by Inherited Controls or UserControls, we will be required to skip a piece of code depending upon the design time or runtime mode. This can be done easily by the following code inside a control.


If Me.Site IsNot Nothing AndAlso Me.Site.DesignMode = True Then
    'Designtime code here
Else
    'Runtime code here
End If


Using this code in a control, we can find the mode and avoid certain errors when in Design Mode. This is mostly used in overridden event methods in Inherited Controls.
Read More 0 comments | Posted by Geethan edit post

Update requires a valid UpdateCommand when passed DataRow collection with modified rows



This is an error, with which i was dumbfounded for weeks. The problem is simple. I have a DataSet and it automatically generates INSERT command. So i can add rows to the DataSet and update it easily. But whenever i change values in existing rows and update it via TableAdapter, I get this exception "Update requires a valid UpdateCommand when passed DataRow collection with modified rows". I found inside the generated code that only INSERT command is generated. Whatever i try, the DataSet designer would not create an UPDATE command nor a DELETE command for this TableAdapter.

Solution 1:

You can select the TableAdapter and write your own query for the update command in the property dialog box.

But this is not a good idea.

Solution 2: (Better one)

The problem lies within your table design. Check it out again and check whether you have created a primary key for the table. Mostly this will be the case, as I forgot to create one. Now after creating the primary key, you can recreate the DataSets to get the corresponding UPDATE and DELETE statements.

But if you do not want a primary key in your table, you may resort to first solution.


Cheers.
Read More 4 comments | Posted by Geethan edit post

Welcome

First post :) Have fun!
Read More 0 comments | Posted by Geethan edit post

Technologiques

  • About Geethan
      Geethan is a pragmatic developer who has a varied interest ranging from null to nil. And he also thinks the world needs more of tuples.

      This blog is a mix of his technical ramblings, his philosophical outlooks and also a bit of his personal life.
  • Blog Archive

    • ▼ 2009 (3)
      • ▼ November (1)
        • My follow up to you're listening!
      • ► August (1)
        • Inkscape And Hand Tool
      • ► June (1)
        • Gmail and <eom>
    • ► 2008 (4)
      • ► June (3)
        • ToolTip and "Cannot access a disposed object" exce...
        • Finding whether its Design Mode or Runtime Mode in...
        • Update requires a valid UpdateCommand when passed ...
      • ► May (1)
        • Welcome

    Labels

    • .NET (3)
  • Search






    • Home
    • Posts RSS
    • Comments RSS

    © Copyright Technologiques. All rights reserved.

    Designed by FTL Wordpress Themes | Bloggerized by FalconHive.com brought to you by Smashing Magazine

    Back to Top