471,073 Members | 1,367 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 471,073 software developers and data experts.

datagridboolcolumn and sql server

I have a problem with a datagridboolcolumn that drives me almost
crazy.

I have a sql server table with several columns of which one is a
column called ok which is a bit with default value 0. In a datagrid
that shows several columns of the table (with datagridtextboxcolumns)
I also included a datagridboolcolumn with true-value 'true' and
false-value 'false' and allownull=false. I had the sqldataadapter made
the dataset that is used for this datagrid. The DataSet has (when I
look into the xml-schema) a type for this ok-column boolean.
But it doesn't work. When running the application I can change the
column (which permanently shows the grey-null-state), but it
immediately changes back to its grey-null-state. When saving to the
database the value in the database is changed, but it never reappears
in my dataset.

What am I doing wrong. I searched a lot of sites, but didn't find the
answer yet.

Erald Kulk
Nov 15 '05 #1
1 1586
Hi,

Two suggestions:

1. Design a typed dataset up front and populate it with the data adapter;
2. Inherit from the DataGridBoolColumn and override GetColumnValueAtRow and
SetColumnValueAtRow methods. Examine what is returned by the inherited
implementation, and you might get a better understanding of what is going
wrong.

--
Dmitriy Lapshin [C# / .NET MVP]
X-Unity Test Studio
http://x-unity.miik.com.ua/teststudio.aspx
Bring the power of unit testing to VS .NET IDE

"Erald Kulk" <er***@delta-travel.nl> wrote in message
news:d9**************************@posting.google.c om...
I have a problem with a datagridboolcolumn that drives me almost
crazy.

I have a sql server table with several columns of which one is a
column called ok which is a bit with default value 0. In a datagrid
that shows several columns of the table (with datagridtextboxcolumns)
I also included a datagridboolcolumn with true-value 'true' and
false-value 'false' and allownull=false. I had the sqldataadapter made
the dataset that is used for this datagrid. The DataSet has (when I
look into the xml-schema) a type for this ok-column boolean.
But it doesn't work. When running the application I can change the
column (which permanently shows the grey-null-state), but it
immediately changes back to its grey-null-state. When saving to the
database the value in the database is changed, but it never reappears
in my dataset.

What am I doing wrong. I searched a lot of sites, but didn't find the
answer yet.

Erald Kulk


Nov 15 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

reply views Thread by subT | last post: by
4 posts views Thread by Ubi | last post: by
2 posts views Thread by James Goodman | last post: by
2 posts views Thread by nate axtell | last post: by
1 post views Thread by B.J. Raiford | last post: by
reply views Thread by Ryan Liu | last post: by
reply views Thread by Brett Romero | last post: by

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.