Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dJpgN-0001cN-UN for pgsql-docs@arkaria.postgresql.org; Sat, 10 Jun 2017 23:20:40 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.84_2) (envelope-from ) id 1dJpgN-0007Gz-CX for pgsql-docs@arkaria.postgresql.org; Sat, 10 Jun 2017 23:20:39 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1dJpg0-0006bo-3n for pgsql-docs@postgresql.org; Sat, 10 Jun 2017 23:20:16 +0000 Received: from mail-io0-f179.google.com ([209.85.223.179]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.84_2) (envelope-from ) id 1dJpfu-0006J8-Ue for pgsql-docs@postgresql.org; Sat, 10 Jun 2017 23:20:15 +0000 Received: by mail-io0-f179.google.com with SMTP id k93so43871838ioi.2 for ; Sat, 10 Jun 2017 16:20:10 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:references:newsgroups:from :organization:message-id:date:user-agent:mime-version:in-reply-to :content-transfer-encoding; bh=vzg6jBnakvYwuIyQ1oGalUWtCqP53eBeRcx8aIVlvYs=; b=rOpZbtPfNYqiaMrjlVNdK3T2Gm1uqK6nzEmwKj9iQ2ip5CgsrqxnIQ2NMrxsOZtTIQ 3YcrxfVhENuSTpteSQ6gm7PeOoWnmpl7jescxsEslootdQPEQIjmaIadIDBxE3hFfUAD EY/MdUBqghBY+mw/V2oHlFMdMYb4PPsrCtUqzt9I3HwyVDOS9Oz+iAuzVliv3ZnbgckR N4BO3+xlsUQ1crf7E2/gGfNK32eI/zSrB1jrdfSCA09M3g6P6RGXZJpOGwR+xJerEcta J/CH++oKpgksTstYu0KEQLfGGkfA3ecHoI07Xqzxyh1HQdnekZbHEK6ecYBTalORWRJZ Yssw== X-Gm-Message-State: AKS2vOx5k75SFTZAlsH7k+bjfdmU8cYeCVYTz/kqMoSmBTXUfHaHUswo akeWDJrFvBErcm//2zM= X-Received: by 10.107.47.163 with SMTP id v35mr1613433iov.201.1497136808629; Sat, 10 Jun 2017 16:20:08 -0700 (PDT) Received: from [192.168.2.15] (toroon0817w-lp140-01-184-147-47-81.dsl.bell.ca. [184.147.47.81]) by smtp.gmail.com with ESMTPSA id 134sm1916773itm.12.2017.06.10.16.20.06 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sat, 10 Jun 2017 16:20:07 -0700 (PDT) Subject: Re: Problem about connect Postgre using ADO.NET To: NGUYEN TRONG LANH , pgsql-docs@postgresql.org References: Newsgroups: gmane.comp.db.postgresql.devel.documentation From: Neil Anderson Organization: Postgres Compare Message-ID: Date: Sat, 10 Jun 2017 19:20:08 -0400 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.12; rv:45.0) Gecko/20100101 Thunderbird/45.2.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-docs Precedence: bulk Sender: pgsql-docs-owner@postgresql.org On 2017-05-23 3:17 AM, NGUYEN TRONG LANH wrote: > Hello pgsql support team! > > At first, forgive me if the content of the email is not your > responsibility. I have problem when I try connect Postgre using ADO.NET, > I not see PostgreSQL in Data Source list. > > I have done to install Npgsql package, install Npgsql PostgreSQL > extension but the problem is not solve. Hi, I use Npgsql in my project. I'm not sure what you mean by 'I do not see PostgreSQL in Data Source list', Npgsql does not discover the server for you, you must provide it with a connection string, create a connection and execute commands. Here is a code example: var connString = "Host=localhost;Username=postgres;Password=passwrd;Database=postgres"; using (var conn = new NpgsqlConnection(connString)) { conn.Open(); // Insert some data using (var cmd = new NpgsqlCommand()) { cmd.Connection = conn; cmd.CommandText = "INSERT INTO data (some_field) VALUES (@p)"; cmd.Parameters.AddWithValue("p", "Hello world"); cmd.ExecuteNonQuery(); } // Retrieve all rows using (var cmd = new NpgsqlCommand("SELECT some_field FROM data", conn)) using (var reader = cmd.ExecuteReader()) while (reader.Read()) Console.WriteLine(reader.GetString(0)); } For future reference Npgsql have wonderful documentation here http://www.npgsql.org/index.html, and they prefer questions be posted to Stack Overflow. -- Neil Anderson neil@postgrescompare.com http://blog.postgrescompare.com -- Sent via pgsql-docs mailing list (pgsql-docs@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-docs