1 Replies - 4125 Views - Last Post: 29 December 2007 - 06:20 PM Rate Topic: -----

#1 oldgolfer  Icon User is offline

  • New D.I.C Head

Reputation: 2
  • View blog
  • Posts: 21
  • Joined: 13-November 06

search database with listbox.selecteditem

Post icon  Posted 29 December 2007 - 02:20 AM

My problem is I can search database for rows matching date column with this code:-
drCurrent2 = HunterPlayerdatabaseDataSet.Dates.Select("DateofGame = '" & DateTimePicker1.Text & "'")

but I want to use a listbox which is filled from a database which is filled from DateTimePicker I tried this code but cannot get it to work
drCurrent = HunterPlayerdatabaseDataSet.GameStats.Select("GameDate = '" & ListBox1.SelectedItem & "'")
Thx

Is This A Good Question/Topic? 0
  • +

Replies To: search database with listbox.selecteditem

#2 oldgolfer  Icon User is offline

  • New D.I.C Head

Reputation: 2
  • View blog
  • Posts: 21
  • Joined: 13-November 06

Re: search database with listbox.selecteditem

Posted 29 December 2007 - 06:20 PM

View Postoldgolfer, on 29 Dec, 2007 - 02:20 AM, said:

My problem is I can search database for rows matching date column with this code:-
drCurrent = HunterPlayerdatabaseDataSet.Dates.Select("DateofGame = '" & DateTimePicker1.Text & "'")

but I want to use a listbox which is filled from a database which is filled from DateTimePicker I tried this code but cannot get it to work
drCurrent = HunterPlayerdatabaseDataSet.GameStats.Select("GameDate = '" & ListBox1.SelectedItem & "'")
Thx

Think I have solved my own Prob.
drCurrent = HunterPlayerdatabaseDataSet.Dates.Select("DateofGame = '" & ListBox1.SelectedItem.Item("DateofGame").ToString & "'")

Where "DateofGame" is column name in database :D thx anyway
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1