Private Sub search_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
Try
Dim cmd As New System.Data.SqlClient.SqlCommand()
Dim conn As New System.Data.SqlClient.SqlConnection(My.Settings.LoanConnectionString)
cmd.Connection = conn
cmd.CommandText = "CREATE PROCEDURE dbo.Rpt_Search_Customer_Infomation" & _
"@gIDname NVARCHAR(250)," & _
"@gNameLa NVARCHAR(250)," & _
"@gLastNameLa NVARCHAR(250)" & _
"AS" & _
"SELECT g.GroupID AS GroupID,g.Disburse AS DisburmentDate, g.Inactive AS StatusAct, c.CustomerID,c.Principal AS Principal," & _
"m.NameKhm AS Name,m.LastName AS Surname, m.BirthDate AS BirthDate, m.Province AS Province, m.District AS District, " & _
"m.Commune AS Village " & _
"INTO #Filter" & _
"FROM tblGroups g" & _
"INNER JOIN tblClients c ON g.GroupID=c.GroupID" & _
"INNER JOIN TblCustomers m ON c.CustomerID=m.CustomerID" & _
"WHERE g.GroupID LIKE '%'+@gIDname+'%' AND m.NameKhm LIKE '%'+@gNameLa+'%' AND m.LastName LIKE '%'+@gLastNameLa+'%'" & _
"ORDER BY g.GroupID"
conn.Open()
cmd.ExecuteNonQuery()
conn.Close()
Catch ex As Exception
End Try
End Sub