473,513 Members | 2,678 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Dataset binding in reverse

Dear All,

I have the following problem.

I have populated a datasset and bound the contents to varous text
fields defined in a page. I do this through running Me.Databind in
the Form_Load of the page concerned. The dataset will only contain
one table and one row within the table.

Up to this point everything is OK.

One the form is displayed, the user is free to change any of the
values. A button is supplied to submit the form at which point I want
to update the dataset and apply the changes to my datasource - at this
stage I'm not too sure whether this will be a SQL database or xml
file.

I know that I can [on postback] build the dataset again, get the
contents of each of the controls on the form and update the dataset

eg.
dim ds as Dataset

ds = buildDataset()

ds.tables(0).rows(0).item("ClientName") = txtClientName.text
ds.tables(0).rows(0).item("ClientAddress") = txtClientAddress.text

etc....

Ideally, I'm looking for a way to automatically update the dataset in
the same way that the databind function automatically updates the form
controls.

Is my example above the recommended way to do this or can it be done
more gracefully....

Thanks in advance,

Jan-Willem Wilson.
Nov 18 '05 #1
1 1680
When you created your dataset, the wizard in VS.NET sets this up for you
automatically and if it can't it warns you that it can't create an
update/insert sql. Try generating the dataset again to see what I am
talking about in VS.NET.
"PartyFears" <wi*******@bigfoot.com> wrote in message
news:f7**************************@posting.google.c om...
Dear All,

I have the following problem.

I have populated a datasset and bound the contents to varous text
fields defined in a page. I do this through running Me.Databind in
the Form_Load of the page concerned. The dataset will only contain
one table and one row within the table.

Up to this point everything is OK.

One the form is displayed, the user is free to change any of the
values. A button is supplied to submit the form at which point I want
to update the dataset and apply the changes to my datasource - at this
stage I'm not too sure whether this will be a SQL database or xml
file.

I know that I can [on postback] build the dataset again, get the
contents of each of the controls on the form and update the dataset

eg.
dim ds as Dataset

ds = buildDataset()

ds.tables(0).rows(0).item("ClientName") = txtClientName.text
ds.tables(0).rows(0).item("ClientAddress") = txtClientAddress.text

etc....

Ideally, I'm looking for a way to automatically update the dataset in
the same way that the databind function automatically updates the form
controls.

Is my example above the recommended way to do this or can it be done
more gracefully....

Thanks in advance,

Jan-Willem Wilson.

Nov 18 '05 #2

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

Similar topics

6
7470
by: Omar | last post by:
When I try to databind my comboBox (specifically field "emplcode") to a filled dataset , the contents of the comboBox displays a bunch of "System.Data.DataRowView". I assume the amount of times...
2
1728
by: muesliflakes | last post by:
I have a DataSet that bound to controls on multiple forms. Currently an instance is created on each form and Load / Write is handled on each form. Instead I would like to have a single instance...
4
12284
by: bardo | last post by:
Does anyone knwo how I can bind a textbox to a single dataset/dataTable row? The following will give me only a Column: textBox1.DataBindings.Add(new System.Windows.Forms.Binding("Text",...
0
3479
by: Dave | last post by:
Tried posting in the Winform Forum without much luck, so posting here... After inserting a new data row to a DataTable that is bound to a datagrid, I am unable to change data in a row that is...
1
1364
by: Geraldine Hobley | last post by:
Hello, I have a problem whereby I have a datagrid and and extra field all bound to the same dataset. I can easily edit rows in the dataset by changing the bindingposition in the...
17
2730
by: A_PK | last post by:
I have problem databinding the DataGrid with DataView/DataSet after the filter... I create the following proceudre in order for user to filter as many as they want, but the following code is only...
3
3270
by: serge calderara | last post by:
Dear all, Does anyone know how to bind a System.Collection.ArraysList object to a Dataset ? Thanks for your reply Regards Serge
6
1867
by: mike11d11 | last post by:
My program has to tables in it. One is the Accounts table with all personal information and then there is also my Memos table with all the notes for each account. My program displays one record...
3
12327
by: Paez | last post by:
Hi there. Anybody knows if is it possible to reverse a dataset? Lets say, if the dataSet has 10 rows, row 1 will row 10 and row 10 will be 1 and so on... Thanks in advance. Paez
0
7257
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
7157
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
7535
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...
1
7098
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...
0
7521
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...
0
5682
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,...
1
5084
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...
0
3221
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
798
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.