473,804 Members | 2,146 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Check box on a DataGridView

I have a datagridview on a Windows form where one of the columns is a
checkbox. After checking or unchecking the checkbox I try to update the
database. The following error appears

System.InvalidO perationExcepti on was unhandled

Edits to Textbox columns update without a problem. Any suggestion on what
I'm doing wrong. Thanks...

--
Tony
Jul 22 '07 #1
2 2771
Hi,
Could you post your full code here,so that we can reproduce that error and
provide solutions to it.
--
Hope this helps.
Thanks and Regards.
Manish Bafna.
MCP and MCTS.

"Tony A." wrote:
I have a datagridview on a Windows form where one of the columns is a
checkbox. After checking or unchecking the checkbox I try to update the
database. The following error appears

System.InvalidO perationExcepti on was unhandled

Edits to Textbox columns update without a problem. Any suggestion on what
I'm doing wrong. Thanks...

--
Tony
Jul 23 '07 #2
I resolved the problem by creating an EventHandler for the datagridview.
Everytime the check box changes the selected row is updated to the database.
--
Tony
"Manish Bafna" wrote:
Hi,
Could you post your full code here,so that we can reproduce that error and
provide solutions to it.
--
Hope this helps.
Thanks and Regards.
Manish Bafna.
MCP and MCTS.

"Tony A." wrote:
I have a datagridview on a Windows form where one of the columns is a
checkbox. After checking or unchecking the checkbox I try to update the
database. The following error appears

System.InvalidO perationExcepti on was unhandled

Edits to Textbox columns update without a problem. Any suggestion on what
I'm doing wrong. Thanks...

--
Tony
Jul 24 '07 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
11063
by: Kiran_Juikar | last post by:
How to add the header checkbox in the datagridview checkbox column? Is there any property available to add a header checkboxor one need to write the custom logic for this?
7
12633
by: Mitchell S. Honnert | last post by:
Is there an equivalent of the DataGrid's DataGridTableStyle for the DataGridView? If not, is there an easy way to duplicate the DataGridTableStyle's functionality for the DataGridView? Here's the background for my question... Before I switched my application over to the Fx 2.0, I used a DataGrid to display my data. I would store different DataGridTableStyles (each one with a custom set of columns) in the DataGrid.TableStyles property...
7
15666
by: =?Utf-8?B?TG9zdEluTUQ=?= | last post by:
Hi All :) I'm converting VB6 using True DBGrid Pro 8.0 to VB2005 using DataGridView. True DBGrid has a MultipleLines property that controls whether individual records span multiple lines. Is there an equivalent property for the DataGridView? I have searched, but have not found one. I would like the user to be able to see all the columns of the table on one screen - thus eliminating the need to use the horizontal scroll bar to view...
3
1760
by: trint | last post by:
I am writing a similar program that I have written as a WebForm, only this is a WinForm. In the WebForm I check for a row count in a GridView. It works perfectly everytime when GridView1.Row.Count == 0. But, in my WinForm, this code: bindingSource4.DataSource = GetData2("Select id, parent_id, name, image_file_name, thumbnail FROM categories where parent_id = '" + dgData1 + "' order by sort_order asc");
0
2507
by: jeastman - Hotmail | last post by:
Hello world Excuse, not to be written English and it helps me with a translator. I am new programming in C#. I made a control inheriting the DataGridView to be able to add controls done by my.
1
12671
by: QuickBooksDev | last post by:
VB.NET 2005 DataGridView Checkbox - Check Event need to know check status I would like to use the DataGridView Checkbox like a normal checkbox. When someone clicks on it I would expect that I could get a checked or changed event and be able to test if the box was checked or unchecked. For a normal checkbox. When it is checked you can test chk.checked and it is the current visible stated. Someone checks it and your test for chk.checked...
1
15361
by: Magnus.Moraberg | last post by:
Hi, I have the following event which checks if a cell in a dgv contains a date and if so, checks if it is formatted correctly. I don't think its good practice for be to try this by catching an exception. Is there a better way? Notice also my use of a dummy dateTime object. Also, does the DateTime object contain any information about how it should be formatted? For example - "Format Error: DateTime cell incorrectly formatted. Expected...
3
5754
by: Andrus | last post by:
I have DataGridView in virtual mode containing 3500 rows. In code below, assigning to RowCount value to 3500 takes 8 seconds. CPU usage goes high at this time. Stepping by F11 into user code shows few celltemplate property getters and combobox/datecombo constructor calls without database access which does not take a lot of time. Debug output (below) shows lot of messages Stepping over non-user code. Running in release mode from...
6
5703
by: Infog | last post by:
I have a DataGridView that has columns with a value type of boolean. To load the DataGridView, I load values into a DataTable then set theDataGridView.DataSource = theTable What value can I use in the table to load an intermediate check state? Would it be better to use a check box control with a value than to use a column set to the boolean data type? The check box is for display only, and will not need to be changed.
0
9715
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
10603
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10099
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
9176
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
6869
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5536
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5675
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4314
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
3
3003
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.