可以在循环语句中写入字符串构建器。追加方法? [英] Can if loop statement written in string builder . append method ?

查看:68
本文介绍了可以在循环语句中写入字符串构建器。追加方法?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

以下是我在字符串构建器中的声明,但是不要给我任何人帮助我的确认框吗?







MySql =从PR_EMPLOYEE_MASTER选择PR_EMPLOYEE_MASTER.ID,PR_DESIG_MASTER&_

其中PR_EMPLOYEE_MASTER.PR_DESIG_MASTER_ID = PR_DESIG_MASTER.RPT_DESIG_MASTER_ID和&_

PR_DESIG_MASTER.ID =&Trim(e.Item.Cells(1).Text)&_

和PR_EMPLOYEE_MASTER.Emp_Location_Master_Id =&Trim(new_location_id)

< br $>


tTempEmp = RSmartUtl.GetSqlColVal(MySql,1)



aryEmp =拆分(tTempEmp,, , - 1)







strBuilder.Append(如果(确认)('你做想要将报表管理器更改为')== true)&aryEmp(0)&vbCrLf)

strBuilde r.Append(End If&vbCrLf)

Below is my statement in string builder but do not give me any confirmation box can any one help me?



MySql = " Select PR_EMPLOYEE_MASTER.ID from PR_EMPLOYEE_MASTER, PR_DESIG_MASTER " & _
" where PR_EMPLOYEE_MASTER.PR_DESIG_MASTER_ID = PR_DESIG_MASTER.RPT_DESIG_MASTER_ID And " & _
" PR_DESIG_MASTER.ID =" & Trim(e.Item.Cells(1).Text) & _
" And PR_EMPLOYEE_MASTER.Emp_Location_Master_Id =" & Trim(new_location_id)


tTempEmp = RSmartUtl.GetSqlColVal(MySql, 1)

aryEmp = Split(tTempEmp, ",", "-1")



strBuilder.Append("If ( Confirm('Do You want to change the Reporting Manager To ')== true )" & aryEmp(0) & vbCrLf)
strBuilder.Append("End If" & vbCrLf)

推荐答案

无法使用引号在字符串构建内写入if循环。

尝试没有引号如下 -

An if loop cannot be written inside the string build with quotes.
Try without the quotes as follows -
If ( Confirm('Do You want to change the Reporting Manager To ')== true) strBuild.Append(aryEmp(0);
Ebd If





此外,探索快速If。

例如



Also, explore the quick If.
E.g.

If(ApplyValue IsNot Nothing AndAlso ApplyValue IsNot...) & _


不,它不会。

这是一个字符串:不是命令。

如果你想要它执行,那么你必须用它做一些事情。

这只是在StringBuilder中创建一个字符串而不做任何事情。

如果你想要它执行,那么你可能想要使用ToString方法将它转换为字符串,用适当的HTML包围它并将其传递给客户端...
Well no, it won't.
It's a string: not a command.
If you want it executed, then you have to do something with it.
That just creates a string in a StringBuilder and does nothing with it.
If you want it executed, then you probably want to convert it to a string using the ToString Method, surround it with the appropriate HTML and pass it up to the client...


If(确认('您是否要将报告管理器更改为')== true)
If (confirm('Do You want to change the Reporting Manager To ')== true)


这篇关于可以在循环语句中写入字符串构建器。追加方法?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆