473,396 Members | 2,018 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

Help with DataRow error

Hi,

When trying to add a data row to a data table I get a
"System.ArgumentException: This row already belongs to another table."
error. I have tried using ImportRow instead but with no joy. If
anyone can find a solution to this it would be greatly appreciated.
My code is below. It error on the following line:
qi.AllRisksCover.AddAllRisksCoverRow(GetAllRisksCo ver(risk,
phraseBook));

Confused.HomeInsurance.BOB.HomeInsurer.ISISService .QuoteInput qi = new
Confused.HomeInsurance.BOB.HomeInsurer.ISISService .QuoteInput();

//Add all risk cover to quoteinput table
qi.AllRisksCover.AddAllRisksCoverRow(GetAllRisksCo ver(risk,
phraseBook));

private QuoteInput.AllRisksCoverRow GetAllRisksCover(Risk risk,
PhraseBook phraseBook)
{
QuoteInput.AllRisksCoverDataTable dt = new
QuoteInput.AllRisksCoverDataTable();
QuoteInput.AllRisksCoverRow ar = dt.NewAllRisksCoverRow();

if (risk.CoverType !=
Confused.HomeInsurance.DataContracts.Enumerations. CoverType.BuildingsOnly)
{
ar.ID = 1;
ar.ProspectID = 1;
ar.PhotoTotalValue = (int)totalValue;
ar.PhotoHighestValue = highestValue == null ? 0 :
(int)highestValue;
ar.ValuablesTotalValue =
risk.Contents.TotalHighRiskLimit == null ? 0 :
(int)risk.Contents.TotalHighRiskLimit;
}

ar.ValuablesTerritory = "UK";
//Defaulted to UK.
ar.PhotoTerritory = "UK";
//Defaulted to zero as we do not hold this value
ar.SportsTotalValue = 0;
//Defaulted to zero as we do not hold this value
ar.SportsHighestValue = 0;
//Defaulted to UK.
ar.SportsTerritory = "UK";
//Defaulted to zero as we do not hold this value
ar.CashValue = 0;
//Defaulted to UK.
ar.CashTerritory = "UK";
//Defaulted to zero as we do not hold this value
ar.CardValue = 0;
//Defaulted to UK.
ar.CardTerritory = "UK";
//Defaulted to zero as we do not hold this value
ar.FreezerValue = 0;
//Defaulted to zero as we do not hold this value
ar.AgeOfOldestFreezer = 0;
//check if personal belongings cover

}

return ar;

}
Sep 29 '08 #1
0 932

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Anita C | last post by:
Hi, How do I associate or map a specific column in a datatable to a particular element present in an xml document - to read into a datatable as well as write from the datatable to the xml element?...
0
by: john | last post by:
Hi,All MS Tech Gurus: I need your help!!! It is the second time I post this message, I need get some feedback ASAP, Please Help!! Thanks a lot in advance. John I have a csharp method, using...
3
by: News | last post by:
Hi, I wrote a function that pulls a record, below: ++++++++++++++++++++++++++++++++++++++++ Public Function getServPlanProgActivity( serviceprogramenroll_id As Integer, activity_id As Integer )...
0
by: muralidharan | last post by:
WebForm1.aspx Code: <%@ Register TagPrefix="ComponentArt" Namespace="ComponentArt.Web.UI" Assembly="ComponentArt.Web.UI" %> <ComponentArt:TreeView id="TreeView1" Height="520"...
5
by: sdettmers | last post by:
Hi, Database: SQL Server Session: SQL Server Language: C# Application: ASP.Net I have created a login page which attempts to retrieve the users record from the database and I...
10
by: mcbobin | last post by:
Hi, Here's hoping someone can help... I'm using a stored procedure to return a single row of data ie a DataRow e.g. public static DataRow GetManualDailySplits(string prmLocationID, string
4
by: leaf0209 | last post by:
Hi, I am new to this forum and have been troubled by this problem for the past few days. I would appreciate if someone would take a look and help me out. I am using vb express 2005 edition... ...
0
by: dalaimanoj | last post by:
Hi experts, I have a form in which there are 4 textboxes and few command buttons like New, View, Save, Delete. I want to insert the values entered in textboxes are to be stored in an Oracle...
1
by: palmah11 | last post by:
Hi, I have a Windows Application in which i am using Janus GRidEx for displying data. In this Janus Grid i have a check box column. i want a functionality if user selects checkbox for particula...
2
by: Paulo | last post by:
DataRow dr = (DataRow)ds.Tables.Rows.ItemArray; Error 1 Cannot convert type 'object' to 'System.Data.DataRow' C:\Documents and Settings\Fabio\Meus documentos\Visual Studio...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
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
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
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
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

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.