Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
sql = String.Format("select idcus,docid,dgetreport,names,adtambon,adaumper,adcity,teamasset1,teamasset2,dsentreport,statusqc from customer where dgetreport Between '" & dtp1.Value.ToString("yyyy-MM-dd") & "' AND '" & dtp2.Value.ToString("yyyy-MM-dd") & "' AND statusqc like '%" & txt1.Text & "%' and customer.statusqc = '" & txt.Text & "' ")
dgv1.DataSource = cmd_dataTable()
refresh_all_data_user()
dgv1.Columns(0).Width = 80
dgv1.Columns(1).Width = 150
End Sub
Tag : Ms SQL Server 2008, VB.NET, VS 2010 (.NET 4.x)
sql = String.Format("select idcus,docid,dgetreport,names,adtambon,adaumper,adcity,teamasset1,teamasset2,dsentreport,statusqc from customer where statusqc like '%" & txt.Text & "%' or statusqc like '%" & txt1.Text & "%' AND dgetreport Between '" & dtp1.Value.ToString("yyyy-MM-dd") & "' AND '" & dtp2.Value.ToString("yyyy-MM-dd") & "' ")
dgv1.DataSource = cmd_dataTable()