473,385 Members | 1,907 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

Re-post, Help really needed here ! Dataview binded to Textbox for edits, I can't save the change.

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.
Jan 10 '06 #1
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)
Jan 10 '06 #2
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)

Jan 10 '06 #3
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)

Jan 11 '06 #4
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
Jan 11 '06 #5
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

Jan 11 '06 #6
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
Jan 11 '06 #7
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

Jan 11 '06 #8
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

Jan 11 '06 #9
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
Jan 11 '06 #10

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

Similar topics

1
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...
2
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...
3
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...
5
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...
1
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',
4
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 =...
2
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...
20
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...
7
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
1
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...
0
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,...
0
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$) { } ...
0
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...
0
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
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
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,...
0
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...
0
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,...
0
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...

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.