ToString

Alpha Doc Reference: https://www.alphasoftware.com/documentation/pages/Ref/Api/Namespace/AlphaCloud/BooleanOrDefault/ToString%20Method.xml


dim cn as sql::Connection

dim args as sql::Arguments

dim rs as sql::ResultSet

dim arr[0] as p

cn.open("::name::conn")

vsql = "SELECT * FROM mytable WHERE lastname=:lastname"

args.set("lastname","wood")


cn.execute(vsql,args)


rs = cn.resultset

Rs.toPropertyArray(arr)

cn.close()


'Example string: wood,steve,san francisco'


for each foo in mylist

lastname = word(foo,1,",")

firsname = word(foo,2,",")

next



dim cn as sql::connection

dim rs as sql::resultset

vsql = "SELECT * FROM tbl WHERE x"

cn.execute(vsql)

rs = cn.resultset

lst = rs.ToString() '==crlf delimited list


cn.close()


Variations

lst = rs.ToString(-1,1,.t.,",") ' comma delimited fields


Convert to Table

lst = rs.ToString() ' comma delimited fields

lst = stritran(lst,chr(4),"</td><td>")

lst2 = "<table class="abc"> + lst

for each foo in lst

       lst2 = lst2 + "<tr><td>" + foo + "</td></tr>" + crlf()

next

lst = lst + lst2 + "</table>"



Full

ToString( [ RowsToCopy as N [, StartRow as N [, DisplayFormat as L [, ColumnSeparator as C [, RowSeparator as C [, ReferenceColumns as SQL::TableInfo [, UserContext as P ]]]]]]] )