convert date to string ?

H

harshad taylor

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.
 
H

Herfried K. Wagner [MVP]

* harshad taylor said:
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.

Have a look at its 'ToString' method.
 
A

Armin Zingler

harshad taylor said:
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.

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top