这样的存储过程。
CREATE PROCEDURE www
@sun1_1 char(10),
@sun2_1 char(10)
AS
insert into sun
(sun1,sun2)
values
(@sun1_1,@sun2_1)
GO
这样的代码。
procedure TForm1.Button1Click(Sender: TObject);
begin
storedproc1.DatabaseName:='human';
storedproc1.StoredProcName:='www';
storedproc1.Active:=true;
storedproc1.Close;
storedproc1.Prepare;
storedproc1.ParamByName('sun1_1').AsString:=edit1.Text;
storedproc1.ParamByName('sun2_1').AsString:=edit2.Text;
storedproc1.ExecProc;
storedproc1.Open;
datasource1.DataSet:=storedproc1;
dbgrid1.DataSource:=datasource1;
end;
这样的代码错在哪里能告诉我吗。
CREATE PROCEDURE www
@sun1_1 char(10),
@sun2_1 char(10)
AS
insert into sun
(sun1,sun2)
values
(@sun1_1,@sun2_1)
GO
这样的代码。
procedure TForm1.Button1Click(Sender: TObject);
begin
storedproc1.DatabaseName:='human';
storedproc1.StoredProcName:='www';
storedproc1.Active:=true;
storedproc1.Close;
storedproc1.Prepare;
storedproc1.ParamByName('sun1_1').AsString:=edit1.Text;
storedproc1.ParamByName('sun2_1').AsString:=edit2.Text;
storedproc1.ExecProc;
storedproc1.Open;
datasource1.DataSet:=storedproc1;
dbgrid1.DataSource:=datasource1;
end;
这样的代码错在哪里能告诉我吗。
解决方案 »
- 哪位仁兄是www.pudn.com会员,帮个忙下载一下,非常感谢!
- 球助,TQuickReport问题
- 如何用程序取消excel的行隐藏?
- Treeview 的数据库建树
- 如何用dbgrid当前显示查询结果
- InstallShied 如何打包com+?
- 很简单的数据库问题
- Indy 中,得到 http-equiv="refresh" 如何处理
- 存储过程中17除3取整数用什么语句,只要前边的整数
- 怎样得到TQUERY记录集的当前行,RecNo返回是0
- ************* 难!难!难! *******************
- 用ReadLn读文本文件,文件较大(960K)的竟然读不出!把文件名改为另一个较小的文本文件,其它代码不变,运行正常,这证明程序无误。我不
begin
storedproc1.DatabaseName:='human';
storedproc1.StoredProcName:='www';
storedproc1.Active:=true;
storedproc1.Close;
storedproc1.Prepare;
storedproc1.ParamByName('sun1_1').AsString:=edit1.Text;//这里错了
storedproc1.ParamByName('sun2_1').AsString:=edit2.Text;//还有这里storedproc1.ParamByName('sun1_1').Value:=edit1.text;
storedproc1.ParamByName('sun2_1').Value:=edit2.text;
storedproc1.ExecProc;
storedproc1.Open;
datasource1.DataSet:=storedproc1;
dbgrid1.DataSource:=datasource1;
end;