Dim a As DateTime
a = Now
vconn = New OleDbConnection("provider=microsoft.jet.oledb.4.0;data source=c:\friends.mdb")
vconn.Open()
vadapter = New OleDbDataAdapter("select * from birthdays", vconn)
vdataset = New DataSet
vadapter.Fill(vdataset, "birthdays")
vdatatable = vdataset.Tables(0)
Dim x As Integer
Dim y As Integer = 0
For x = 0 To vdatatable.Rows.Count - 1
If DatePart("m", vdatatable.Rows(x).Item(2)) = Now.Month Then
ListView1.Items.Add(vdatatable.Rows(x).Item(1))
ListView1.Items(y).SubItems.Add(vdatatable.Rows(x).Item(2))
ListView1.Items(y).SubItems.Add(vdatatable.Rows(x).Item(3))
ListView1.GridLines = True
y += 1
End If
Next
Wednesday, March 19, 2008
Sunday, March 16, 2008
autosuggest & data binding
dim oproducts as new autocompletestringcollection
for each product as productdataset.productrow in me. productdataset.product
if product.name.startswith("O") then
oproducts.add (product.name)
end if
me.combobox.autocompletecustomsource= oproducts
for each product as productdataset.productrow in me. productdataset.product
if product.name.startswith("O") then
oproducts.add (product.name)
end if
me.combobox.autocompletecustomsource= oproducts