Please be aware that the content in SAP SQL Anywhere Forum will be migrated to the SAP Community in June and this forum will be retired.


I am converting our existing .NET ultralite based app to run on UWP. I am just learning the Ultralite for WinRT please forgive this very basic question!

I am using version 17 developer edition of SQL Anywhere and Visual Studio 2017. I am using the SAP Docs to learn the API.

I am able to connect to a database and select data from a table into a ResultSet object. I am attempting to get the column names using a ResultSetSchema object. The call I'm using (GetColumnName) always returns an empty string.

Does this not work or is there something else I need to do? Or maybe it does not work like I think it works?

Here's a snip of code I'm using - again, very basic:

DatabaseManager.Init(); Connection connection = DatabaseManager.OpenConnection(connParms); PreparedStatement ps = connection.PrepareStatement("SELECT MyColOne, MyColTwo, MyColThree FROM MyTable"); try { ResultSet rs = ps.ExecuteQuery(); ResultSetSchema rsc = rs.GetResultSetSchema(); for (ushort i = 0; i < rsc.GetColumnCount(); i++) { ushort p = rsc.GetColumnType(i); string colName = rsc.GetColumnName(i, p); } }...

Thanks for the help!


asked 18 Oct '17, 14:52

Paula's gravatar image

accept rate: 0%

The second parameter is a value from the ColumnNameType enumeration not the column type. The column name types are documented here:

permanent link

answered 18 Oct '17, 15:44

Chris%20Keating's gravatar image

Chris Keating
accept rate: 31%

Thank you! I just assumed type was the type of the column. Works like a charm.

(18 Oct '17, 16:50) Paula
Your answer
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here



Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text]( "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Question tags:


question asked: 18 Oct '17, 14:52

question was seen: 1,632 times

last updated: 18 Oct '17, 16:50