如何使用C#中的查询获得SQLite表格架构
我一直在高低搜索,使用许多方法从sqlite的表中获取表格架。请原谅我是否已将其发布到其他地方。
当前查询是,
SELECT TOP (0) * FROM 'TableName'
但这一无所获。
SELECT * FROM 'TableName'
如果桌子为空,也不会返回。
我还使用了sqliteconnection.getschema()
,但它不会返回所讨论的表。它返回带有其他列的表。
DataTable dtReturnTable = new DataTable();
sqlitecon.Open();
string[] sParameters = new string[4];
sParameters[2] = sTableName;
dtReturnTable = sqlitecon.GetSchema("Columns", sParameters);
sqlitecon.Close();
I have been searching high and low, using many methods to get a table schema from a table in sqlite. Please forgive me if this has been posted somewhere else.
Current query is
SELECT TOP (0) * FROM 'TableName'
but this returns nothing.
SELECT * FROM 'TableName'
also returns nothing if the table is empty.
I also used SQLiteConnection.GetSchema()
but it doesn't return the table in question; it returns a table with other columns.
DataTable dtReturnTable = new DataTable();
sqlitecon.Open();
string[] sParameters = new string[4];
sParameters[2] = sTableName;
dtReturnTable = sqlitecon.GetSchema("Columns", sParameters);
sqlitecon.Close();
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
所以我做的是
So what I did was this