Sub CH_Serial_No()
Dim xx As Boolean = False
Try
Dim c_row As Integer = 0
Dim i As Integer
Dim add As Double = 0
Dim sql As String = ""
Dim conn2 As New SqlConnection _
(M_ConnStr.strConn)
Dim Command_Adp2 As SqlCommand
Dim Sql_Reader As SqlDataReader
sql = "SELECT * FROM tv_Bill where Serial_No = '" & TextBox13.Text & "' "
conn2.Open()
Command_Adp2 = New SqlCommand(sql, conn2)
Sql_Reader = Command_Adp2.ExecuteReader()
If Sql_Reader.Read() Then
If Sql_Reader.Item("Pro_name").ToString() <> "" Then
Sql_Reader.Item("Pro_name").ToString()
TextBox12.Text = Sql_Reader.Item("Brand_name").ToString()
txt_Name_pro.Text = Sql_Reader.Item("Pro_name").ToString()
TextBox2.Text = Sql_Reader.Item("Date_Month").ToString()
DateTimePicker1.Visible = True
DateTimePicker2.Visible = True
DateTimePicker1.Value = CDate(Sql_Reader.Item("OderCus_ProDate").ToString())
DateTimePicker2.Value = (บรรทัดนี้คือค่าของ TextBox1.Text + TextBox2.Text เขียนไม่ถูก)
TextBox1.Text = DateTimePicker1.Text
TextBox3.Text = DateTimePicker2.Text
Else
MessageBox.Show("ไม่พบ Serial_No ")
TextBox12.Text = ""
txt_Name_pro.Text = ""
TextBox2.Text = ""
TextBox7.Text = ""
TextBox1.Text = ""
TextBox3.Text = ""
TextBox5.Text = ""
TextBox13.Focus()
End If