using Npgsql; NpgsqlConnection conn = new NpgsqlConnection(""); conn.Open(); // some database operations conn.Close();
using Npgsql; using (NpgsqlConnection conn = new NpgsqlConnection("In this example, we create a NpgsqlConnection object using the using statement that disposes of the object when it goes out of scope. The connection is opened, some database operations are performed, and then the connection is automatically closed when the using statement is exited. Both examples use the Npgsql package library.")) { conn.Open(); // some database operations }
public Close ( ) : void | ||
return | void |