on 2017 Oct 18 3:52 PM
Hello,
I am converting our existing .NET ultralite based app to run on UWP. I am just learning the Ultralite for WinRT API...so 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!
Paula
Request clarification before answering.
The second parameter is a value from the ColumnNameType enumeration not the column type. The column name types are documented here:
http://dcx.sap.com/index.html#sqla17api/en/html/82669a9a6ce210149dd4ad0a20171b83.html
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
53 | |
10 | |
9 | |
8 | |
6 | |
5 | |
5 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.