This question is locked. New answers and comments are not allowed.
Hi
How do I get the column names from a quiery result set (IQueryResult)
We use stored procedures to return the data, I know it must be posiable as the grid controls return the columns names, but I need to access this information before i deploy it to the grid.
the code is the processed in the normal way....
but at the point of extracting the information for column 0, 1, 2 etc I would like to know the column name, as the data needs to be passed back as XML in the format <Column Name='someColumn' value='someValue' type='system.string' /> etc
the column names may change depending on the list id supplied. the code does return data, but i cant find the column name anywhere
any got any ideas
Thanks
Jules
How do I get the column names from a quiery result set (IQueryResult)
We use stored procedures to return the data, I know it must be posiable as the grid controls return the columns names, but I need to access this information before i deploy it to the grid.
Public Shared Function GetListData(ByVal scope As IObjectScope, ByVal listID As Guid) As IQueryResult
Dim query As IQuery = scope.GetSqlQuery("prGetList ?", Nothing, "GUID ContactID")
Dim res As IQueryResult = query.Execute(New Object() {contactID})
Dim count As Integer = res.Count 'executes the query
Return res
End Function
the code is the processed in the normal way....
Dim result As IQueryResult = DBLibrary.StoredProcedure.GetListData(scope, guidListID)
For Each pr As Object() In result
....... = Convert.ToInt32(pr(0))
Next
scope.Dispose()
but at the point of extracting the information for column 0, 1, 2 etc I would like to know the column name, as the data needs to be passed back as XML in the format <Column Name='someColumn' value='someValue' type='system.string' /> etc
the column names may change depending on the list id supplied. the code does return data, but i cant find the column name anywhere
any got any ideas
Thanks
Jules