Avatar of PeterFrb
PeterFrb
Flag for United States of America asked on

VB.Net: Form with DataGridView control failing to close

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
Visual Basic.NET

Avatar of undefined
Last Comment
Jesus Rodriguez

8/22/2022 - Mon
ASKER CERTIFIED SOLUTION
Jesus Rodriguez

THIS SOLUTION ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
GET A PERSONALIZED SOLUTION
Ask your own question & get feedback from real experts
Find out why thousands trust the EE community with their toughest problems.
PeterFrb

ASKER
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.
PeterFrb

ASKER
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
Jesus Rodriguez

Always welcome my friend.
Experts Exchange has (a) saved my job multiple times, (b) saved me hours, days, and even weeks of work, and often (c) makes me look like a superhero! This place is MAGIC!
Walt Forbes