473,320 Members | 2,094 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,320 software developers and data experts.

Populating repeating tables via c#

Hi All,

I am currently trying to do the following:
1. insert a value into a repeating table from a drop-down list( secondary
storage) when the user click the "Add" button positioned next to the drop
down list

<snip>
IXMLDOMNamedNodeMap nnm, dataAttrs;
string sCode;
string sDesc;
sCode =
thisXDocument.DOM.selectSingleNode("/TEST_FORM/Test_Information/Individual_Test/Test_Code").text ;
sDesc =
thisXDocument.DOM.selectSingleNode("/TEST_FORM/Test_Information/Individual_Test/Test_Description").text ;
DOMNodeList rowList = thisXDocument.DOM.selectNodes("//Test_Requests");
thisXDocument.View.ExecuteAction("xCollection::ins ert", "Test_Requests_2");

// Refresh rowList due to new rows
rowList = thisXDocument.DOM.selectNodes("//Test_Requests");
// Fill the main table
nnm = rowList.nextNode().attributes;
nnm.nextNode().nodeValue = "";
nnm.nextNode().nodeValue = sCode;
nnm.nextNode().nodeValue = sDesc;
2. insert a x number of rows into a repeating tables from another repeating
table.
<snip>

IXMLDOMNamedNodeMap nnm, dataAttrs;
// Set namespace so that xpath will work - xpathNsStr lists all relevant
namespaces

DOMNodeList dataList = thisXDocument.DOM.selectNodes("//Group_Tests");
DOMNodeList rowList = thisXDocument.DOM.selectNodes("//Test_Requests");

//Add new rows to your table to adapt to datarows from the web service
for (int i = 0; i < (dataList.length - rowList.length); i++)
{
thisXDocument.View.ExecuteAction("xCollection::ins ert", "Test_Requests_2");
}

// Refresh rowList due to new rows
rowList = thisXDocument.DOM.selectNodes("//Test_Requests_2");

for (int i = 0; i < dataList.length; i++)
{
IXMLDOMNode dataNode = dataList.nextNode();
dataAttrs = dataNode.attributes;
string sGrpCode = dataAttrs.getNamedItem("Group_Test_Code").text;
string sCode = dataAttrs.getNamedItem("Test_Code").text;
string sDesc = dataAttrs.getNamedItem("Test_Description").text;

// Fill the main table
nnm = rowList.nextNode().attributes;
nnm.nextNode().nodeValue = sGrpCode;
nnm.nextNode().nodeValue = sCode;
nnm.nextNode().nodeValue = sDesc;
}

However, I cant seem to get sCode and sDesc in part(1) and if i subsituted
the values with hard-coded one, the system only populate one row and did not
work when i tried to add more by clicking the button "Add".

Do anyone know why? Any help is greatly appreciated!
Nov 16 '05 #1
0 2816

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

Similar topics

0
by: amber | last post by:
I've been trying to figure out how to get 2 datasets to populate a report/subreport - and I think I'm on the right track...just having a few problems somewhere... I have created a dataset (.xsd)...
2
by: Alpha | last post by:
I have a C# program that user would select several search criteria and then outputs to the Crystal Report. A message is output to user if no matching record is found. In my code I also clear,...
0
by: gerry | last post by:
I want to populating an asp list box from a simple access lookup list (single column not a table.)I don't want to create tables just for lookups as the values will be descriptive only and will...
6
by: Chris Leuty | last post by:
I am populating a multiselect Listbox from a dataset, with the content of the listbox filled by one table, and the selections determined from another table. So far, I have been keeping the dataset...
11
by: Christoph Boget | last post by:
When building a form using Infopath, you can define a repeating section and stick form fields in that section. I'm curious if ASP.NET has a similar control to make it easy to design something...
2
by: John Ninan | last post by:
I am creating Dynamic Usercontrol in Asp.net application. In this application I have a combobox(aspx Page). Which contains various items. Based on item selected I am dynamically populating...
6
by: p.mc | last post by:
Hi all, I have a MS SQLServer database which has two tables, 'images' and 'photographers'. The photographer table contains a field for PhotographerID and a one for PhotographerName. The image...
6
by: Chris W | last post by:
I wonder if anyone out there can help me. I have the following code: http://pastebin.com/746601 The field 'material' in 'is_material' contains multiple values for each record in 'is_details'....
2
by: Griff | last post by:
I want to display a repeating set of formatted infomation that appears within a "box" so that the individual boxes appear to the right of the previous one until the line is filled and then the next...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 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 former...

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.