Hello forum
I'm working witj NHibernate.JetDriver in order to connect witj an Access97 database. When I want all articles into the database, NHibernate generates it --> SELECT this_.CODIGOARTICULO as CODIGOAR1_7_0_, this_.Description as Descript2_7_0_ FROM ARTICULOS this_
I've executed it as follow also ..>
Code:
try
{
System.Data.OleDb.OleDbConnection conn = new System.Data.OleDb.OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:/Documents and Settings/Jordi/Escritorio/Gestion.mdb;User Id=admin;Password=;");
conn.Open();
System.Data.OleDb.OleDbCommand command = new System.Data.OleDb.OleDbCommand("SELECT this_.CODIGOARTICULO as CODIGOAR1_7_0_, this_.Description as Descript2_7_0_ FROM ARTICULOS this_", conn);
System.Data.OleDb.OleDbDataAdapter adapter = new System.Data.OleDb.OleDbDataAdapter(command);
System.Data.DataTable taula = new DataTable("MER");
adapter.Fill(taula);
conn.Close();
this.LiniesGridControl.DataSource = taula;
}
catch (System.Exception ex)
{
System.Console.WriteLine(ex.Message);
}
But the same problem appears. I think that the problem appears with syntax generated. Can you help me please?
Log file-->
Quote:
[ SELECT this_.CODIGOARTICULO as CODIGOAR1_7_0_, this_.Description as Descript2_7_0_ FROM ARTICULOS this_ ]
[SQL: SELECT this_.CODIGOARTICULO as CODIGOAR1_7_0_, this_.Description as Descript2_7_0_ FROM ARTICULOS this_]
2007-10-23 09:20:40,544 FATAL 11 exceptions - TargetSite-->System.Collections.IList DoList(NHibernate.Engine.ISessionImplementor, NHibernate.Engine.QueryParameters)
2007-10-23 09:20:40,584 FATAL 11 exceptions - Source-->NHibernate
2007-10-23 09:20:40,584 FATAL 11 exceptions - There aren't parameters specified.
2007-10-23 09:20:40,604 FATAL 11 exceptions - TargetSite-->Int32 ExecuteCommandTextForSingleResult(System.Data.OleDb.tagDBPARAMS, System.Object ByRef)
2007-10-23 09:20:40,604 FATAL 11 exceptions - Source-->Microsoft JET Database Engine
2007-10-23 09:26:15,706 FATAL 10 exceptions - could not execute query
Configuration -->
Code:
props["hibernate.dialect"] = "NHibernate.JetDriver.JetDialect, NHibernate.JetDriver";
props["hibernate.connection.driver_class"] = "NHibernate.JetDriver.JetDriver, NHibernate.JetDriver";
props["hibernate.connection.connection_string"] = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:/Documents and Settings/Jordi/Escritorio/Gestion.mdb;User Id=admin;Password=;";
Mappings -->
Code:
<?xml version="1.0" encoding="utf-8" ?>
<hibernate-mapping xmlns="urn:nhibernate-mapping-2.2">
<class name="Model.Entities.Article, Model" table="ARTICULOS" mutable="false">
<id name="Code" column="CODIGOARTICULO" type="String" unsaved-value="-1">
<generator class="identity"/>
</id>
<property name="Description" type="String"/>
</class>
</hibernate-mapping>