I'm selecting value from my database, passing it to datatable then giving DataGridView.DataSource value of datatable.
The thing is that in those rows i'm also selecting some dates and problem is that my default date in database is '1900-01-01 00:00:00' because i use "smalldatetime".
And what i want is this...when I find default value in database i want to show it like an empty string, like i said...because date is in smalldatetime format i can't do this in SQL query so i wonder how can I change this in DataTable or even better in DataGridView...of course, in code? Thanks...
Peric
Recommended Answers
Jump to PostYou can set the datetime column of the datatable to allow nulls but it wont accept blank strings. However I suggest that leaving a default date is good practice, filtering such as in a where clause on or against null values prevents the benefits of table indexing.
All 4 Replies
Reply to this topic
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.