Parsing date from sql string in asp.net, then comparing it with present date

N

.Net Sports

I need to parse the date I'm getting from this sqlstring to compare it
with today's date. If it's before today's date, i need to show the
viewers one page. If it is after today's date, then I need to show
viewers another page.
''''''''
Dim strConn2 as string
="SERVER=xxx.xx.xx.x;UID=xxxx;­PWD=xxxx;DATABASE=mydbase;"
Dim strSQL2 as string ="SELECT
articledate,articleheader,arti­cleID
FROM media WHERE author = 99 AND articledate =(SELECT MAX(articledate)
FROM media WHERE handid = 99)"
Dim Conn2 as New SQLConnection(strConn2)
Dim Cmd2 as New SQLCommand(strSQL2,Conn2)
Conn2.Open()
thedata2.DataSource =
Cmd2.ExecuteReader(system.data­.CommandBehavior.CloseConnecti­on)
thedata2.DataBind()
end sub
''''''''


but I'm stuck as how to use the articledate from this resultset for the

comparison.
??????
..NetSports
 

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