Click here to Skip to main content
15,893,668 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
VB
Dim data1 As String
Dim conn1 As SqlConnection
Dim cmd1 As New SqlCommand><<
Dim ada1 As New SqlDataAdapter()
Dim ds1 As New DataSet

data1 = lbldmdate.Text.ToString()
conn1 = New SqlConnection("Persist Security Info=false;User Id=justin;Data Source=ARULJUSTIN\SQLEXPRESS;Initial Catalog=firemaintain;Integrated Security=True;Pooling=False")
conn1.Open()
ada1 = New SqlDataAdapter("select Recordno, uhnumber,uhbuilding,uhlocation from hydrantmaintain WHERE unndate= '" & Today.ToString("dd/mm/yyyy") & "'", conn)

ada1.Fill(ds1)
dgnxtmdates.DataSource = ds1.Tables(0)
Posted

Try modifying the Query like given below -
VB
"select Recordno, uhnumber,uhbuilding,uhlocation from hydrantmaintain WHERE CONVERT(DATE,unndate)= '" & Today.ToString("yyyy-MM-dd") & "'"
 
Share this answer
 
Comments
Justin Arokiaraj 22-Oct-13 0:21am    
thank your for the solution
"select Recordno, uhnumber,uhbuilding,uhlocation from hydrantmaintain WHERE CONVERT(DATE,unndate)= '" & Today.Day & "'"

You can try this .

I Hope this will help you.
 
Share this answer
 
Comments
Justin Arokiaraj 22-Oct-13 0:21am    
Your query did work but needed to add to string for conversion thank you

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900