Thanks, Dave. I'll look into that, and yes, it is the DataGridView
control that I am using.
Additionally, and forgive me for the basic question, as I am still
fairly new to ADO.Net, but I have tried accessing the data in my
DataTable before and had little luck. The object model still confounds
me to some extent. Should I drill down into the actual DataTable object
to view the data, or go through the BindingSource? If the DataTable, I
assume it starts at DataSet.DataTable...?
Also, and you can save me another thread here, when referencing that
data, how can I determine which row is current as seleted in that
DataGridView? My assumption was to look into the BindingSource object,
but I have similar questions there as with the DataTable.
Thanks for your time.
Rich
Dave Sexton wrote:
Hi Richard,
I assume you are referring to the DataGridView control?
gridview for some reason sees those columns as having null values or
something.
Check your in-memory DataSet after binding to verify that there is actually data in the appropriate rows/columns by setting a break
point in code, attaching a debugger and viewing the object in a watch window.
I have completely deleted the form and recreated it. I have completely
deleted the dataset and recreated it. Neither had any effect. Each time
I redesigned it, the problem was present.
I suspect that your problem might lie in your data access code. See first if the DataTable to which your DataGridView is bound
contains the appropriate data after binding as I mentioned above.
Does the gridview have issues
with required values?
Not that I'm aware of. Binding to Boolean and DateTime columns with AllowDBNull set to false has always worked in my experience
even when the DataGridView implies the columns from the schema of the data.
Even if it did, shouldn't using a stored
procedure get around that?
No. How the data gets into a DataTable has nothing to do with how the DataGridView handles reading and displaying the data. The
key here is to make sure the data, in memory, is what you expect. If it's not then go from there.
--
Dave Sexton
"Richard Carpenter" <ru*******@hotmail.comwrote in message news:11*********************@m73g2000cwd.googlegro ups.com...
I have a simple winform with a customers combobox, a "get orders"
button and an orders grid. Due to other requirements, I have
implemented the form to allow the user to select a customer from the
combobox and click the "get orders" button to refresh the gridview with
the selected customer's orders, via a GetDataByCustomerID stored
procedure.
The underlying Orders table includes, among others, three boolean
columns and one particular datetime column, all of which are set to NOT
NULL with default values. All of these columns have valid values
specified in the table, yet when I call the stored procedure to refresh
the grid, I get validation errors for those four columns and their data
does not display. The other columns display just fine.
As I mentioned, I'm getting this data from a stored procedure. The
stored procedure *does* return the values for those four columns. The
gridview for some reason sees those columns as having null values or
something.
I have completely deleted the form and recreated it. I have completely
deleted the dataset and recreated it. Neither had any effect. Each time
I redesigned it, the problem was present. Does the gridview have issues
with required values? Even if it did, shouldn't using a stored
procedure get around that?
I'm running out of things to try here. Any advice would be much
appreciated.
Rich