473,748 Members | 5,849 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

TabControls & Saving to a Database

Ray
Hi

I have designed a database app using a windows form and a tab control with
comboboxes and edit controls on each tab control. The problem that I am
having is with the edit form that I have created.

On the forms onload event handler I databind the controls on the various tab
controls to the dataset for the selected record.

The problem comes when I save the record. If I haven't clicked on each tab
page and I click on the "Save Changes" button the sql query only posts data
for the controls in the tab pages that I have clicked on. The rest of the
data for the rest of the controls are posted as blanks. It seems that the
data is only populates the edit controls when the tab page becomes or is set
as active.

This becomes a problem if the user only needs to edit data on the first tab
page and not the rest.

Is there anyway that this can be changed or should I loop through the tab
pages and set tabcontrols.Sel ectedTab each page to initialise the data...

Any suggestions or help will be greatly appreciated...

Thanks
Ray G
Nov 16 '05 #1
2 2347
Ray,

I am not sure, however did you try the endcurrentedit before your update?
BindingContext( ds.Tables[0]).EndCurrentEdi t();

In this case is ds.tables[0] the datasource you are using.

I hope this helps?

Cor

"Ray" <ra*@mweb.co.za >
Hi

I have designed a database app using a windows form and a tab control
with
comboboxes and edit controls on each tab control. The problem that I am
having is with the edit form that I have created.

On the forms onload event handler I databind the controls on the various
tab
controls to the dataset for the selected record.

The problem comes when I save the record. If I haven't clicked on each tab
page and I click on the "Save Changes" button the sql query only posts
data
for the controls in the tab pages that I have clicked on. The rest of the
data for the rest of the controls are posted as blanks. It seems that the
data is only populates the edit controls when the tab page becomes or is
set
as active.

This becomes a problem if the user only needs to edit data on the first
tab
page and not the rest.

Is there anyway that this can be changed or should I loop through the tab
pages and set tabcontrols.Sel ectedTab each page to initialise the data...

Any suggestions or help will be greatly appreciated...

Thanks
Ray G

Nov 16 '05 #2
Ray
On the form load I am using TextBox1.DataBi ndings.Add("Tex t", ds,
"master.fieldna me); to populate the edit boxes on various tab pages...

I am creating the connection, dataset and doing the binding via code and not
via components...

Is this the wrong way of doing things.

"Cor Ligthert" <no************ @planet.nl> wrote in message
news:er******** ******@TK2MSFTN GP15.phx.gbl...
Ray,

I am not sure, however did you try the endcurrentedit before your update?
BindingContext( ds.Tables[0]).EndCurrentEdi t();

In this case is ds.tables[0] the datasource you are using.

I hope this helps?

Cor

"Ray" <ra*@mweb.co.za >
Hi

I have designed a database app using a windows form and a tab control
with
comboboxes and edit controls on each tab control. The problem that I am
having is with the edit form that I have created.

On the forms onload event handler I databind the controls on the various
tab
controls to the dataset for the selected record.

The problem comes when I save the record. If I haven't clicked on each
tab
page and I click on the "Save Changes" button the sql query only posts
data
for the controls in the tab pages that I have clicked on. The rest of the
data for the rest of the controls are posted as blanks. It seems that the
data is only populates the edit controls when the tab page becomes or is
set
as active.

This becomes a problem if the user only needs to edit data on the first
tab
page and not the rest.

Is there anyway that this can be changed or should I loop through the tab
pages and set tabcontrols.Sel ectedTab each page to initialise the data...

Any suggestions or help will be greatly appreciated...

Thanks
Ray G


Nov 16 '05 #3

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

Similar topics

7
3364
by: AF | last post by:
I am a real novice to php and MySQL, with about a week's worth of reading and self tutoring. I have an urgent need to publish a database of information and need some guidance on how to do this. This question might be more suited to a MySQL newsgroup, but since php and MySQL seem to have become almost married to one another, and since getting the data out and displaying it is where my problem seems to lie, I thought I would start with...
8
2832
by: DylanM | last post by:
I have some checkboxes that are generated from the results of a database search. At the moment, the checkboxes are part of a table making up a form. Users are going through the form, clicking the boxes and saving to the database at the end with the 'Submit' command button. Is it possible to save the changes as the checkboxes are clicked? I suppose I'd need to write some dynamic ASP event handling at the same time as creating the checkboxes......
4
1679
by: Jerivix Entadi | last post by:
I'm attempting to create an application to work with a fluid database of people. I'm doing this in a command line, text-based manner. I need to know two things: 1) How do I save data, perhaps a group of objects and their memebers or a few lines of text? and 2) Is there any way to automate object construction? I'm thinking that I can create a vector or something similar to handle the number of people, is there a way for me to write a...
0
2772
by: zerobearing2 | last post by:
Hi all- I'm migrating to postgres from the MS SQL Server land, as I can see a great potential with postgres, I was wondering if anyone has experimented or started a project with XML inside user defined functions? I've seen the contrib/xml shipped with the distro, as I see it's usefulness, it's not quite what I had in mind (lacks the ablity to return recordset/table of nodes). Also, the project XpSQL seems
3
1997
by: Tim Marshall | last post by:
My A2003 is set up so that the default file format is Access 2000 (options, advanced tab). I've just tried to make my first A2003 mdb into an mde and I get an error saying: "you cannot create a <mdb name> ADE or MDE from a dtabase saved in <mdb name> 2000 format." Also, in help there's a curious note I simply don't understand which I've reproduced below (help on mde, "About ADE & MDE files"). I'm a former A97 developer, can someone...
0
1150
by: Rich | last post by:
I've got a tabcontrol with a number of databound textboxes on a tabpage (Form1). I've got a button that the user clicks that opens a dialog (Form2) and does a lookup from a database. The user makes a selection and chooses a button wired dialog.ok to close the dialog (form2) and populate the fields on tabcontrol (Form1). It all works except the textboxes don't retain the new data when I tab across to another tab page. Code To Open...
4
6723
by: Pedro Leite | last post by:
Good Afternoon. the code below is properly retreiving binary data from a database and saving it. but instead of saving at client machine is saving at the server machine. what is wrong with my code ?? thank you Pedro Leite From Portugal ------------------------------------
2
1840
by: chiefsitebuilder | last post by:
I have a question about saving an MS Access program to CD and verifyng that the program works after being saved. Here is my situation, I have a person who developed an application for me using MS Access 2003 and the person will be transferring ownership to me. The developer will be giving me a CD with Access DBase source code on it. How do I verify that he gives me everthing I need to run the application once the developer departs. ...
10
2178
by: qwertycat | last post by:
I'm new to multi-process programming, should one avoid forking children from children of a parent? I'd like to spawn 10 children from the parent and each of those children spawns another 5 children which process chunks of data (200 rows) with heavy usage of CPU and regexp
0
8984
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
9530
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...
0
9363
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
9312
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,...
1
6793
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
6073
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
4864
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
2775
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2206
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.