当数据类型为 varbinary 时如何检索字符代码。它只给出了“System.Byte[]”字符串。这是我的代码:
public String getTextText(string name)
{
DataTable myData = new DataTable();
SQLiteCommand cmd;
SQLiteDataAdapter adptr = new SQLiteDataAdapter(); ;
SQLiteConnection con = new SQLiteConnection("Data Source=database.db;Version=3;New=False;Compress=True;");
con.Open();
cmd = con.CreateCommand();
string sql = "SELECT * FROM parent where name ='" + name + "' ";
cmd.CommandText = sql;
adptr.SelectCommand = cmd;
adptr.Fill(myData);
con.Close();
return myData.Rows[0][1].ToString();
}