connectionString = "Data Source=NAN-PC\SQLEXPRESS; Initial Catalog=Info_Reserve; Integrated Security=True" connection = New SqlConnection(connectionString) connection.Open() If Form7.cboCategories.SelectedItem = "ข้อมูลผู้เช่า" Then If Form7.cboSub.SelectedItem = "ชื่อผู้เช่า" Then strAdd = "SELECT * FROM Info_Customer WHERE Rent_Name = '" & keep_Search & "' " ElseIf Form7.cboSub.SelectedItem = "ชื่อร้านค้า" Then strAdd = "SELECT * FROM Info_Customer WHERE Store_Name = '" & keep_Search & "' " End If adapter = New SqlDataAdapter(strAdd, connection) Dim dt As New DataTable("Info_Customer") adapter.Fill(dt) adapter = Nothing connection.Close() connection = Nothing Me.DataGridView1.DataSource = dt Me.DataGridView1.Columns.Clear() Dim column As DataGridViewTextBoxColumn column = New DataGridViewTextBoxColumn() column.DataPropertyName = "Rent_No" column.HeaderText = "หมายเลขผู้เช่า" column.HeaderCell.Style.Alignment = DataGridViewContentAlignment.MiddleCenter column.DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleCenter column.Width = 100 Me.DataGridView1.Columns.Add(column) column = New DataGridViewTextBoxColumn() column.DataPropertyName = "Store_Name" column.HeaderText = "ชื่อร้านค้า" column.HeaderCell.Style.Alignment = DataGridViewContentAlignment.MiddleCenter column.DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleCenter column.Width = 150 Me.DataGridView1.Columns.Add(column) column = New DataGridViewTextBoxColumn() column.DataPropertyName = "Prefix_Name" column.HeaderText = "คำนำหน้า" column.HeaderCell.Style.Alignment = DataGridViewContentAlignment.MiddleCenter column.DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleCenter column.Width = 80 Me.DataGridView1.Columns.Add(column) column = New DataGridViewTextBoxColumn() column.DataPropertyName = "Rent_Name" column.HeaderText = "ชื่อผู้เช่า" column.HeaderCell.Style.Alignment = DataGridViewContentAlignment.MiddleCenter column.DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleCenter column.Width = 100 Me.DataGridView1.Columns.Add(column) column = New DataGridViewTextBoxColumn() column.DataPropertyName = "AddressNo" column.HeaderText = "บ้านเลขที่" column.HeaderCell.Style.Alignment = DataGridViewContentAlignment.MiddleCenter column.DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleCenter column.Width = 80 Me.DataGridView1.Columns.Add(column) column = New DataGridViewTextBoxColumn() column.DataPropertyName = "Moo" column.HeaderText = "หมู่ที่" column.HeaderCell.Style.Alignment = DataGridViewContentAlignment.MiddleCenter column.DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleCenter column.Width = 60 Me.DataGridView1.Columns.Add(column) column = New DataGridViewTextBoxColumn() column.DataPropertyName = "Village" column.HeaderText = "ตึก/อาคาร/หมู่บ้าน" column.HeaderCell.Style.Alignment = DataGridViewContentAlignment.MiddleCenter column.DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleCenter column.Width = 120 Me.DataGridView1.Columns.Add(column) column = New DataGridViewTextBoxColumn() column.DataPropertyName = "Soi" column.HeaderText = "ตรอก/ซอย" column.HeaderCell.Style.Alignment = DataGridViewContentAlignment.MiddleCenter column.DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleCenter column.Width = 120 Me.DataGridView1.Columns.Add(column) column = New DataGridViewTextBoxColumn() column.DataPropertyName = "Road" column.HeaderText = "ถนน" column.HeaderCell.Style.Alignment = DataGridViewContentAlignment.MiddleCenter column.DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleCenter column.Width = 120 Me.DataGridView1.Columns.Add(column) column = New DataGridViewTextBoxColumn() column.DataPropertyName = "Tumbon" column.HeaderText = "แขวง/ตำบล" column.HeaderCell.Style.Alignment = DataGridViewContentAlignment.MiddleCenter column.DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleCenter column.Width = 120 Me.DataGridView1.Columns.Add(column) column = New DataGridViewTextBoxColumn() column.DataPropertyName = "District" column.HeaderText = "เขต/อำเภอ" column.HeaderCell.Style.Alignment = DataGridViewContentAlignment.MiddleCenter column.DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleCenter column.Width = 120 Me.DataGridView1.Columns.Add(column) column = New DataGridViewTextBoxColumn() column.DataPropertyName = "City" column.HeaderText = "จังหวัด" column.HeaderCell.Style.Alignment = DataGridViewContentAlignment.MiddleCenter column.DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleCenter column.Width = 120 Me.DataGridView1.Columns.Add(column) column = New DataGridViewTextBoxColumn() column.DataPropertyName = "Code" column.HeaderText = "รหัสไปรษณีย์" column.HeaderCell.Style.Alignment = DataGridViewContentAlignment.MiddleCenter column.DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleCenter column.Width = 100 Me.DataGridView1.Columns.Add(column) column = New DataGridViewTextBoxColumn() column.DataPropertyName = "TelHome" column.HeaderText = "เบอร์โทรศัพท์บ้าน" column.HeaderCell.Style.Alignment = DataGridViewContentAlignment.MiddleCenter column.DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleCenter column.Width = 120 Me.DataGridView1.Columns.Add(column) column = New DataGridViewTextBoxColumn() column.DataPropertyName = "TelPhone" column.HeaderText = "เบอร์โทรศัพท์มือถือ" column.HeaderCell.Style.Alignment = DataGridViewContentAlignment.MiddleCenter column.DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleCenter column.Width = 130 Me.DataGridView1.Columns.Add(column) End If
เพื่อความปลอดภัยของเว็บบอร์ด ไม่อนุญาติให้แทรก แท็ก [img]....[/img] โดยการอัพโหลดไฟล์รูปจากที่อื่น เช่นเว็บไซต์ ฟรีอัพโหลดต่าง ๆ อัพโหลดแทรกรูปภาพ ให้ใช้บริการอัพโหลดไฟล์ของไทยครีเอท และตัดรูปภาพให้พอดีกับสกรีน เพื่อความโหลดเร็วและไฟล์ไม่ถูกลบทิ้ง