Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Adding value from database to datatable
#6
Solved: 10 Years, 10 Months ago
If a parameter with name userid already exists in datatable, the AddParameter call will add a new parameter with name userid1, userid2 etc.

Run tis sample code:
Code:
For i = 1 to 3
    ParamName = DataTable.GlobalSheet.AddParameter(  "Param", "12" ).Name
    MsgBox ParamName
Next

You must check if a parameter exists, and add the parameter only if not exists, here is an example how to do it:
Code:
Sub AddParameterIfNotExists( byval Sheet, byval ParamName, byval strValue )
     On error resume next
     Sheet.getParameter( ParamName ).value = strValue
     If Err.Number <> 0  Then
           Sheet.AddParameter ParamName, strValue
     End If
End Sub

For i = 1 to 3
    Call AddParameterIfNotExists( DataTable.GlobalSheet, "ParamName", i )
    MsgBox DataTable.GlobalSheet.GetParameter( "ParamName" )
Next
Reply


Messages In This Thread
RE: Adding value from database to datatable - by kordirko - 07-09-2013, 12:53 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Pages and Frames adding _1, _2, _3... zunebuggy 1 1,518 05-30-2017, 12:17 AM
Last Post: Vichu M J
  Adding negative amount in webedit Rose 1 2,016 06-30-2016, 09:34 PM
Last Post: babu123
  Adding data into rows that add dynamically with setcelldata azar81 4 5,682 04-13-2015, 05:24 PM
Last Post: vidya2k2
  Function writes data from datatable to database Fairbanks 0 2,411 06-27-2014, 07:51 PM
Last Post: Fairbanks
  adding webtable to dictonaryobject prabu211989 2 2,475 01-06-2014, 07:56 PM
Last Post: Parke

Forum Jump:


Users browsing this thread: 1 Guest(s)