Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Dim cn As New OleDb.OleDbConnection
- cn.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=|DataDirectory|\Firebird.mdb"
- cn.Open()
- Dim dt1 As DateTime = DateTimePicker1.Value.Date
- Dim dt2 As DateTime = DateTimePicker2.Value.Date
- 'MsgBox(dt1)
- Try
- MsgBox(dt1 + " " + dt2)
- Dim cmd As OleDbCommand
- Dim dt As DataTable
- Dim Da As OleDbDataAdapter
- With Cmd
- .CommandType = CommandType.Text
- .CommandText = "select * FROM OS where data between @datainicial AND @datafinal"
- .Parameters.AddWithValue("@datainicial", dt1)
- .Parameters.AddWithValue("@datafinal", dt2)
- .Connection = cn
- End With
- With OSTableAdapter.Adapter
- .SelectCommand = cmd
- dt = New DataTable
- .Fill(dt)
- OSDataGridView.DataSource = dt
- End With
- cn.Close()
- Catch ex As Exception
- MsgBox(ex.Message)
- End Try
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement