Connecting Tech Pros Worldwide Help | Site Map

convert date to string ?

harshad taylor
Guest
 
Posts: n/a
#1: Nov 20 '05
hi all. i am a fairly new user of vb .net. i need to know how to convert
the date (possibly to a string maybe)that a user chooses from a
"datetime picker" and take that value into a variable and pass it to an
sql query. it might be something very simple but i dont have a clue.

thanks.



*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
Herfried K. Wagner [MVP]
Guest
 
Posts: n/a
#2: Nov 20 '05

re: convert date to string ?


* harshad taylor <h.taylor@challenge.ngfla.c.uk> scripsit:[color=blue]
> hi all. i am a fairly new user of vb .net. i need to know how to convert
> the date (possibly to a string maybe)that a user chooses from a
> "datetime picker" and take that value into a variable and pass it to an
> sql query. it might be something very simple but i dont have a clue.[/color]

Have a look at its 'ToString' method.

--
Herfried K. Wagner [MVP]
<URL:http://dotnet.mvps.org/>
Armin Zingler
Guest
 
Posts: n/a
#3: Nov 20 '05

re: convert date to string ?


"harshad taylor" <h.taylor@challenge.ngfla.c.uk> schrieb[color=blue]
> hi all. i am a fairly new user of vb .net. i need to know how to
> convert the date (possibly to a string maybe)that a user chooses from
> a "datetime picker" and take that value into a variable and pass it
> to an sql query. it might be something very simple but i dont have a
> clue.[/color]

Have a look at the SQLCommand.Parameters property. If you use it, you won't
need to convert the value on your own.


--
Armin

How to quote and why:
http://www.plig.net/nnq/nquote.html
http://www.netmeister.org/news/learn2quote.html

Closed Thread