VS下,Sybase DataWindow控件
怎么添加向datawindow动态添加列?
[解决办法]
动态添加列,需要根据sql语句,动态创建数据窗口
string as_sql, ls_syntax, error_sql, ls_ret
datastore lds_data
lds_data = create datastore
as_sql = "select 1, 2, 3 from dual" //Oracle
ls_syntax = syntaxfromsql(sqlca, as_sql, "style(type=grid),column(font.facename='arial',font.size=-9))", error_sql)
if len(error_sql) > 0 then
ls_ret = '!@!syntaxfromsql Error:' + error_sql + '~r~n' + as_sql
else
lds_data.create(ls_syntax, error_sql)
if len(error_sql) > 0 then
ls_ret = '!@!Create Datawindow Error:' + error_sql
else
//
end if
end if
destroy lds_data
[解决办法]
string as_sql, ls_syntax, error_sql, ls_ret
datastore lds_data
lds_data = create datastore
as_sql = "select 1, 2, 3 from dual" //Oracle
ls_syntax = syntaxfromsql(sqlca, as_sql, "style(type=grid),column(font.facename='arial',font.size=-9))", error_sql)
if len(error_sql) > 0 then
ls_ret = '!@!syntaxfromsql Error:' + error_sql + '~r~n' + as_sql
else
lds_data.create(ls_syntax, error_sql)
if len(error_sql) > 0 then
ls_ret = '!@!Create Datawindow Error:' + error_sql
else
//
end if
end if
destroy lds_data