blah blah blah is here! blah blah » Close

up0down
link

Hi

I'm doing a winform application in VS2008 with a sql database, and I have 2 questions.
First question is, is it possible to populate a listbox direct from a databinding? It doesn't work for me the way I'm doing it.
Code sample here:

myListBox.Items.Add(kundtabellTableAdapter.FillByKunder(remboDataSet.Kundtabell));

My second question is, if I write my code as below then I will not get a match even if my date is correct cause the time doesn't match. How can I solve it?
SELECT * FROM Kundtabell WHERE (Date = GETDATE())
ORDER BY Name


I would be very greatful if someone could help me with this.

last answered one year ago

1 answers

up0down
link

You can use:
ex.
DB Table Kundtabell

ID Name Date

SELECT * FROM Kundtabell WHERE DATE(Kundtabell.Date) = DATE(NOW())
ORDER BY Name


or if you want to find a specific date:

DATE(Kundtabell.Date) = DATE('2010-03-14')

Hi and thank you, but I only get a error message when I try to implement your code sample...

can you show some code?

Feedback