datawindow.net 中 s_bh = "E99010";赋值问题

zixuanzitong 2009-12-25 12:18:35
protected void Button1_Click(object sender, EventArgs e)
{
dw_1.SetTransaction(Trans);

string s_modstring;
string s_where;
string s_bh;
s_bh = TextBox2.Text;
s_bh = "E99010"; ?
s_modstring=dw_1.Describe("DataWindow.Table.Select");
s_where = "spxx.bh = '" + s_bh + "'";//错误在这句
//s_modstring = "DataWindow.Table.Select = '"+ s_modstring + "where "+ s_where +"'";
dw_1.Modify(s_modstring);
Response.Write(s_modstring);
dw_1.Retrieve();
//Response.Write("<script language=javascript>alert('" + s_modstring + "')</script>");

}
正缺的
sql语句中

DataWindow.Table.Select = ' SELECT spxx.bh , spxx.bz , spxx.cm , spxx.gxsj , spxx.kcbj , spxx.pp , spxx.ys , spxx.编号 FROM spxx where spxx.bh=~"E99010~"

得到的错误的sql 是
DataWindow.Table.Select = ' SELECT spxx.bh , spxx.bz , spxx.cm , spxx.gxsj , spxx.kcbj , spxx.pp , spxx.ys , spxx.编号 FROM spxx where spxx.bh = 'E99010''

...全文
163 2 打赏 收藏 转发到动态 举报
写回复
用AI写文章
2 条回复
切换为时间正序
请发表友善的回复…
发表回复
pb8 2009-12-25
  • 打赏
  • 举报
回复
应该是组织字符串的问题,你试试把代码改成这样的~~
s_modstring = 'DataWindow.Table.Select = ~"'+ s_modstring + ' where '+ s_where +'~"';
dw_1.Modify(s_modstring);
永生天地 2009-12-25
  • 打赏
  • 举报
回复
s_where = "spxx.bh = '" + s_bh + "'";//错误在这句
s_modstring = 'DataWindow.Table.Select = "'+ s_modstring + ' where '+ s_where +'"';
dw_1.Modify(s_modstring);

这样写试试

609

社区成员

发帖
与我相关
我的任务
社区描述
PowerBuilder DataWindow
社区管理员
  • DataWindow社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧