Re: Problema al conectar con Npgsql

From: Dan <danstreet(at)gmail(dot)com>
To: "Pablo Febolo" <pfebolo(at)yahoo(dot)com>
Cc: "[ n e x o ]" <nexo(dot)oxen(at)gmail(dot)com>, pgsql-es-ayuda(at)postgresql(dot)org
Subject: Re: Problema al conectar con Npgsql
Date: 2006-11-23 16:11:15
Message-ID: 6f2857c50611230811w29104e3cm8f2e51d761e7a37f@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-es-ayuda

hola, estoy usando Visual Studio 2005 , framework 2.0 y me funciona
perfecto, espero te sirva este ejemplo.

Private sConnString as string =
"Server=mihost;Database=mibase;Uid=postgres;Pwd=mipassword;"

Private strSql as string = "SELECT * FROM tabla"

Dim Cn As NpgsqlConnection
Dim dsGrid As DataSet = New DataSet
Dim MyAdapter As New NpgsqlDataAdapter

Try

Cn = New NpgsqlConnection(sConnString)

MyAdapter = New NpgsqlDataAdapter(strSql, Cn)
MyAdapter.FillSchema(dsGrid, SchemaType.Source, "tabla")
MyAdapter.Fill(dsGrid, "tabla")

With dgvSel
.AutoGenerateColumns = True
.DataSource = dsGrid
.DataMember = tabla
End With

Catch ex As Npgsql.NpgsqlException
TextBox1.Text = "Mensaje: " & ex.Message & vbCrLf
End Try

In response to

Browse pgsql-es-ayuda by date

  From Date Subject
Next Message Alvaro Herrera 2006-11-23 16:16:43 Re: Imágenes en la Base de Datos
Previous Message Alvaro Herrera 2006-11-23 16:09:11 Re: Cambio de directorio de Bases de Datos