473,811 Members | 2,705 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Datagridview dropdownbox value changed

When i change the value in the dropdownbox.
The value changes.
When i check the datatable the value has changed
But when i want to save it to the database the record didnt got a
changed flag
When i do dtTest = dtData.getchang es then dtTest is nothing ???
But still the value in the datatable has the right value, but because
it didnt have a change flag it isnt saved to the database???

What i am doing wrong??

With _ColumnPositie
.HeaderText = "Positie"
.Width = 120
.DataSource = g_cDatabase.dtP ositie
.DataPropertyNa me = "PlayerPosi tie"
.DisplayMember = "PositieOmschri jving"
.ValueMember = "Positie"
.Name = "cboPositie "
End With
dgvPlayers.Colu mns.Insert(3, _ColumnPositie)
mine update functie

Public Sub DBUpdate(ByVal dtData As DataTable, ByVal sTabelNaam As
String)

Dim daUpdate As New SqlDataAdapter( )
daUpdate.Select Command = New SqlCommand("Sel ect * from " &
sTabelNaam, _SQLConn)
Dim cbUpdate As SqlCommandBuild er = New
SqlCommandBuild er(daUpdate)

Dim dtTest As DataTable
dtTest = dtData.GetChang es

cbUpdate.GetDel eteCommand()
cbUpdate.GetIns ertCommand()
cbUpdate.GetUpd ateCommand()

daUpdate.Update (dtData)
dtData.AcceptCh anges()
End Sub

and if a value changes:

Private Sub dgvPlayers_Cell ValueChanged(By Val sender As Object, ByVal e
As System.Windows. Forms.DataGridV iewCellEventArg s) Handles
dgvPlayers.Cell ValueChanged

If dgvPlayers.Curr entCell.ColumnI ndex = 3 Then
g_cDatabase.DBU pdate(dgvPlayer s.DataSource, "T_Players" )
End If
end sub

Aug 2 '06 #1
0 915

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

Similar topics

6
2018
by: thomas j | last post by:
Hi, I have a MySqlBase with a tabel named CARS and with 3 fields; CarsType, CarsModel, CarsInfo. Now I want to generate 2 dropdownboxes in PHP read from CARS. First I will "load" CarsType into an dropdownbox, and then I make a choice, exampel FORD, now the next dropdownbox (CarsModel) will show Escort, Sierra and so... Finally I will make a "actionbutton" named showinfo and when I click it will show CarsInfo.
2
1756
by: Lars Netzel | last post by:
Hi I'm having a DropDown box with 2 items... one with Value 1 and one with Value 2. If I load the page and it has Value 1 selected from page_load() and then select Value 2 on the form.. .and then from a checkbox use javascript to diasable to DropDownBox before I press a button to do the post back. So.. the DropDownBox has Value 2 but it manually disabled by me..
7
9703
by: steve | last post by:
Hi All I urgently need help on setting datagridview cell borders at runtime I found some code on the web from Programming Smart Client Data Applications with .NET 2.0 by Brian Noyes See below This is what I have been trying to achieve, but when I run it ALL the cell
1
1658
by: Danny M | last post by:
Does anyone ave a good exsample on how you bind 2 tables into a datagridview where the second table is the values of a dropdownbox. With delete (whole row not dropdownbox table) and edit ?
3
4662
by: Daniel Manes | last post by:
I need a strategy to debug this situation... I can't put all the code involved, but here are some of the critical lines with comments: ------------------------- Private _parentDataCell As DataGridViewCell 'declare private field _parentDataCell = _parentDataGrid.Rows(rowIndex).Cells(columnIndex) 'set to a specific cell Debug.Print(_parentDataCell.DataGridView.ToString) 'prints:
4
15515
by: Terry Olsen | last post by:
How can i tell if a row in my DataGridView has been edited? I'm loading a DataTable with ID3 information from MP3 files and using that as the datasource for the DataGridView. I'm letting the user edit the information in the grid and when the user has finished, he clicks the "Update" button. Then I update the ID3 information in each MP3 file with the data from the grid. However, if the grid has hundreds of files in it, this can take a...
1
7431
by: sklett | last post by:
I've got a strange situation here. I have a databound DataGridView that also has un-bound columns. When the view loads, I want to update the values of the unbound columns. If I attempt to modify the unbound column's cells in the OnLoad() handler the results are very strange. If I add a button to my view and update the unbound cells in the butt's handler it works fine. Here is an example of the code I'm trying to use (it's test code):...
6
3221
by: Miro | last post by:
Sorry for the cross post. I am stuck. I have a datagridview for poker rounds. Basically there are 3 columns in this datagridview. "Round" "SmallBlind" "BigBlind" I have an issue when I tab through the new row being added. It does not 'Add' that row, nor setup the 'next blank add row' so I can continue to tab
0
5662
by: priyamtheone | last post by:
I'm trying to make a datagridview column to act like a datetimepicker column (C#.Net 2005). These are the behaviours that the dgv should have: 1) Initially all the cells of the dtp column should be blank unless they are filled by the user. 2) As soon as the user enters a cell, the dtp control should appear as the editing control of that cell. If there's a value in the cell beforehand, that value is set as the value of the dtp editing control...
0
9734
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
9607
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10397
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10410
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 most users, this new feature is actually very convenient. If you want to control the update process,...
0
10138
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
9214
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...
1
7674
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 instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6897
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();...
2
3878
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.