VS2005, C#, DataBinding of SqlServer 2K TimeStamp datatype

E

ESmith

Newbie Warning!

There, out with the full disclosure.

I have a datatable with a variable "CreationDate" of type TimeStamp.

I'm trying to learning Data Binding, when I drag the table onto my Windows
Form (2.0) and try to compile, I get an error about incompatible type
conversions.

What I want to happen is to have the TimeStamp displayed as a Date on my
form (read-only, not updateable).
How do I need to configure the databinding so that a TimeStamp (byte[]) is
converted properly?

TIA
 
G

Guest

SQL Server Timestamps are not dates, no matter how you slice them. They are
an internal structure that guarantee a changed row is flagged:
http://www.sqlteam.com/item.asp?ItemID=1410

If you want a date, redesign to be a date (or add an additional date column).

--
Gregory A. Beamer
MVP; MCP: +I, SE, SD, DBA

***************************
Think Outside the Box!
***************************
 
W

William \(Bill\) Vaughn

IMHO there is a bug in the way that data columns are bound and managed in
the DataGridView... Yes, a TimeStamp isn't really a time (it used to be in
ages past) but it (along with other binary datatypes) aren't handled
correctly in the DataGridView. You'll need to hide the column (users should
never see or set this) or handle the DataError event...

hth

--
____________________________________
William (Bill) Vaughn
Author, Mentor, Consultant
Microsoft MVP
INETA Speaker
www.betav.com/blog/billva
www.betav.com
Please reply only to the newsgroup so that others can benefit.
This posting is provided "AS IS" with no warranties, and confers no rights.
__________________________________
 

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