473,386 Members | 1,832 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,386 software developers and data experts.

enter data for master table, hard question

HS1
Hello all

- I have a master and a details table presented in two datagrid
- I also have some text boxes that present the values from any record in the
master table. This also helps to enter new data for the master table.

I also have a Add button to add new data
Me.BindingContext(masterGrid.DataSource, "masterTable").AddNew()
The master and details tables work well. When I click Add new button, a new,
empty record is presented in master table. Then I can enter data in the text
boxes (or in the master table)

However, the details table still presents the old data (the old data of a
master record).

What I want is that when I click Add new record for the master table, the
detail table will be empty so that I can enter new values.

Could you please help
Thanks

Nov 21 '05 #1
1 1547
This is not the way to do it.

Your master and details grid are bound to the underlying data, you need only
to add to the underlying table to have the data reflected in the grid
because the dataGrid will receive an event to tell it to update its disply.

so In Pseduo, soemthing like

Create DataRow
Create Columns Of Data From text Boxes
Add Row to Underlying Table
' call dataAdapter method if appropriate at this stage

HTH

--
OHM ( Terry Burns ) * Use the following to email me *

Dim ch() As Char = "ufssz/cvsotAhsfbuTpmvujpotXjui/OFU".ToCharArray()
For i As Int32 = 0 To ch.Length - 1
ch(i) = Convert.ToChar(Convert.ToInt16(ch(i)) - 1)
Next
Process.Start("mailto:" & New String(ch))
--
"HS1" <so*@slingshot.co.nz> wrote in message
news:1098146658.391533@ftpsrv1...
Hello all

- I have a master and a details table presented in two datagrid
- I also have some text boxes that present the values from any record in
the
master table. This also helps to enter new data for the master table.

I also have a Add button to add new data
Me.BindingContext(masterGrid.DataSource, "masterTable").AddNew()
The master and details tables work well. When I click Add new button, a
new,
empty record is presented in master table. Then I can enter data in the
text
boxes (or in the master table)

However, the details table still presents the old data (the old data of a
master record).

What I want is that when I click Add new record for the master table, the
detail table will be empty so that I can enter new values.

Could you please help
Thanks

Nov 21 '05 #2

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

Similar topics

5
by: Tim | last post by:
I've been working on this for over a week now, and just can't get this figured out. Hoping one of you gurus can help me out here. I have an xml data island that I'm representing on an htm page as...
1
by: Anna Warloe | last post by:
This might be a dumb question, but I am pretty new to Access.... I am trying to write code in Access to take river forecasts which are delivered as attachments in emails and append the data into...
6
by: Innuendo | last post by:
Hello, I'm not a specialist with Access - so I hope that you can give me some input. I've to import xml data (about 15 different data fields) into an access-database each night. As scripting...
0
by: HS1 | last post by:
Hello I created a master and a detail table using 2 dataGrids for Client and Jobs tables with a relationship With the detail grid, I create some textboxes to present a record of Jobs table...
9
by: Brad | last post by:
I have written some code to manipulate data/records in a MASTER (order header) and DETAIL (order details) tables. What I have written is too extensive to post but essentially trying to: 1....
3
by: jpr | last post by:
Hello, I know that this is not the rule but need some help. My datbase has three tables: MASTER TEMPLATES FORMS I have a form which is based on a table named MASTER. I have a primary key...
4
by: jrett | last post by:
I'm new to ASP.NET and fairly inexperienced with web development in general, but I've been a professional software dev for over 10 years, C++, Unix and windows, C# the past 4 years. I've been...
3
by: zacaronius | last post by:
Hi, I am working on a database that was built for our operation, but the only problem is that it has almost 2.6 million records in a table, so it takes forever to run a report. I was wondering if...
5
by: Dakrat | last post by:
Allow me to preface this post by saying that this is my first database project, and while I have learned a lot, any concepts I have learned are hit and miss as I have found new requirements and...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
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
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
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,...

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.