Hi,
I think there is a bug with the 2.5 Version of postgresqldirect.net mobile.
Everytime when I want to add the StateChange event to that connection, VS says, that it can't load the System.Data.StateChangeEventArgs even the System.Data is already added. I can compile it, but if I run it, it says the the assemblies is not yet loaded.
Statechange event
When I double click at the property windows from the connection to add the StateChange event.When exactly VS says, that it can't load the System.Data.StateChangeEventArgs?
I just have this code :When it says that the assemblies are not loaded yet?
Code: Select all
using System;
using System.Drawing;
using System.Collections;
using System.Windows.Forms;
using System.Data;
using CoreLab.PostgreSql;
namespace NpgsqlTest
{
///
/// Zusammenfassung für Form1.
///
public class Form1 : System.Windows.Forms.Form
{
private CoreLab.PostgreSql.PgSqlConnection pgSqlConnection1;
private System.Windows.Forms.MainMenu mainMenu1;
public Form1()
{
//
// Erforderlich für die Windows Form-Designerunterstützung
//
InitializeComponent();
this.pgSqlConnection1.Open();
}
///
/// Verwendete Ressourcen bereinigen.
///
protected override void Dispose( bool disposing )
{
base.Dispose( disposing );
}
#region Vom Windows Form-Designer generierter Code
///
/// Erforderliche Methode für die Designerunterstützung.
/// Der Inhalt der Methode darf nicht mit dem Code-Editor geändert werden.
///
private void InitializeComponent()
{
this.mainMenu1 = new System.Windows.Forms.MainMenu();
this.pgSqlConnection1 = new CoreLab.PostgreSql.PgSqlConnection();
//
// pgSqlConnection1
//
this.pgSqlConnection1.ConnectionString = "User Id=postgres;Password=postgres;Host=localhost;Database=test;Schema=public;";
//
// Form1
//
this.Menu = this.mainMenu1;
this.Text = "Form1";
}
#endregion
///
/// Der Haupteinstiegspunkt für die Anwendung.
///
static void Main()
{
Application.Run(new Form1());
}
}
}
PgSqlException
the assembly of the ressource can't be found.
But if I try to comment the
this.pgSqlConnection1.Open();
it run. There is something with the assembly path I think[/quote]
We reproduced the problem and now fixing it. Look forward to the next build.
To workaround this right now use the code like this:
To workaround this right now use the code like this:
Code: Select all
private void Form1_Load(object sender, System.EventArgs e) {
pgSqlConnection1.StateChange += new StateChangeEventHandler(pgSqlConnection1_StateChange);
}
private void pgSqlConnection1_StateChange(object sender, StateChangeEventArgs e) {
//do something
}