-->
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.  [ 3 posts ] 
Author Message
 Post subject: What is the equivalent data type to use for Text/nText in c#
PostPosted: Wed Jul 25, 2007 4:41 am 
Newbie

Joined: Wed Jul 25, 2007 4:25 am
Posts: 1
Hibernate version: 1.0.3.0

SQL Server 2000:

The column (emp_comments) in my table is of datatype nText. What is the equivalent data type I should be using for my property in .Net C# code to map to this column.

Right now I am using String to map this column. See my code below

private string empComments;

public virtual string EmpComments {
get { return this.empComments; }
set {this.empComments=value;}
}

Thanks in advance.


Top
 Profile  
 
 Post subject:
PostPosted: Wed Jul 25, 2007 11:09 am 
Expert
Expert

Joined: Fri May 13, 2005 11:13 am
Posts: 292
Location: Rochester, NY
You should use string, but you need to specify type="StringClob" in the mapping file. See here.


Top
 Profile  
 
 Post subject:
PostPosted: Wed Jul 25, 2007 11:09 am 
Regular
Regular

Joined: Thu Nov 23, 2006 10:29 am
Posts: 106
Location: Belgium
String is the correct mapping type in your C# code file.

In the mapping file, you can declare an ntext field as a StringClob.
F.e.:

Code:
<property name="SomeProperty" column="SomeColumn" type="StringClob"/>

_________________
Please rate this post if it helped.

X.


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 3 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.