Happy new year everyone,
Back from vacation, and here's a new Chalenge for "moi".
I got 2 Dataview.
1 for DVsupplierSearch that is bind to a grid
1 for DVSupplierDetails, that is bind to several TextBox for Edits
Both are views from SupplierTable in same Dataset.
Went I edit the Textboxes, the grids takes the edited information correctly,
but I cant find a way to comit those change to DB.
Why I got 2 datasets :
DVSupplierDetails binds to current seleted row into grid
Thanks for tips.
Marc R. 9 1203
"Marc R." <No****@NewgroupsONLY.com> wrote in message
news:%2****************@TK2MSFTNGP14.phx.gbl... Happy new year everyone,
Back from vacation, and here's a new Chalenge for "moi". I got 2 Dataview. 1 for DVsupplierSearch that is bind to a grid 1 for DVSupplierDetails, that is bind to several TextBox for Edits Both are views from SupplierTable in same Dataset. Went I edit the Textboxes, the grids takes the edited information correctly, but I cant find a way to comit those change to DB.
Why I got 2 datasets : DVSupplierDetails binds to current seleted row into grid
Thanks for tips.
Marc R.
Here is the code I have what is wrong ? I have tried to accept change all
possible way I could think of, but the DataAdapteur.updates will not make
the change
Me.DVSuppDetails.Table.AcceptChanges()
Me.DsAdmin1.Tables("fournisseur").AcceptChanges()
Me.DVSuppDetails.Table.DataSet.AcceptChanges()
da_Supplier.Update(Me.DVSuppDetails.Table)
da_Supplier.Update(DsAdmin1)
Marc,
AcceptChanges should be called after the data adapter's Update method, not
before.
Kerry Moorman
"Marc R." wrote: "Marc R." <No****@NewgroupsONLY.com> wrote in message news:%2****************@TK2MSFTNGP14.phx.gbl... Happy new year everyone,
Back from vacation, and here's a new Chalenge for "moi". I got 2 Dataview. 1 for DVsupplierSearch that is bind to a grid 1 for DVSupplierDetails, that is bind to several TextBox for Edits Both are views from SupplierTable in same Dataset. Went I edit the Textboxes, the grids takes the edited information correctly, but I cant find a way to comit those change to DB.
Why I got 2 datasets : DVSupplierDetails binds to current seleted row into grid
Thanks for tips.
Marc R.
Here is the code I have what is wrong ? I have tried to accept change all possible way I could think of, but the DataAdapteur.updates will not make the change
Me.DVSuppDetails.Table.AcceptChanges() Me.DsAdmin1.Tables("fournisseur").AcceptChanges()
Me.DVSuppDetails.Table.DataSet.AcceptChanges()
da_Supplier.Update(Me.DVSuppDetails.Table)
da_Supplier.Update(DsAdmin1)
If I do So, it doesn't even show the change into the grid. AND it is still
not saved. (into Database)
"Kerry Moorman" <Ke**********@discussions.microsoft.com> wrote in message
news:58**********************************@microsof t.com... Marc,
AcceptChanges should be called after the data adapter's Update method, not before.
Kerry Moorman
"Marc R." wrote:
"Marc R." <No****@NewgroupsONLY.com> wrote in message news:%2****************@TK2MSFTNGP14.phx.gbl... > Happy new year everyone, > > Back from vacation, and here's a new Chalenge for "moi". > I got 2 Dataview. > 1 for DVsupplierSearch that is bind to a grid > 1 for DVSupplierDetails, that is bind to several TextBox for Edits > Both are views from SupplierTable in same Dataset. > Went I edit the Textboxes, the grids takes the edited information > correctly, > but I cant find a way to comit those change to DB. > > Why I got 2 datasets : > DVSupplierDetails binds to current seleted row into grid > > Thanks for tips. > > Marc R.
Here is the code I have what is wrong ? I have tried to accept change all possible way I could think of, but the DataAdapteur.updates will not make the change
Me.DVSuppDetails.Table.AcceptChanges() Me.DsAdmin1.Tables("fournisseur").AcceptChanges()
Me.DVSuppDetails.Table.DataSet.AcceptChanges()
da_Supplier.Update(Me.DVSuppDetails.Table)
da_Supplier.Update(DsAdmin1)
Marc,
Set an endcurrentedit instead of your acceptchanges. The endcurrentedit
pushes the data from the grids to datasources.
\\\
BindingContext(ds.Tables(0)).EndCurrentEdit()
///
The ds.Tables(0) has to be what is the datasource of your datatagrid
The acceptchanges is with an original datatable done by the update command.
I hope this helps,
Cor
Sorry Cor, I'm realy new at .net ... bindingcontext mean ?
I will try to explain how my stuff is build :
Grid supplier :
datasource : DVSupplier (DataView on which I build rowfilter condition
from a quick questionaire)
TextBox txtSupplierName :
datasource : DVSuppDetails (on Grid_Supplier.click I take Selected row
supplier_ID and build a RowFilter for DVSuppDetails Wich fills all my txtbox
for edit.)
On each of my txtbox :
evenHandler "Enter and leave" have beguinedit and endEdit on the only
dataRow that DVSuppDetails may containt.
Ofcourse I need the grid to accepts my change from the texte box but more
importantly, I need to have the change in SQL server.
I will keep looking, for that hint,
BTW, sorry if my english is not that good, I'm a french person. I do my
best.
Marc R.
"Cor Ligthert [MVP]" <no************@planet.nl> wrote in message
news:%2****************@tk2msftngp13.phx.gbl... Marc,
Set an endcurrentedit instead of your acceptchanges. The endcurrentedit pushes the data from the grids to datasources.
\\\ BindingContext(ds.Tables(0)).EndCurrentEdit() /// The ds.Tables(0) has to be what is the datasource of your datatagrid
The acceptchanges is with an original datatable done by the update command.
I hope this helps,
Cor
Marc,
Just do it with both datasources. The bindingcontext is a collection of all
databindings you have set.
You tell than that it has to do the actions as if all things are done.
In a simple datacontrol (by instance textbox) the data is pushed as soon as
the cursor goes to another control. In a complex one (grid) if it goes to
the next row.
If you use a button to update or whatever than the data stays in the
control.
Try this ones.
BindingContext(DVSuppDetails).EndCurrentEdit()
BindingContext(DVSupplier).EndCurrentEdit()
The acceptchanges set all the rowstate indicators, that all changes are done
at the database and therefore you can never update it if you do that before
the update.
I hope this helps?
Cor
Thanks Cor,
Now It does save into DB, but still not updating the grid went leaving the
Textbox but I'm sure I will find out before you have time you reply,
thanks a lot,
"Cor Ligthert [MVP]" <no************@planet.nl> wrote in message
news:ud*************@TK2MSFTNGP12.phx.gbl... Marc,
Just do it with both datasources. The bindingcontext is a collection of all databindings you have set. You tell than that it has to do the actions as if all things are done.
In a simple datacontrol (by instance textbox) the data is pushed as soon as the cursor goes to another control. In a complex one (grid) if it goes to the next row.
If you use a button to update or whatever than the data stays in the control.
Try this ones.
BindingContext(DVSuppDetails).EndCurrentEdit() BindingContext(DVSupplier).EndCurrentEdit()
The acceptchanges set all the rowstate indicators, that all changes are done at the database and therefore you can never update it if you do that before the update.
I hope this helps?
Cor
Hi Cor,
once more sorry for such stupid question.
Seems that I can't update the grid right away I need to leave the textbox
then come back into it that leave again to have the Grid updates, Got any
idea why ?
"Cor Ligthert [MVP]" <no************@planet.nl> wrote in message
news:ud*************@TK2MSFTNGP12.phx.gbl... Marc,
Just do it with both datasources. The bindingcontext is a collection of all databindings you have set. You tell than that it has to do the actions as if all things are done.
In a simple datacontrol (by instance textbox) the data is pushed as soon as the cursor goes to another control. In a complex one (grid) if it goes to the next row.
If you use a button to update or whatever than the data stays in the control.
Try this ones.
BindingContext(DVSuppDetails).EndCurrentEdit() BindingContext(DVSupplier).EndCurrentEdit()
The acceptchanges set all the rowstate indicators, that all changes are done at the database and therefore you can never update it if you do that before the update.
I hope this helps?
Cor
Marc, Seems that I can't update the grid right away I need to leave the textbox then come back into it that leave again to have the Grid updates, Got any idea why ?
No not with this information, however you can forever use the
DataGridx.refresh http://msdn.microsoft.com/library/de...freshtopic.asp
If that does not help, do than reply.
Cor This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics
by: Nel |
last post by:
I have a question related to the "security" issues posed by Globals ON.
It is good programming technique IMO to initialise variables, even if it's
just
$foo = 0;
$bar = "";
Surely it would...
|
by: Topspin |
last post by:
I'm running PHP on Windows, but that's just the local test... in production
it will be on Apache.
I am not using PHP as a CGI. I want to perform redirection of the user's
browser if the user...
|
by: presspley |
last post by:
I have bought the book on advanced dreamweaver and PHP recently. I
have installed MySQL and PHP server but am getting an error on the
$GET statement show below. It says there is a problem with...
|
by: Jamie Wright |
last post by:
I have a problem with an HTML form. I have a form which I want to be able to
type basic HTML code into it. When the submit button is selected the data is
then previewed and added back into the text...
|
by: Brian |
last post by:
I have an array like this:
$events = array(
array(
'2003-07-01',
'Event Title 1',
'1' //ID Number (not unique)
),
array(
'2003-07-02',
|
by: Zachary Antolak |
last post by:
I implemented a timer in my PHP page to see how long it takes to run.
Here's the code:
$this->start_time = microtime();
/* All the code */
$this->end_time = microtime();
$this->calc_time =...
|
by: Frans Schmidt |
last post by:
I want to make a new database with several tables, so I did the following:
<?php
CREATE DATABASE bedrijf;
CREATE TABLE werknemers
(voornaam varchar(15),
achternaam varchar(20),
leeftijd...
|
by: bb |
last post by:
I'm not a Perl programmer nor a Linux adherent. What are the advantages of
LAMP vs.the Java model for building data-driven websites? I do a fair amount
of
development using Tomcat/JSP/Servlets...
|
by: Christoph Nothdurfter |
last post by:
Hallo!
I was wondering if my PHP4-Scripts will run under PHP5 (Haeven't tried the
beta yet).
Does anybody know?
Thank you,
-Christoph
|
by: lawrence |
last post by:
I just switched error_reporting to ALL so I could debug my site. I got
a huge page full of errors. One of the most common was that in my
arrays I'm using undefined offsets and indexes. These still...
|
by: taylorcarr |
last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
|
by: aa123db |
last post by:
Variable and constants
Use var or let for variables and const fror constants.
Var foo ='bar';
Let foo ='bar';const baz ='bar';
Functions
function $name$ ($parameters$) {
}
...
|
by: ryjfgjl |
last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
|
by: emmanuelkatto |
last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud.
Please let me know.
Thanks!
Emmanuel
|
by: nemocccc |
last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
|
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,...
|
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...
|
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,...
|
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...
| | |