I can't give you a step by step solution, but maybe this will help.
It sounds like you have a database that contains customer and invoice
information. That information is related. You would like to display the
invoice and other data in a friendly, useful way.
You don't need to add a a column to the Invoice table to show a customer
name. The Invoice table probably has a foreign key to Customer. Use a
SQL statement to relate them. Something like this:
Select invoice.total, customer.name from customer, invoice where
invoice.invCstID = customer.ID
Now display the results of the query. In this example the WinForm would
display two columns, Invoice total and Customer name. your
code will be more complex.
The data returned could be a DataSet, which would easily bind to a
DataGrid. Read about System.Data classes.
Correct me if I misunderstood the question.
Message
From: CSharpNET (AT) yahoogroups (DOT) com [mailto:CSharpNET (AT) yahoogroups (DOT) com]
Behalf Gies,Brad
Sent: Friday, July 22, 2005 7:42 AM
To: CSharpNET (AT) yahoogroups (DOT) com
Subject: [C#.NET] Lookup field in dataset
Can anyone tell me step by step what I need to accomplish the following
for a Windows Forms application?
We bring in several lookup tables that our application relies on
specifically a Customer table.
We then bring in our Invoices which have a field (invCstID) which
contains the ID number of the customer.
We would like to show the Customer name in our grid, but do it by adding
a new field to the Invoice table and updating it with the Customer
name.
Can anyone tell me how to do this in code?
Sincerely,
Brad Gies
NLM Software
Southfield, MI, USA
Yahoo! Groups Links
Visit our Internet site at http://www.reuters.com
To find out more about Reuters Products and Services visit
Any views expressed in this message are those of the individual
sender, except where the sender specifically states them to be
the views of Reuters Ltd.
Yahoo! Groups Links
<*To visit your group on the web, go to:
<*To unsubscribe from this group, send an email to:
CSharpNET-unsubscribe (AT) yahoogroups (DOT) com
<*Your use of Yahoo! Groups is subject to: