|
楼主 |
发表于 2016-8-6 16:56:25
|
显示全部楼层
unit MainUnitClient;
interface
uses
Winapi.Windows, Winapi.Messages, System.SysUtils, System.Variants, System.Classes, Vcl.Graphics,
Vcl.Controls, Vcl.Forms, Vcl.Dialogs, Vcl.StdCtrls, Data.DBXDataSnap,
Data.DBXCommon, IPPeerClient, Data.FMTBcd, Data.DB, Data.SqlExpr;
type
TMainForm = class(TForm)
btn1: TButton;
lbl1: TLabel;
SQLServerMethod: TSqlServerMethod;
SQLconn: TSQLConnection;
procedure btn1Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
MainForm: TMainForm;
implementation
{$R *.dfm}
procedure TMainForm.btn1Click(Sender: TObject);
var
sms:TSqlServerMethod;
begin
SQLconn.Connected:=true;
if not (SQLconn.connected) then exit;
try
sms:=TSqlServerMethod.Create(nil);
sms.SQLConnection:=SQLconn;
sms.ServerMethodName:='TServerMethods1.EchoString("谢谢")';
sms.ExecuteMethod;
lbl1.Caption:=sms.Params[0].AsString;
finally
sms.Free;
end;
end;
end.
|
|