Private Sub Button5_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btn_s1.Click
sql = "select CUSTID,CERTIFICATE from TBL_POLICY_SUCCESS where ASSESS_TOTAL_TA_SPS > '" & txt_s1.Text & "' AND from TBL_POLICY_SUCCESS where FNAME_THAI = '" & cbb_s1.Text & "'"
dgv_2.DataSource = cmd_dataTable()
txt_s1.Text = ""
End Sub
Tag : .NET, Ms SQL Server 2008, VB.NET, VS 2010 (.NET 4.x)
dim strconn_ as string = "server=yourservername;database=yourdatabase;user id=YourUser;pwd=TopSecret"
dim sql as string = "" : dim da_ as new sqldataadapter : dim dt_ as new datatable : dim sql_conn_ as new sqlconnection
dim sql_cmd_ as new sqlcommand
Private Sub Button5_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btn_s1.Click
sql_conn = new sqlconnection(strconn)
sql_conn.open()
sql = "select CUSTID,CERTIFICATE from TBL_POLICY_SUCCESS where ASSESS_TOTAL_TA_SPS > '" & txt_s1.Text & "' AND TBL_POLICY_SUCCESS.FNAME_THAI = '" & cbb_s1.Text & "'"
da_ = new sqldataadapter(sql,sql_conn_)
dt_ = new datatable
da_.fill(dt_)
grid.datasource = dt_
txt_s1.Text = ""
End Sub