jQuery UI Widgets Forums Grid Bind jqxGrid to SQL Database using ASP.NET

This topic contains 3 replies, has 2 voices, and was last updated by  Dimitar 7 years ago.

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
  • Bind jqxGrid to SQL Database using ASP.NET #76126

    migue
    Participant

    hello I have a question about the example

    https://www.jqwidgets.com/jquery-widgets-documentation/documentation/asp.net-integration/asp.net-binding-to-sql-database.htm

    I can pass as parameters to the method GetCustomers
    I need to load a grid with values that control the page to load

    I can just load the grid without sending parameters

    I need you help

    Bind jqxGrid to SQL Database using ASP.NET #76133

    Dimitar
    Participant

    Hello migue,

    Parameters can be send to the server side (i.e. the GetCustomers method) with the data property of the source object, e.g.:

    source = {
        datatype: "xml",
        datafields: [{
            name: 'CompanyName'
        }, {
            name: 'ContactName'
        }, {
            name: 'ContactTitle'
        }, {
            name: 'City'
        }, {
            name: 'Country'
        }, {
            name: 'Address'
        }],
        async: false,
        record: 'Table',
        url: 'Default.aspx/GetCustomers',
        data: {
            customParameter1: value1,
            customParameter2: value2
        }
    };

    Alternatively, you can pass a parameter directly in the url, e.g.:

    url: 'Default.aspx/GetCustomers/5',

    The latter can be seen demonstrated in the help topic CRUD with jqxGrid, ASP.NET MVC3 and SQL (e.g. url: '/Employees/Delete/5').

    Best Regards,
    Dimitar

    jQWidgets team
    http://www.jqwidgets.com/

    Bind jqxGrid to SQL Database using ASP.NET #76169

    migue
    Participant

    ok but as I declare the method in c # server side

    [WebMethod]
    [ScriptMethod(UseHttpGet = true, ResponseFormat = ResponseFormat.Xml)]
    public static string Documentos(string condicion)
    {
    StringWriter writer;
    ClsUtilerias lib = new ClsUtilerias();
    DataSet data = lib.ejecutarConsultaEnDataSet(“exec spt_Consulta_Ejecutiva_Maestra “+condicion);
    if (data.Tables[0].Rows.Count > 0)
    {
    // return the Customers table as XML.
    writer = new System.IO.StringWriter();
    data.Tables[0].WriteXml(writer, XmlWriteMode.WriteSchema, false);
    return writer.ToString();
    }
    else { return “”; }
    }

    so the method but have not come to run when I put the varibles the parameter

    Bind jqxGrid to SQL Database using ASP.NET #76173

    Dimitar
    Participant

    Hi migue,

    I am not sure I understand what your issue actually is, but in my previous post I have specified valid ways of passing parameters from the client side to the server side. Please also note that, generally, we do not provide support regarding custom back end implementations.

    Best Regards,
    Dimitar

    jQWidgets team
    http://www.jqwidgets.com/

Viewing 4 posts - 1 through 4 (of 4 total)

You must be logged in to reply to this topic.