473,406 Members | 2,293 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,406 software developers and data experts.

Databinding, DataSets & DataRows.

Hi all, I am stuck over a few issues and hope some of you can help me out.

I'll start with the scenario:

I have a form with 2 textboxs and 3 buttons on it. Behind this is a dataset
into which I've loaded data records from a database. The textboxes are bound
(2 way) to the columns I want to view (& edit) in the dataset, while two of
the buttons are for stepping up & down through the collection ( < & > ),
while the third button takes me to the end of the dataset and adds a new row
for editing ( >* ).

The whole arrangement is very much like an MS access form, with the stepping
through records control at the bottom.

My questions:

1) When I edit an entry via the textboxes, the new data does not load into
the dataset until I use one of the buttons to select another entry. Is there
a nice way to make the data enter the database at the same time as it's been
typed. Code for the databindings is:-

textBox1.DataBindings.Add("Text",dataSet1.Tables["ianpets"] ,"PetName");
textBox2.DataBindings.Add("Text",dataSet1.Tables["ianpets"] ,"PetType");

At the moment this is a pain cause if I forget to switch entries before
saving the database (especially after creating a new entry), I lose the data
and get a row of null entries in the db.
2) When I create a new entry at the end of the list (using the >* button),
if I then change my mind and step back an entry without having entered
anything into the newly created row, I would like it to disappear. I
currently do this using the dataRow.IsNull method for each entry in the row,
to check that nothing's been entered.

This is ok for small rows, but I'd like to know if there's a neater way of
doing it.

I should also mention that there is an autonumber column if that makes any
difference.

Thanks

Phil D
Nov 15 '05 #1
0 912

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

Similar topics

45
by: cody | last post by:
I've seen an Introduction on ADO.NET with its Datasets on .NET TV and Iam now wondering how it is realized/used in real world applications. I don't believe that one would create a dataset and add...
2
by: malcolm | last post by:
Hello, We have a robust (.NET 1.1 c# winforms) client-server application that utilizes many typed DataSets, typed DataTables and typed DataRows. Our application is a series of windows and popup...
3
by: John Bailey | last post by:
When I first built a few web pages in ASP .Net 2.0, I thought it was great. The formview and detailview contorls would automatically layout the controls for you, the update methods were...
8
by: GaryDean | last post by:
We have been noticing that questions on vs.2005/2.0 don't appear to get much in answers so I'm reposting some questions posted by some of the programmers here in our organization that never got...
4
by: Frank | last post by:
Hello, Developing an app where the user fills out a sometimes quite lengthy form of chkboxes, txtboxes, radbtns, etc. User responses are saved to a mySql db, which the user can later edit. When...
3
by: cj | last post by:
I've used datatables and datasets before. Datasets being able to hold more than one table and datatables being only one table. My mind keeps coming up with recordsets. I can't remember how they...
11
by: John J. Hughes II | last post by:
I have a DataGridView displaying data from a DataSet. To the right of that I have a custom user control which displays one of the data set fields. The custom user control is bound to the data set...
4
by: Ronald S. Cook | last post by:
I've always used untyped datasets. In a Microsoft course, it walks through creating typed datasets and harps on the benefits. It has you drag all these things around ..wizard, wizard, wizard......
3
by: sonymathur | last post by:
I'm using two datasets DS1 & DS2 (both hold data with same schema) in VB.Net 1.1 DS1 is main datasets and DS2 is like subset to DS1.Now how should i remove datarows from DS1 that are like in DS2....
5
by: Anil Gupte | last post by:
How can I manipulate Datasets, such as getting a specific row based on a key column value. Of course, I could loop through all the rows in the entire dataset each time I needed something, but is...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
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
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...
0
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
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,...
0
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...

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.