C
ccshine via DotNetMonster.com
I'm creating a winform application that implements a datagrid to display a
daily inventory for chemicals. If there is already data for a particular day,
that day's info will display in the grid. Otherwise, I want to just display
the list of all chemicals that are not marked as discontinued in the Access
database so that the user can enter that day's inventory count.
There are 2 database tables for this portion of the app. The chemicals table
contains... you guessed it - chemical information, and the dailyInventory
table contains the fk to chemicals and daily inventory counts for each
chemical.
My first approach to create the datagrid as described was to use a select
statement that populated a dataset and bind the dataset to the datagrid. I
tried several different join statements to accomplish this, but nothing
seemed to work the way I wanted it to. If there wasn't any data for a
particular day, the closest I could get was to display all the chemicals but
some of them had information from previous dates and others contained <null>.
So then I thought perhaps I should use a dataset from another screen to
populate the datagrid with the list of chemicals. However, I don't want to
bind that dataset to the grid since the data needs to go to dailyInventory
and not just chemicals.
Have I just missed the boat on the select and rowfilter statements or should
I use the second dataset instead? If I should use the second dataset, how do
I add items to the datagrid without binding it?
daily inventory for chemicals. If there is already data for a particular day,
that day's info will display in the grid. Otherwise, I want to just display
the list of all chemicals that are not marked as discontinued in the Access
database so that the user can enter that day's inventory count.
There are 2 database tables for this portion of the app. The chemicals table
contains... you guessed it - chemical information, and the dailyInventory
table contains the fk to chemicals and daily inventory counts for each
chemical.
My first approach to create the datagrid as described was to use a select
statement that populated a dataset and bind the dataset to the datagrid. I
tried several different join statements to accomplish this, but nothing
seemed to work the way I wanted it to. If there wasn't any data for a
particular day, the closest I could get was to display all the chemicals but
some of them had information from previous dates and others contained <null>.
So then I thought perhaps I should use a dataset from another screen to
populate the datagrid with the list of chemicals. However, I don't want to
bind that dataset to the grid since the data needs to go to dailyInventory
and not just chemicals.
Have I just missed the boat on the select and rowfilter statements or should
I use the second dataset instead? If I should use the second dataset, how do
I add items to the datagrid without binding it?