1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18
|
Try
maConnexion = New SqlConnection
maConnexion.ConnectionString = "Data Source=APPLICATIONS;Initial Catalog=DBTest;User ID=ii;Password=pp"
strSql = "select * from MaTable where Date between '" & date1 & "' and '" & dateé & "'"
maConnexion.Open()
myCommand = New SqlCommand(strSql, maConnexion)
myDataAdapter = New SqlDataAdapter(myCommand)
myCommand.Connection = maConnexion
myDataAdapter.Fill(myDataSet, "MaTable")
myDataTable = myDataSet.Tables("MaTable")
Catch ex As SqlException
MessageBox.Show(ex.Message)
End Try
Me.DataGridView1.DataSource = myDataTable |
Partager