How to call postgresql function in asp net?
Answer / Awadheshwar Kumar
You can call a PostgreSQL function from ASP.NET using Npgsql, a .NET data provider for PostgreSQL. Here's an example: <br>
using Npgsql;<br>
var conn = new NpgsqlConnection("Host=myHost;Username=myUser;Password=myPass;Database=myDb");<br>
conn.Open();<br>
var cmd = new NpgsqlCommand("SELECT myFunction()", conn);<br>
var result = cmd.ExecuteScalar();<br>
conn.Close();
| Is This Answer Correct ? | 0 Yes | 0 No |
What is psql command?
What is postgresql and pgadmin?
How does pgadmin connect to database?
What is special about postgresql?
What are the advantages of postgresql?
Is postgres is free?
Is postgresql like oracle?
How to delete/drop an existing postgresql database?
Do foreign keys speed up queries?
What is postgres process?
How to get the ddl of a table in postgresql?
How to find table creation date in postgresql?
Oracle (3253)
SQL Server (4518)
MS Access (429)
MySQL (1402)
Postgre (483)
Sybase (267)
DB Architecture (141)
DB Administration (291)
DB Development (113)
SQL PLSQL (3330)
MongoDB (502)
IBM Informix (50)
Neo4j (82)
InfluxDB (0)
Apache CouchDB (44)
Firebird (5)
Database Management (1411)
Databases AllOther (288)