.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Win Surprise Gifts!!!

Top 5 Contributors of the Month
Sharon Maxwell

Home >> Forum >> VB.Net >> Post New QuestionBookmark and Share Subscribe to Forum

Want to select the record by Date from Dataset in VB.net

Posted By: Dhiraj     Posted Date: May 13, 2011    Points:5   Category :VB.Net
Hi all,

I have a dataset, which have a column create_date which have value(5/12/2011 12.54.00) , but i want to select the value from dataset with date only not by time (i.e. 5/12/2011),

Current code:
oDatatable.Select("create_date = " & cDate(Now.date))
But it will only selecting row if the data and time both are same, but i want to select if the data is same.

Please give a solution for this,


Author: Dhiraj Ranka             
Posted Date: May 15, 2011     Points: 20   


You can cast the column create_date while querying the same. So that it will only contain the date part and not the time.

Hope this helps

Hope this helps.

Thanks & Regards,
Dhiraj Ranka
http://www.twitter.com/dhirajranka | http://www.dhirajranka.com
Author: Maverick             
Posted Date: May 17, 2011     Points: 20   


Use this
ur date value i.e ds.tables[0]["Date"].toshortdate()

Hope it helps


Post Reply

You must Sign In To post reply
Find more Forum Questions on C#, ASP.Net, Vb.Net, SQL Server and more Here
Quick Links For Forum Categories:
ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  OOPs  SilverlightIISJQuery

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend