Solved

VB.Net: Form with DataGridView control failing to close

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

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

Since .Net 2.0, Visual Basic has made it easy to create a splash screen and set it via the "Splash Screen" drop down in the Project Properties.  A splash screen set in this manner is automatically created, displayed and closed by the framework itsel…
It’s quite interesting for me as I worked with Excel using vb.net for some time. Here are some topics which I know want to share with others whom this might help. First of all if you are working with Excel then you need to Download the Following …
This video gives you a great overview about bandwidth monitoring with SNMP and WMI with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're looking for how to monitor bandwidth using netflow or packet s…
This video demonstrates how to create an example email signature rule for a department in a company using CodeTwo Exchange Rules. The signature will be inserted beneath users' latest emails in conversations and will be displayed in users' Sent Items…

706 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

Need Help in Real-Time?

Connect with top rated Experts

17 Experts available now in Live!

Get 1:1 Help Now