473,770 Members | 2,273 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).ro ws(0).item("Cli entName") = txtClientName.t ext
ds.tables(0).ro ws(0).item("Cli entAddress") = txtClientAddres s.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 1690
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*******@bigf oot.com> wrote in message
news:f7******** *************** ***@posting.goo gle.com...
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).ro ws(0).item("Cli entName") = txtClientName.t ext
ds.tables(0).ro ws(0).item("Cli entAddress") = txtClientAddres s.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
7485
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 "System.Data.DataR..." is displayed inside the combobox is the amount of records in the dataset. On the other hand, if my query is "select emplcode from payemployee", the databind will work fine (but I don't want to limit the dataset to one field)....
2
1739
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 DataSet that is accessed and maintained by Data Access Object (DAO) and I would like that DataSet to be re-used on each form. The problem I have is that when I drag a DataSet component onto a form, I am having trouble linking it to the DataSet...
4
12317
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", this.myDataTable, "TableNaam")) But in my program I need a textbox (that I can edit) directly bound to a fixed cel in a Dataset/ dataTable.
0
3504
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 after the newly added row without getting bizarre results. I have added the full code for the test below. Create a project drop in the code and run. There is nothing crazy about the code. I used the designer to add the dataset and to do the...
1
1388
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 MyGrid_currentcellchanged event of Mygrid, using the following function Private Function GetBindingPosition(ByVal IntMatchValue As Integer, ByVal MyMatchField As String, ByVal MyDataTable As DataTable) As Integer Dim i As Integer = 0 Dim blnValueFnd As Boolean ...
17
2770
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 allow user to filter the first time, when they tried the second time, the speficied cast error message will prompt one.... I create a mydataset1 first, and the mydataset1 data source was getting from DataGrid.DataSource.
3
3292
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
1879
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 at a time for each account in the dataset table. I now want to show only the notes in the memo file that match with the Accounts table current Account #. I have done some similar to this in Access with a subform linked by account # to account #...
3
12364
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
9454
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
10260
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. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
10038
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
9910
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...
1
7460
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
6712
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();...
0
5482
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
3609
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2850
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 effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.