Solved

Datatable Null Exception

Posted on 2010-09-20
1
298 Views
Last Modified: 2013-11-26
Hello,

I'm creating a Windows application using Access database as the backend.

What I want to achieve is to search for an record in the database using a datagridview and update the table.
I have button for "Update", but it's throwing an Nullexception error. My database table does have null values in it.

Private dt as dataset = nothing
Dim dt As DataTable  = ds.Tables("TBL_ASSETS")
        Me.TBL_ASSETSDataGridView.BindingContext(dt).EndCurrentEdit()
        Me.TBL_ASSETSDataGridView.Update()

Can someone please assist?
Thank you
0
Comment
Question by:angel7170
1 Comment
 
LVL 7

Accepted Solution

by:
kovilpattiBalu earned 500 total points
ID: 33716367
Check before End edit  like this..

if (control.DataBindings.Count > 0)
   {
      control.DataBindings[0].BindingManagerBase.EndCurrentEdit();
   }
0

Featured Post

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

For those of you who don't follow the news, or just happen to live under rocks, Microsoft Research released a beta SDK (http://www.microsoft.com/en-us/download/details.aspx?id=27876) for the Xbox 360 Kinect. If you don't know what a Kinect is (http:…
A long time ago (May 2011), I have written an article showing you how to create a DLL using Visual Studio 2005 to be hosted in SQL Server 2005. That was valid at that time and it is still valid if you are still using these versions. You can still re…
This video shows how to remove a single email address from the Outlook 2010 Auto Suggestion memory. NOTE: For Outlook 2016 and 2013 perform the exact same steps. Open a new email: Click the New email button in Outlook. Start typing the address: …
This video explains how to create simple products associated to Magento configurable product and offers fast way of their generation with Store Manager for Magento tool.

708 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now