473,508 Members | 2,361 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

NHibernet insert query fails

390 Recognized Expert Contributor
Hi,

This is first time I am using Nhibernet.
This is how I have defined my xml file
<?xml version="1.0" encoding="utf-8" ?>
<hibernate-mapping xmlns="urn:nhibernate-mapping-2.2" default-lazy="false">

<class name="myVRM.DataLayer.vrmCustomAttributes, vrmDataLayer" table="Dept_CustomAttr_Option_D">

<id name="OptionID" column="OptionID" type="Int32" unsaved-value="0">
<generator class="identity" />
</id>
<!-- Map properties I'd like to persist/fetch, assume column = propery name, and type is determined by reflection -->
<property name="CustomAttributeID"/>
<property name="DeptID"/>
<property name="OptionType"/>
<property name="OptionID"/>
<property name="OptionValue"/>
<property name="Caption"/>
<property name="HelpText"/>
</class>
</hibernate-mapping>

Now my problem is when I am trying to enter a new record in table it does not takes the optionid as part of insert query and it fails.
Now if i remove the Id property from xml it gives me error because that is a mandotary field.

Please help me how to resolve this issue
Jun 23 '08 #1
3 1522
mzmishra
390 Recognized Expert Contributor
Forgot to add option id is a not null field and it should be unique for each cust id+option type cobination.

how can i modify the xml to make the insert successful
Jun 23 '08 #2
mzmishra
390 Recognized Expert Contributor
any idea how to do this.any one Nhibernet expert.please advice
Jun 23 '08 #3
Plater
7,872 Recognized Expert Expert
Try them? Nhibernet experts
Jun 23 '08 #4

Sign in to post your reply or Sign up for a free account.

Similar topics

4
2050
by: Randell D. | last post by:
Folks, I use PHP to write my form data to MySQL. I have a database with about ten tables. I'm trying to fill one table with some dummy data (its a contact manager table holding names of...
2
2106
by: JP SIngh | last post by:
I am having problems inserting data into a simple table Insert into Forums (Title, PageUrl, ContractId) Values ('54249', 'test01.asp',54249) Microsoft OLE DB Provider for SQL Server error...
3
1810
by: Ekhaat | last post by:
Hi I followed the Web Matrix guided tour and came to the "ASP.NET Pages with Data (Microsoft Access)" part. There is really not much you can do wrong there, but for some reason, the INSERT...
6
2597
by: Tom Allison | last post by:
I seemed to remember being able to do this but I can't find the docs. Can I run a sql query to insert new or update existing rows in one query? Otherwise I have to run a select query to see if...
3
6316
by: Bob Alston | last post by:
I have a routine to copy data to new versions of my app via insert into sql statements. Unfortunately, due to evolution of my app, sometimes the new version has more restrictive editing than an...
3
6876
by: Jacob Lyles | last post by:
Howdy, I'm a but of a newbie and I'd appreciate some help with a MySQL issue I'm having. I'm trying to insert some data into MySQL from a POST form but the query breaks whenever a user fails to...
9
3201
by: David Eades | last post by:
Hi all Complete newbie here, so apologies if this is the wrong forum. I've been asked to use mysql and asp to make a simple bidding system (rather like a simple ebay), whereby users can use a...
2
45849
by: mivey4 | last post by:
Okay I have 2 tables: Table A - holds a list of new hardware serial numbers and their corresponding model (no constraints or indexes) Table B - holds a distinct list of current serial numbers...
10
1620
by: Steve Kelley | last post by:
Hello all. I'm new to this group and I'm working on my first real VB.Net project. I'm having trouble creating and archive of a database. We use an Access database to store results from our...
0
7223
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
7115
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
7377
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
7036
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
7489
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
4705
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
3179
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1547
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
1
762
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.