Asp..Net Ajax Autocomplete RRS feed

  • Question

  • User197255166 posted

    Hello friends I have a problem. I take clients through TextBox AutoComplete Ajax. But here when I want also want to attract customers, also that which users belong to this customer. How is this possible. I share code. Can anyone help me please.

    Here I get data with inner join.

    string sql = string.Format("SELECT Title,Name FROM Customer LEFT JOIN User As T3 ON T3.Id = Customer.IdSaler 
    WHERE Title like '%{0}%' Order BY Title LIMIT 10", text);

    Here is Html Page Ajax Code

            $(function () {
                    minLength: 3,
                    source: function (request, response) {
                            url: "API.ashx",
                            data: 'Token=GetCustomersForAutoComplete&Param1=' + request.term,
                            dataType: "json",
                            success: function (data) {
                    select: function (event, ui) {
                        return false;
                }).autocomplete("instance")._renderItem = function (ul, item) {
                    return $("<li>").append(item.Title + "-" + item.Name).appendTo(ul);

    Sunday, May 22, 2016 1:13 PM


  • User1724605321 posted

    Hi Aliyilmaz,

    So your question is how to get data with inner join in ado.net ? ADO.NET runs straight SQL queries. try to below sql query :

    SELECT column_name(s)
    FROM table1
    INNER JOIN table2
    ON table1.column_name=table2.column_name;
    SELECT column_name(s)
    FROM table1
    JOIN table2
    ON table1.column_name=table2.column_name;

    You could try your query in SSMS to check whether it is correct .

    Best Regards,

    Nan Yu

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Tuesday, May 31, 2016 2:52 AM

All replies