Hello Infragistics Team,
I've been back and forth with my ASP project and finally to the stored procedure call. For some reason when I enter the InitializeDataSource event it feeds in let's say 'o' is the e.Combo.DisplayValue, well I append a '%' in the function to make lQueryText = 'o%'
I run the SP and get back column values in the dataset but to my knowledge no data, also my ExceptionHandler is giving me the error:
"The expression contains invalid name: '[ ] LIKE 'o%''." that's 2 single quotes after the perfect and a period then double quote
Here's my code:
Protected Sub WebComboCustomer_InitializeDataSource(ByVal sender As Object, ByVal e As Infragistics.WebUI.WebCombo.WebComboEventArgs) Handles WebComboCustomer.InitializeDataSource
If Session("MyFlag") = 1 Then
Exit Sub
Else
Dim lConnStr As String = ""
Dim lDataSet As New DataSet
Dim lDataTable As New DataTable
Dim lSqlDa As New SqlClient.SqlDataAdapter
Dim lQueryText As String = ""
Dim lSqlConn As New SqlClient.SqlConnection(connectstring)
Try
If Not e.Combo.DisplayValue Is Nothing AndAlso e.Combo.DisplayValue.ToString.Trim.Length > 0 Then
lQueryText = e.Combo.DisplayValue.ToString.Trim + "%"
Else
lQueryText = "%"
End If
lSqlConn.Open()
With lSqlDa
.SelectCommand = New SqlClient.SqlCommand
With .SelectCommand
.CommandText = "spWebMasterCustomerCodeLike"
.CommandType = CommandType.StoredProcedure
.Parameters.Add("@Code", SqlDbType.VarChar, 7).Value = lQueryText
.Connection = lSqlConn
End With
.Fill(lDataTable)
End With
With WebComboCustomer
.DataSource = lDataTable
.DataBind()
End With
Catch ex As Exception
MsgBox(ex.Message.ToString)
Finally
If Not lSqlConn Is Nothing Then
If lSqlConn.State = ConnectionState.Broken Or lSqlConn.State = ConnectionState.Closed Then
Else
lSqlConn.Close()
End If
End If
End Try
End If
End Sub
here's spWebMasterCustomerCodeLike:
Select CU_AcctNo, CU_AcctName, CU_AllowGuaranteedSvc from MasterCustomer
WHERE CU_AcctNo LIKE @Code
AND CU_Status = 1
Thanks
Any ideas / solutions would be greatly appreciated.