[2 days left] What’s wrong with your cloud strategy? Learn why multicloud solutions matter with Nimble Storage.Register Now

x
?
Solved

Datatable Null Exception

Posted on 2010-09-20
1
Medium Priority
?
322 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
1 Comment
 
LVL 7

Accepted Solution

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

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

Featured Post

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Recently while returning home from work my wife (another .NET developer) was murmuring something. On further poking she said that she has been assigned a task where she has to serialize and deserialize objects and she is afraid of serialization. Wha…
Wouldn’t it be nice if you could test whether an element is contained in an array by using a Contains method just like the one available on List objects? Wouldn’t it be good if you could write code like this? (CODE) In .NET 3.5, this is possible…
In this video, Percona Solutions Engineer Barrett Chambers discusses some of the basic syntax differences between MySQL and MongoDB. To learn more check out our webinar on MongoDB administration for MySQL DBA: https://www.percona.com/resources/we…
Want to learn how to record your desktop screen without having to use an outside camera. Click on this video and learn how to use the cool google extension called "Screencastify"! Step 1: Open a new google tab Step 2: Go to the left hand upper corn…

656 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