它使用1個參數(i_index),但如果我也使用i_datum,則會出現如下錯誤:「從字符串」park_id = 100「轉換爲鍵入」Long「無效。是否可以在dataview.rowfilter中使用2個參數?怎麼樣?
Public Function detail_kalender(ByVal i_index As Int16, ByVal i_datum As Date) As DataRowView
Dim dv As DataView
Dim anyrow As DataRowView
dv = New DataView
With dv
.Table = myds.Tables("kalender")
.AllowDelete = True
.AllowEdit = True
.AllowNew = True
.RowFilter = "park_id = " & i_index And "datum =" & i_datum
End With
anyrow = dv.Item(0) 'geeft de eerste rij van de dataview dv
' Simple bind to a TextBox control
dv = mydt_parken.DefaultView
Return anyrow
dv.Dispose()
dv = Nothing
End Function
你是什麼'i_'前綴的意義是什麼? – 2011-05-24 14:47:21
如果類型是整數,我通常使用i! – Rachid 2011-05-25 09:23:30
那你爲什麼在i_datum上使用它? – Smudge202 2011-05-25 10:02:55