Built in RTC Android three layer application program to access the server MsSql-

Recommended for you: Get network issues from WhatsUp Gold. Not end users.

Known issues with stringgrid Android:

By clicking on the corresponding row values are obtained, the normal debugging in win, positioning must not appear in Android

Two, the development of client

1, New project

2, Add the relevant client controls TRtcHttpClient, TRtcClientModule, TRtcResult (2)

   3, Setting the related properties of TRtcHttpClient server address, port, TRtcClientModule client settings, as well as a modulefilename

   4, Writing TRtcResult code

Select TRtcResult code

procedure TForm1.rtcrslt1Return(Sender: TRtcConnection; Data,

  Result: TRtcValue);

  var I:Integer;

begin

if Result.isType=rtc_Exception then

begin

btn1.Text:='error';

end

  else if Result.isType=rtc_Null then

begin

btn1.Text:='NULL';

end

  else

begin

//btn1.Text:=Result.asString;

I:=0;

Result.asDataSet.First;

while not Result.asDataSet.Eof do

begin

strngrd1.Cells[0,i]:=Result.asDataSet.FieldByName('Name').asString;

strngrd1.Cells[1,i]:=Result.asDataSet.FieldByName('Birthday').asString;

strngrd1.Cells[2,i]:=Result.asDataSet.FieldByName('Marital status').asString;

strngrd1.Cells[3,i]:=Result.asDataSet.FieldByName('Age').asString;

strngrd1.Cells[4,i]:=Result.asDataSet.FieldByName('The contact ID').asString;

i:=i+1;

Result.asDataSet.Next;

end;

end;

end;


Up TRtcResult code

btn2.Text:='Modify the effect of the number of records: '+Result.asString;


Read data code

rtclntmdl1.StartCalls;

rtclntmdl1.Data.NewFunction('select');

rtclntmdl1.Call(rtcrslt1);

rtclntmdl1.Post;


Update the data code:

with rtclntmdl1.Data.NewFunction('up') do

begin

  asWideString['a']:=edt_name.Text;//Parameter is the Chinese please use asWideString, or the server receives the parameter is garbled

  asDateTime['b']:=edt_cs.Date;

  asInteger['c']:=StrToInt(edt_nl.Text);

  asInteger['d']:=StrToInt(strngrd1.Cells[4,strngrd1.Selected]);

end;

rtclntmdl1.Call(rtcrslt2);

end;



The test was not garbled Android

Other code, see demoļ¼


http://pan.baidu.com/s/1cea38




Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download

Posted by Bishop at November 18, 2013 - 11:18 AM