Solved

Datatable Null Exception

Posted on 2010-09-20
1
313 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

Gigs: Get Your Project Delivered by an Expert

Select from freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely and get projects done right.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Flash (http://en.wikipedia.org/wiki/Adobe_Flash) has evolved over the years to where it has become a masterful tool for displaying content screen.  It has excellent layout placement, UI precision as well as rendering capabilities. This, along with t…
The object model of .Net can be overwhelming at times – so overwhelming that quite trivial tasks often take hours of research. In this case, the task at hand was to populate the datagrid from SQL Server database in Visual Studio 2008 Windows applica…
This Micro Tutorial will teach you how to censor certain areas of your screen. The example in this video will show a little boy's face being blurred. This will be demonstrated using Adobe Premiere Pro CS6.
This video shows how to quickly and easily add an email signature for all users on Exchange 2016. The resulting signature is applied on a server level by Exchange Online. The email signature template has been downloaded from: www.mail-signatures…

786 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