How to call postgresql function in asp net?



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

Post New Answer

More Postgre Interview Questions

What is psql command?

1 Answers  


What is postgresql and pgadmin?

1 Answers  


How does pgadmin connect to database?

1 Answers  


What is special about postgresql?

1 Answers  


What are the advantages of postgresql?

1 Answers  


Is postgres is free?

1 Answers  


Is postgresql like oracle?

1 Answers  


How to delete/drop an existing postgresql database?

1 Answers  


Do foreign keys speed up queries?

1 Answers  


What is postgres process?

1 Answers  


How to get the ddl of a table in postgresql?

1 Answers  


How to find table creation date in postgresql?

1 Answers  


Categories