473,569 Members | 2,522 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Updating database via DataGrid

Hi everyone,

My program reads data from a DataBase, then populates some ComboBoxes with
data from each Table respectively, filtering the data in each ComboBox
according to the item selected in the preceding ComboBox.
(...Thanks guys for the guidance in that area...)

The resulting filtered table displays the filtered result in a DataGrid.

I want to be able to edit any errors found in the text displayed. (This part
works).
I set the DataGrid to Enable the Update button when the cell is clicked.
I then have the Update button set itself to Enabled=False after performing
the Update.

Then problem is at this point. If I click the Update button, and then find
another error in the text, I can not get the Update button to Enabled=True
again.

Private Sub btnUpdate_Click (ByVal sender As System.Object, ByVal e As
System.EventArg s) Handles btnUpdate.Click

'Update the DataBase

Try

daText.Update(d sText)

Catch ex As Exception

MsgBox(ex.ToStr ing)

End Try

btnUpdate.Enabl ed = False

End Sub

Private Sub dgText_Click(By Val sender As Object, ByVal e As
System.EventArg s) Handles dgText.Click

'Enable the Update button

btnUpdate.Enabl ed = True

End Sub
Thanks in advance,

Gary
Nov 20 '05 #1
1 1017
Try

'Stuff

Catch ex As Exception

'Stuff

Finally

'Re-Enable the Button

End Try
OHM

Didymus wrote:
Hi everyone,

My program reads data from a DataBase, then populates some ComboBoxes
with data from each Table respectively, filtering the data in each
ComboBox according to the item selected in the preceding ComboBox.
(...Thanks guys for the guidance in that area...)

The resulting filtered table displays the filtered result in a
DataGrid.

I want to be able to edit any errors found in the text displayed.
(This part works).
I set the DataGrid to Enable the Update button when the cell is
clicked.
I then have the Update button set itself to Enabled=False after
performing the Update.

Then problem is at this point. If I click the Update button, and then
find another error in the text, I can not get the Update button to
Enabled=True again.

Private Sub btnUpdate_Click (ByVal sender As System.Object, ByVal e As
System.EventArg s) Handles btnUpdate.Click

'Update the DataBase

Try

daText.Update(d sText)

Catch ex As Exception

MsgBox(ex.ToStr ing)

End Try

btnUpdate.Enabl ed = False

End Sub

Private Sub dgText_Click(By Val sender As Object, ByVal e As
System.EventArg s) Handles dgText.Click

'Enable the Update button

btnUpdate.Enabl ed = True

End Sub
Thanks in advance,

Gary


--
Best Regards - OHM

O_H_M{at}BTInte rnet{dot}com
Nov 20 '05 #2

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

Similar topics

0
1295
by: cwbp17 | last post by:
Have two tables that have a FK relationship on ID column. Have one datagrid that displays all of the columns of both tables. What's the best approach on updating a row from the datagrid back to the database? I've used the following code for the DataGird1_UpdateCommand Option1
5
2018
by: junglist | last post by:
Hi guys, I've been trying to implement an editable datagrid and i have been succesful up to the point where i can update my datagrid row by row. However what used to happen was that once i updated one row, all of them were updated so i immediatelly figured out that i have to include the id of every entry in the update statement. This is where...
0
1629
by: cwbp17 | last post by:
I'm having trouble updating individual datagrid cells. Have two tables car_master (columns include Car_ID, YEAR,VEHICLE) and car_detail (columns include Car_ID,PRICE,MILEAGE,and BODY);both tables have a FK relationship on CAR_ID so the oracledataadapter1 select statement(CommandText) is: select car_master.car_id,...
10
5645
by: jaYPee | last post by:
does anyone experienced slowness when updating a dataset using AcceptChanges? when calling this code it takes many seconds to update the database SqlDataAdapter1.Update(DsStudentCourse1) DsStudentCourse1.AcceptChanges() i'm also wondering because w/ out AcceptChanges the data is still save into the database and it is now faster.
0
1027
by: cwbp17 | last post by:
Have two tables that have a FK relationship on ID column. Have one datagrid that displays all of the columns of both tables. What's the best approach on updating a row from the datagrid back to the database? I've used the following code for the DataGird1_UpdateCommand Option1
0
7701
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...
0
7924
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. ...
1
7677
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For...
0
6284
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...
1
5514
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes...
0
3653
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...
0
3643
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
1223
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
940
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...

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.