擅长:python、mysql、java
<p>对于那些希望在Xamarin中以编程方式执行此操作的人,也许(像我一样)可以对SQLiteConnection执行PRAGMA查询,如下所示:</p>
<pre><code>connection.Query<SqliteColumninfo>($"PRAGMA table_info({tableName})");
</code></pre>
<p>我找不到在PCL Sqlite包中定义的用于收集结果的对象,因此创建了一个类来收集上述组件:</p>
<pre><code>public class SqliteColumninfo
{
public string Cid { get; set; }
public string Name { get; set; }
public string Type { get; set; }
public int NotNull { get; set; }
public int Dflt_Value { get; set; }
public int PK { get; set; }
}
</code></pre>