我的不完全代码
Dim dr As DataRowDim i As Integer = Ds21.szb.Rows.Count - 1
If RadioButton1.Checked Then
SqlDataAdapter1. = "select * from SZb where 收支类型=" & ComboBox1.Text Or " where 收支时间 = & DateTimePicker1.Text" Or "where 收支金额 =& TextBox1.text" Or "where 备 注 =& TextBox2.text"
ElseIf RadioButton2.Checked Then
SqlDataAdapter1. = "select * from SZb where 收支类型 like '" & ComboBox1.Text.Trim & "%'" Or "where 收支时间 like " & DateTimePicker1.Text.Trim & "%'" Or "where 收支金额 like " & TextBox1.Text.Trim & "%'" Or "where 备注 like " & TextBox2.Text.Trim & "%'"
End If
dr = Ds21.szb.NewRow()
dr.Item(1) = "a"
dr.Item(2) = "b"
dr.Item(3) = "c"
Ds21.szb.Rows.Add(dr)
SqlDataAdapter1.Update(Ds21.szb)
End Sub