borderAndreaVB free resources for Visual Basic developersborder

borderAndreaVB Visual Basic and VB.NET source code resources - Copyright © 1999-2007 Andrea Tincaniborder

AndreaVB | Forum | News | Downloads | Register | Help | Member List | Statistics | Search | PM | Profile

Print This Topic
Previous Topic (how to get the access level of a folder in a machine or in LAN???)Next Topic (dataset will not fill) New Topic New Poll Post Reply
AndreaVB Forum : VB.Net : want to show some entry from database in datagrid thuroug user difine date Solved Topic
Poster Message
tanmoy
Level: Whizz Kid

Registered: 17-03-2006
Posts: 18

icon want to show some entry from database in datagrid thuroug user difine date

hello every one.i have a problem.i want to see som entry from database in datagrid as per date.the date is given by user.and the field of database table is a 'date' type field.i use this coding but this is worked on 'text' type field.i want to see data from 'date' type field.i give u my coding in below.

Dim seldat As New OleDb.OleDbDataAdapter()
            pm.TextBox2.Text = pm.DateTimePicker1.Value
            Dim inv As String
            inv = "select * from payment where Dat='" & pm.TextBox2.Text & "'"
            seldat.SelectCommand = New OleDb.OleDbCommand(inv, con)
            ds.Tables("payment").Clear()
            seldat.Fill(ds, "payment")
            pm.DataGrid1.DataSource = ds.Tables("payment")

here "payment" is my table name.and "Dat" is my date tyfe field name.please help me.thank you.

____________________________
ambarish sadhu

13-04-2006 at 03:55 PM
View Profile Send Email to User Show All Posts | Quote Reply
Goran
Level: Moderator

Registered: 16-05-2002
Posts: 1681
icon Re: want to show some entry from database in datagrid thuroug user difine date

Try using #date# instead of 'date'...

____________________________
If you find the answer helpful, please mark this topic as solved.

14-04-2006 at 12:09 AM
View Profile Send Email to User Show All Posts | Quote Reply
sicononos
Level: Trainee

Registered: 20-08-2006
Posts: 1
icon Re: want to show some entry from database in datagrid thuroug user difine date

replace this

inv = "select * from payment where Dat=#" &  pm.TextBox2.Text & "#"


____________________________
El masry

20-08-2006 at 03:26 PM
View Profile Send Email to User Show All Posts | Quote Reply
AndreaVB Forum : VB.Net : want to show some entry from database in datagrid thuroug user difine date Solved Topic
Previous Topic (how to get the access level of a folder in a machine or in LAN???)Next Topic (dataset will not fill) New Topic New Poll Post Reply
Surf To:


Not Logged In? Username: Password: Lost your password?
Partners: Download Actual Software | Free Software Download
borderAndreaVB free resources for Visual Basic developersborder

borderAndreaVB Visual Basic and VB.NET source code resources - Copyright © 1999-2007 Andrea Tincaniborder