Infragistics Home

Infragistics Forums

Infragistics community online discussions.
Welcome to Infragistics Forums Sign in | FAQ
in Search

WebCombo sending brackets as parameter, please help

Last post 08-14-2008 13:08 by [Infragistics] Vince McDonald. 5 replies.
Page 1 of 1 (6 items)
Sort Posts: Previous Next
  • 08-08-2008 14:37

    • Andy09
    • Not Ranked
    • Joined on 05-16-2008
    • Points 125

    WebCombo sending brackets as parameter, please help

    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. 

    • Post Points: 5
  • 08-11-2008 8:19 In reply to

    • Andy09
    • Not Ranked
    • Joined on 05-16-2008
    • Points 125

    Re: WebCombo sending brackets as parameter, please help

    Any ideas/suggestions would be greatly appreciated. Thanks 

    • Post Points: 5
  • 08-11-2008 13:54 In reply to

    • Andy09
    • Not Ranked
    • Joined on 05-16-2008
    • Points 125

    Re: WebCombo sending brackets as parameter, please help

    Looking more in depth, looks as though my lDataTable has the rows that I need to return back to the WebCombo, however the .DataBind() event is supposed to bind them to the control, correct? What am I missing here, I have the data back in my lDataTable variable, however nothing is populating my WebCombo. Please help.

    • Post Points: 5
  • 08-12-2008 13:17 In reply to

    • Andy09
    • Not Ranked
    • Joined on 05-16-2008
    • Points 125

    Re: WebCombo sending brackets as parameter, please help

    Really need a hand with this issue, I'm getting data back from the database and being held in lDataTable. When the data is to be filled in the WebComboCustomer it gives me the error:

    "The expression contains invalid name: [ ] LIKE '%''."

    How am I getting data back but nothing is being bound to the WebCombo? 

    • Post Points: 5
  • 08-13-2008 11:36 In reply to

    • Andy09
    • Not Ranked
    • Joined on 05-16-2008
    • Points 125

    Re: WebCombo sending brackets as parameter, please help

     

    The expression contains invalid name: '[ LIKE 'o%''.

    Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

    Exception Details: System.Data.SyntaxErrorException: The expression contains invalid name: '[ LIKE 'o%''.

    Source Error:

    An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.

    Stack Trace:

    [SyntaxErrorException: The expression contains invalid name: '[ LIKE 'o%''.]
    System.Data.ExpressionParser.ScanName(Char chEnd, Char esc, String charsToEscape) +1308261
    System.Data.ExpressionParser.Scan() +533
    System.Data.ExpressionParser.Parse() +63
    System.Data.DataExpression..ctor(DataTable table, String expression, Type type) +124
    System.Data.DataView.set_RowFilter(String value) +161
    Infragistics.WebUI.UltraWebGrid.DBBinding.ProcessDataViewForFillRows(DataView dataView, RowsCollection rows) +497
    Infragistics.WebUI.UltraWebGrid.DBBinding.FillRows(UltraWebGrid grid, RowsCollection rows, IEnumerable datasource) +326
    Infragistics.WebUI.UltraWebGrid.DBBinding.BindList(IEnumerable datasource) +2801
    Infragistics.WebUI.UltraWebGrid.DBBinding.DataBind(Object dataSource, String dataMember) +1608
    Infragistics.WebUI.UltraWebGrid.UltraWebGrid.DataBind() +530
    Infragistics.WebUI.UltraWebGrid.UltraWebGrid.LoadPostData(String postDataKey, NameValueCollection values) +4763
    System.Web.UI.Page.ProcessPostData(NameValueCollection postData, Boolean fBeforeLoad) +661
    System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +1194


    Version Information: Microsoft .NET Framework Version:2.0.50727.1433; ASP.NET Version:2.0.50727.1433

    • Post Points: 20
  • 08-14-2008 13:08 In reply to

    Re: WebCombo sending brackets as parameter, please help

    Andy,

    I suggest that you submit a support request to Developer Support.  This will likely require some in-depth investigation, and my impression is that there may be a bug that needs fixing.

    When you do, please include a sample project that my staff can run and debug and which reproduces the problem.  That way, we can be sure we're running the same code that you are.  Since database connectivity seems relevant to the issue, I suggest using the Northwind database from either SQL Server or Access in your sample.

    Vince McDonald
    Manager of Developer Support, MCP
    Infragistics, Inc.

    Was this post helpful? Please let me know by using the star ratings and the "Answered" button from the forum's web interface.

    Need help? Find the various ways you can ask for help from Infragistics.
    • Post Points: 5
Page 1 of 1 (6 items)
Powered by Community Server (Commercial Edition), by Telligent Systems