[Gambas-user] Grid View and Mysql Result, Time Data

Demosthenes Koptsis demosthenesk at ...626...
Thu Sep 17 18:55:24 CEST 2009


I have a gridview control and i fill it with values from a mysql
$RESULT with the next code

PUBLIC SUB grdView_Data(Row AS Integer, Column AS Integer)

  $Result.MoveTo(Row)

  grdView.Data.Text = Str($Result[grdView.Columns[Column].Text])

END


The problem now.
When value is Date with mysql format %Y-%m-%d
the gridview shows "00:00:00" instead "0000:00:00" when the value of
result is empty
and change the format to %m/%d/%Y.


For example see col4 which holds dates

mysql> SELECT * FROM `table4`;
+------+------+------+------------+
| col1 | col2 | col3 | col4       |
+------+------+------+------------+
|    1 |   11 |  111 | 2008-09-24 |  <- %Y-%m-%d
|    2 |   22 |  222 | 0000-00-00 |
+------+------+------+------------+
2 rows in set (0.00 sec)

And gridview shows

09/24/08

Why is this? Normally the gridview must get the string " 2008-09-24"

-- 

Γεια χαρα σε όλους!!!

Regards,

Demosthenes Koptsis




More information about the User mailing list