How to make a view like this ?

M

Mika M

Hello!

I'm wondering how to do something like this.

In database is for example 'QualityClasses'-table containing columns
(fields) 'ID' which is primary key (Data Type=int), and 'QualityClass' (Data
Type=varchar).

I want to make a windows form containing grid with the following view ...

| Quality | Qty |
| A-Class | 110 |
| B-Class | 8 |
| Faulty | 2 |

.... in this view all 'Quality'-column qualities should be filled
automatically of the 'QualityClasses'-table, and it's not possible to add
new row or delete existing row - only edit quantities.

When user enter quantities, only those rows containing quantities should be
saved into an other table which contains fields, 'QualityID' which is
related ID for Quality of the 'QualityClasses'-table (child key Data
Type=int), and Qty (Data Type=int), and WorkID (Data Type=int) to specify
what work is reported.

View like this should be possible to retrieve containing quantities when
needed.

Is this possible to do using bound DataTable, DataView or something like
that?
 
R

Rajesh Patel

Of course, it is possible.

make select statement in query analyser as you want your data and configure
your dataadapter with that select statement.

bind grid with dataview. dataview allows you to stop adding and removing
rows with allownew and allowdelete property.

and, make your updatestatement and put into 'updatecommand' of dataadapter.

These are just steps/overview.

Hope this helps

Rajesh Patel
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top