
Signature
Mark Rae
ASP.NET MVP
http://www.markrae.net
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...
Can you understand me ?
Thanks
>> 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...
Mark Rae [MVP] - 07 Aug 2007 13:47 GMT
> 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:
[quoted text clipped - 4 lines]
>
> I need only: 06/08/2007 (dd/mm/aaaa) the Brasil format...
Text.text = reader['SomeField'].ToString("dd/mm/aaaa");

Signature
Mark Rae
ASP.NET MVP
http://www.markrae.net
Paulo - 07 Aug 2007 14:04 GMT
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\
>> 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:
[quoted text clipped - 6 lines]
>
> Text.text = reader['SomeField'].ToString("dd/mm/aaaa");
George Ter-Saakov - 07 Aug 2007 15:26 GMT
You got to cast ot DateTime first
Text.text = ((DateTime)reader['SomeField']).ToString("dd/mm/aaaa");
George
> Error 2 No overload for method 'ToString' takes '1' arguments C:\Documents
> and Settings\SUPORTE\Meus documentos\Visual Studio
[quoted text clipped - 10 lines]
>>
>> Text.text = reader['SomeField'].ToString("dd/mm/aaaa");
Mark Rae [MVP] - 07 Aug 2007 16:38 GMT
> You got to cast ot DateTime first
> Text.text = ((DateTime)reader['SomeField']).ToString("dd/mm/aaaa");
D'oh! Apologies, everybody... :-(

Signature
Mark Rae
ASP.NET MVP
http://www.markrae.net