PPC + wlan --> Connectionproblem

Discussion of open issues, suggestions and bugs regarding ADO.NET provider for PostgreSQL
Post Reply
donnyriyadi

PPC + wlan --> Connectionproblem

Post by donnyriyadi » Wed 25 May 2005 10:44

Hi,
I'm now trying to use pgsql DA on the CF.
If the Wlan connection is broken, and I cannot send any query anymore. What should I do, so that I can be connected automatically again ?
Thanks.

Yuri
Posts: 140
Joined: Mon 08 Nov 2004 12:07

PPC + wlan --> Connectionproblem

Post by Yuri » Fri 27 May 2005 08:34

There is no way to connect automatically. You should reconnect after an exception has been thrown.

Code: Select all

try {
        pgSqlDataAdapter.Fill(dataSet, "Table");  // pgSqlDataAdapter.SelectCommand.Connection.State ==  ConnectionState.Open
        dataGrid.DataMember = "Table";

      }
      catch {
        pgSqlDataAdapter.SelectCommand.Connection.Open();
        pgSqlDataAdapter.Fill(dataSet, "Table");
        dataGrid.DataMember = "Table";
      }

Post Reply