Solved

VB.Net: Form with DataGridView control failing to close

Posted on 2014-01-02
4
583 Views
Last Modified: 2014-01-03
I have a dataGrid control in my VB.Net form, which has been failing to work.  Right now, to test the form, I simply have the one control that is bound to an Access dataset.  When I first open the form, I see the data in the control, which I can edit.  Regardless of whether I edit it or not, each time I try to close the form it both refuses to close and presents me with an error.  The only way I've found to close the form is to go into the Task Manager and kill the process.  I screencaptured the two errors I'm getting.  

I've reproduced the code below: the only thing there is the generic process that VB.Net automatically generates to populate a control with a predesignated dataset.  I also have an attachment of the two error messages I get, which persist in iteration after iteration of the same genre of error.  Hope you can help.

Thanks, ~Peter Ferber

Public Class DataGrid_Control_Form

    Private Sub DataGrid_Control_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
        'TODO: This line of code loads data into the 'Data_DefinitionDataSet1.tbl_Role_Outfield' table. You can move, or remove it, as needed.
        Me.Tbl_Role_OutfieldTableAdapter.Fill(Me.Data_DefinitionDataSet1.tbl_Role_Outfield)

    End Sub
End Class

Open in new window


Error messages returned each time I run app, with Inability to close the form
0
Comment
Question by:PeterFrb
[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
  • 2
  • 2
4 Comments
 
LVL 13

Accepted Solution

by:
Jesus Rodriguez earned 500 total points
ID: 39752863
Can be various reasons but first check is the key field on your data in access doesn't have a valid value (Null or is the field will be integer that doesn't contain any letters ). It happens to me when the Key Field of the table contains an invalid value.

 Also can be that the some of the fields doesn't can not be formatted to the expected format of the grid for example if is date format on the grid and the data has an invalid date, then you will get this error too.
0
 

Author Comment

by:PeterFrb
ID: 39754355
You point is spot on, Jesus; and the conflict was Null values in the dataset, which I changed, via a query, to zero-length strings.
0
 

Author Closing Comment

by:PeterFrb
ID: 39754787
By changing my null values to zero-length strings, I am now able to run the program and close it on command!  Woo hoo!  Many thanks.  ~Peter
0
 
LVL 13

Expert Comment

by:Jesus Rodriguez
ID: 39754795
Always welcome my friend.
0

Featured Post

On Demand Webinar: Networking for the Cloud Era

Ready to improve network connectivity? Watch this webinar to learn how SD-WANs and a one-click instant connect tool can boost provisions, deployment, and management of your cloud connection.

Question has a verified solution.

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

Parsing a CSV file is a task that we are confronted with regularly, and although there are a vast number of means to do this, as a newbie, the field can be confusing and the tools can seem complex. A simple solution to parsing a customized CSV fi…
If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
This is a high-level webinar that covers the history of enterprise open source database use. It addresses both the advantages companies see in using open source database technologies, as well as the fears and reservations they might have. In this…
This is my first video review of Microsoft Bookings, I will be doing a part two with a bit more information, but wanted to get this out to you folks.

690 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