我会让这件事尽可能简单。 在 MySQL 中是这样的:
string name = myReader.Getstring("student_name");
如何在 SQLite 中执行此操作?仍然是c#。 任何帮助将不胜感激。预先感谢。
string name = myReader.GetString(0);
只需确保在代码顶部,在连接之前,您有“string(字符串的名称)=“select name from(表名称)”;”
将其包含在您的 using 语句中。
using System.Data;
它提供了一种扩展方法,允许您通过列名而不是序数来获取。