Solved

VB.Net: Form with DataGridView control failing to close

Posted on 2014-01-02
4
574 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
  • 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

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Introduction As chip makers focus on adding processor cores over increasing clock speed, developers need to utilize the features of modern CPUs.  One of the ways we can do this is by implementing parallel algorithms in our software.   One recent…
1.0 - Introduction Converting Visual Basic 6.0 (VB6) to Visual Basic 2008+ (VB.NET). If ever there was a subject full of murkiness and bad decisions, it is this one!   The first problem seems to be that people considering this task of converting…
Email security requires an ever evolving service that stays up to date with counter-evolving threats. The Email Laundry perform Research and Development to ensure their email security service evolves faster than cyber criminals. We apply our Threat…

713 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