Dismiss Notice

REGISTRATION IS AFTER ADMIN ACTIVATION

DONATIONS WITH PAYPAL CLICK TO BUTTON

3 MONTHS VIP - 10$; 6 MONTHS VIP - 20$; 1 YEAR VIP - 30$; 2 YEARS VIP - 50$; GOLD USER FOR LIFE VIP - 150$

DONATIONS WITH Bitcoin Address:3NRs3CK3fhXifrNYxHEZKpETDd9vNLMsMD

Dismiss Notice
The registration is approved by the Administrator. It takes about 1 day to approve your registration
Dismiss Notice
For open hidden message no need write thanks, thank etc. Enough is click to like button on right side of thread.

XE5 ANDROID visit MSSQL database through WebService operation

Discussion in 'Delphi Programming' started by N0body, Aug 6, 2014.

  1. N0body
    Online

    N0bodyN0body is a Verified Member DelphiFan Administrator Staff Member DF Staff

    On the XE5 ANDROID platform called WebService.
    One, the server
     Add a function in RO (add a connection in the impl, adoquery, dataprovider)


    Code:
    function TNewService.getdata(const sqlstr: Utf8String): Variant;
    begin
    qry1.Close;qry1.SQL.Text:='';
    qry1.SQL.Text:=sqlstr;
    qry1.Open;
    ds1.Data:=dtstprvdr1.Data;
    Result:=ds1.XMLData;//Pass a xmldata to the client
    end;
    

    Two, the client calls with addition of WSDL, XE5, ANDROID platform called webservice
    Client add HTTPRIO, stringgrid (FMX data show no similar DataGrid)
    Read data code


    Code:
    HTTPRIO1.URL:='http://192.168.1.103:8099/SOAP';
    ClientDataSet1.XMLData:=(HTTPRIO1 as soap.NewService).getdata('SELECT top 10 [EmployeeID],[EmployeeName],[DepartmentID] FROM [GM_MT].[dbo].[GM_KQ_Employee]');
     while  not ClientDataSet1.Eof do
     begin
       StringGrid1.Cells[0,i]:=ClientDataSet1.FieldByName('EmployeeID').AsWideString;
       StringGrid1.Cells[1,i]:=ClientDataSet1.FieldByName('EmployeeName').AsString;
       StringGrid1.Cells[2,i]:=ClientDataSet1.FieldByName('DepartmentID').AsString;
       ListBox1.Items.Add(ClientDataSet1.FieldByName('EmployeeName').AsWideString);
       i:=i+1;
       ClientDataSet1.Next;
      end;
    
     
  2. adrianleeable
    Offline

    adrianleeable DF Junior

  3. pablop
    Offline

    pablop DF Member

    RE:

    Thanks
     
  4. himan
    Offline

    himan DF Member

    RE:

    Thanks
     
  5. fabalo76
    Offline

    fabalo76 DF Member

    thank you for your effort.
     
  6. barm
    Online

    barm Guest

    RE:

    )thanks
     
  7. kosbor
    Offline

    kosbor DF Junior

    thanks
     
  8. zgembo
    Offline

    zgembo DF Junior

    cool, thanks
     

Share This Page

Laws
Our website, law, laws, copyright and aims to be respectful of individual rights. Our site, as defined in the law of 5651 serves as a provider of space. According to the law, contrary to the law of site management has no obligation to monitor content. Therefore, our site has adopted the principle of fit and remove. Works are subject to copyright laws and is shared in a manner that violated their legal rights, or professional associations, rights holders who, adsdelphi@gmail.com I can reach us at e-mail address. Complaints considered to be infringing on the examination of the content will be removed from our site.
Donate Help To Us and Be VIP
DONATIONS WITH PAYPAL CLICK TO BUTTON
6 MONTHS VIP - 20$; 1 YEAR VIP - 30$; 2 YEARS VIP - 50$; GOLD USER FOR LIFE VIP - 150$
Social Block