VB.net Postgres参数化查询返回没有结果

时间:2017-11-10 19:09:16

标签: vb.net postgresql

我在Visual Basic中有这个功能:

gcc test.c -shared

我没有抛出任何异常,但我仍然没有得到任何结果。我在我的数据库中有这个test@test.com,当我在pgAdmin4中运行它时 (Private Function getpsqlsingle() As String sqlquery = "select username from web_user where email = '@email' and is_temporary='f'" Dim email As String = "test@test.com" Dim psqlconnection As NpgsqlConnection = New NpgsqlConnection("Server=" & signiantserver & ";port=5432;User Id=postgres;Database=DTM_DB") psqlconnection.Open() Dim psqlcommand As NpgsqlCommand = New NpgsqlCommand(sqlquery, psqlconnection) psqlcommand.CommandType = CommandType.Text Dim param As NpgsqlParameter = New NpgsqlParameter("@email", NpgsqlTypes.NpgsqlDbType.Text) param.Value = email psqlcommand.Parameters.Add(param) Dim value = psqlcommand.ExecuteScalar psqlconnection.Close() Return value End Function ) 我得到了一个结果。有没有我没有设置的东西?任何帮助表示赞赏。

0 个答案:

没有答案