P
Paulo
Hi, how can I return just the date from a DateTime field ? Any C# .net 2.0 /
SQL function?
Thanks a lot!
SQL function?
Thanks a lot!
Hi, how can I return just the date from a DateTime field ? Any C# .net 2.0
/ SQL function?
But where do I put the reader['FieldName'] returned from the SQL Server ?
Mark Rae said:But where do I put the reader['FieldName'] returned from the SQL Server ?
You made no mention of a datareader in your original post...
Please explain exactly what you are trying to do...
Sorry my friend, what I need to do is return a DateTime field from SQL
Server 2000 and put it on a text box to the user edit, but when I do:
Text.text = reader['SomeField'].AsString;
shows: 06/08/2007 00:00:00
I need only: 06/08/2007 (dd/mm/aaaa) the Brasil format...
Mark Rae said:Sorry my friend, what I need to do is return a DateTime field from SQL
Server 2000 and put it on a text box to the user edit, but when I do:
Text.text = reader['SomeField'].AsString;
shows: 06/08/2007 00:00:00
I need only: 06/08/2007 (dd/mm/aaaa) the Brasil format...
Text.text = reader['SomeField'].ToString("dd/mm/aaaa");
Paulo said:Error 2 No overload for method 'ToString' takes '1' arguments C:\Documents
and Settings\SUPORTE\Meus documentos\Visual Studio
2005\WebSites\WebSite6\Produto.aspx.cs 275 39 C:\...\WebSite6\
Mark Rae said:Sorry my friend, what I need to do is return a DateTime field from SQL
Server 2000 and put it on a text box to the user edit, but when I do:
Text.text = reader['SomeField'].AsString;
shows: 06/08/2007 00:00:00
I need only: 06/08/2007 (dd/mm/aaaa) the Brasil format...
Text.text = reader['SomeField'].ToString("dd/mm/aaaa");
You got to cast ot DateTime first
Text.text = ((DateTime)reader['SomeField']).ToString("dd/mm/aaaa");