查询表,提示42P01错误!
TTOLH 2017-08-21 09:32:40 在pgadmin4中创建的表users,访问都正常,但是在vs2012中,C#语言访问,连接能打开,但是执行到 com.ExecuteReader(),提示42P01错误,查错误代码是没有表users,这是咋回事?
using (NpgsqlConnection con = new NpgsqlConnection("server=ideapad-pc;Dsn=PostgreSQL30;uid=postgres;password =123456"))
{
con.Open();
string sqlselect = "select * from public.users where username = 'user‘ “;
NpgsqlCommand com = new NpgsqlCommand(sqlselect, con);
NpgsqlDataReader reader = com.ExecuteReader();//执行到此行报错
reader.Read();
com.Dispose();
con.Close();
}