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

Top 5 Contributors of the Month

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

Read a particular record with the help of datetimepicker value

Posted By: srini     Posted Date: December 16, 2010    Points:2   Category :VB.Net

I am doing Attendance Management application using vb.net and sql server 2005. Having fields like EmpID,EmpName,Designation,TimeIn, TimeOut and TotalHoursWorked.

Now, i need to give only EmpID and select the date(Format: mm/dd/yyyy) from DateTimePicker control,then select "Show" button.

It must show all the remaining details of an particular employee on the respective date.

For example,Date:12/15/2010(mm/dd/yyyy) and EmpID:e01,it must show Name,Desig,TimeIN,TimeOut,TotalHrs.(remaining details)-Yesterday Details

Likewise,Date:12/16/2010(mm/dd/yyyy) and EmpID:e01,it must show Name,Desig,TimeIN,TimeOut,TotalHrs.(remaining details)for the current day details.

Author: Syed Shakeer Hussain             
Posted Date: December 18, 2010     Points: 5   


You have to write a SqlQuery as follows

SqlCommand cmd=new SqlCommande("Select Name,Desig,TimeIN,TimeOut,TotalHrs from TableName WHERE EmpID='"+txtBoxEmpID.Text+"' AND Date='"+DateTimePicker1.SelectedDate+"'",conn); 

Convert the above code in VB.Use the SqlQuery as Same...It works

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