I tried this in JScript and it does not work (same as VBScript):
If I declare row and col (the variables I use in the engine) initially as then I get error invalid assignment:
js.Execute("for(row in dt.Rows) { for(col in row.Table.Columns) { Response.Write row(col.ColumnName).ToString(); } }")
Can this work in V8 ? I don't mind using Count and Item properties for iteration but I would prefer this more.If I declare row and col (the variables I use in the engine) initially as then I get error invalid assignment:
Public row as DataRow
Public col as DataColumn
Public Sub Initialize()
js.AddRestrictedHostObject("me", HostItemFlags.GlobalMembers, Me)
js.Execute("for(row in dt.Rows) { for(col in row.Table.Columns) { Response.Write row(col.ColumnName).ToString(); } }")
End Sub
If I dont declare the variables it gives error as: Object not a collection at Microsoft.ClearScript.ScriptEngine