如果表和列是在sqlite中生成的代码'behind,是否可以获得列名(标题)?
试过这个但它失败了:
SQLiteCommand cmd = new SQLiteCommand();
string sSQL = "Select * from tblUser Where username = '" + txtUsername.Text + "'";
cmd.CommandText = sSQL;
cmd.Connection = clsCon.con;
SQLiteDataReader dr2;
dr2 = cmd.ExecuteReader();
string columnName = dr2.GetName(1);
dr2.Read();
if (dr2.HasRows)
{
MessageBox.Show("Username Already Exist!", "SQLite Test Application", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
txtUsername.Focus();
}