-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 4 posts ] 
Author Message
 Post subject: type 'System.Data.IDbConnection' is defined in an assembly
PostPosted: Thu Mar 22, 2007 7:39 pm 
Newbie

Joined: Thu Mar 22, 2007 7:32 pm
Posts: 2
Hibernate version:
Nhibernate 1.2.0

Name and version of the database you are using:
n/a have not even got code to compile

I've got a PocketPC 2003 project in Visual Studio 2005. When I try to compile some code using NHibernate, I get this compiler error

The type 'System.Data.IDbConnection' is defined in an assembly that is not referenced. You must add a reference to assembly 'System.Data, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089'.

The code looks like

ISessionFactory sessionFactory;
sessionFactory = new Configuration().Configure().BuildSessionFactory();
ISession session = sessionFactory.OpenSession();
ITransaction tx = session.BeginTransaction();
NativeMeaningEntity princess = new NativeMeaningEntity();
princess.nativemeaningshort = "animal that growls";
session.Save(princess);
tx.Commit();

session.Close(); <<<<<<<<<<<<<<<<<<<<<
sessionFactory.Close();

The line with the error is marked with <<<<<<<<< above. The project has a reference to the assembly

C:\vs8\SmartDevices\SDK\CompactFramework\2.0\v2.0\WindowsCE\System.Data.dll

I'm new to .NET programming. I've been doing Java for 5+ years.

Thanks for any advice.

Sincerely,
Brian


Top
 Profile  
 
 Post subject:
PostPosted: Fri Mar 23, 2007 1:22 am 
Regular
Regular

Joined: Sun Jan 21, 2007 4:33 pm
Posts: 65
You have the following in your using; directives?

using System.Data;

If that doesn't work, go to 'References' under your solution explorer and make sure System.Data is added as a reference in your project.


Top
 Profile  
 
 Post subject:
PostPosted: Fri Mar 23, 2007 6:01 am 
Newbie

Joined: Thu Mar 22, 2007 7:32 pm
Posts: 2
Gortok wrote:
You have the following in your using; directives?

using System.Data;

If that doesn't work, go to 'References' under your solution explorer and make sure System.Data is added as a reference in your project.


Yes, I have the "using System.Data;". As for the 'References', the project already had a reference to C:\vs8\SmartDevices\SDK\CompactFramework\2.0\v2.0\WindowsCE\System.Data.dll .

I just did a couple of other tests.
Test #1 extracted the public key tokens. The Compact Framework framework System.Data.dll

C:\>sn -Tp
C:\vs8\SmartDevices\SDK\CompactFramework\2.0\v2.0\WindowsCE\System.Data.dll
Microsoft (R) .NET Framework Strong Name Utility Version 2.0.50727.42
--snip--
Public key token is 969db8053d3322ac

versus the desktop framework System.Data.dll

C:\>sn -Tp C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\System.Data.dll
Microsoft (R) .NET Framework Strong Name Utility Version 2.0.50727.42
--snip--
Public key token is b77a5c561934e089

Test #2 I tried replacing the Compact Framework System.Data.dll with the C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\System.Data.dll. That resolved the error but introduced lots of others just like it.

Does NHibernate support the .NET Compact Framework?

Brian


Top
 Profile  
 
 Post subject:
PostPosted: Fri Mar 23, 2007 6:25 am 
Contributor
Contributor

Joined: Wed May 11, 2005 4:59 pm
Posts: 1766
Location: Prague, Czech Republic
No, it doesn't support Compact Framework. And even if it did, you would have to have assemblies specifically built for .NET CF, you can't just use normal .NET 2.0 assemblies.


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 4 posts ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.