Click here to Skip to main content
14,734,054 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
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)
Posted

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


Also, explore the quick If.
E.g.
If(ApplyValue IsNot Nothing AndAlso ApplyValue IsNot...) & _
   
Comments
Member 9410081 26-Feb-14 4:34am
   
This is giving error in vb.net
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...
   
Comments
Member 9410081 26-Feb-14 4:36am
   
I want to show a confirmation window and if it is true then want to execute another statement so can u help?
If (confirm('Do You want to change the Reporting Manager To ')== true)
   

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)




CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900