Dim Conn As SqlConnection = New SqlConnection(My.Settings.MyConnection.ToString)
Private Sub LoadToDataGridView()
Dim Comm As New SqlCommand
Dim dat As New SqlDataAdapter
Dim dt As New DataTable
Dim strSQL As String = Nothing
strSQL = "Select * From MyTable Where MyDate Between @sDate AND @eDate "
With Comm
.Parameters.Clear
.Parameters.Add("@sDate", SqlDbType.Date).Value = DateTimePicker1.Value
.Parameters.Add("@eDate", SqlDbType.Date).Value = DateTimePicker2.Value
.Connection = Conn
.CommandText = strSQL
.CommandType = CommandType.Text
End With
dat.SelectCommand = Comm
dat.Fill(dt)
Conn.Close()
DataGridView1.DataSource = dt
End Sub
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
LoadToDataGridView()
End Sub
'Imports System.Text.RegularExpressions
Dim Thanks As String = New Regex("[0-9]").Replace("ฟ12435ฟห", New MatchEvaluator(Function(s) As String
Return {"๐", "๑", "๒", "๓", "๔", "๕", "๖", "๗", "๘", "๙"}(Integer.Parse(s.Value))
End Function))