473,698 Members | 2,943 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 2342
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
3361
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
2830
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
1674
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
2766
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
1994
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
1146
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
6721
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
1839
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
2176
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
8610
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,...
1
8902
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
8873
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
6528
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
4372
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4623
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3052
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
2339
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2007
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.