473,793 Members | 2,927 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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>
IXMLDOMNamedNod eMap nnm, dataAttrs;
string sCode;
string sDesc;
sCode =
thisXDocument.D OM.selectSingle Node("/TEST_FORM/Test_Informatio n/Individual_Test/Test_Code").tex t ;
sDesc =
thisXDocument.D OM.selectSingle Node("/TEST_FORM/Test_Informatio n/Individual_Test/Test_Descriptio n").text ;
DOMNodeList rowList = thisXDocument.D OM.selectNodes( "//Test_Requests") ;
thisXDocument.V iew.ExecuteActi on("xCollection ::insert", "Test_Requests_ 2");

// Refresh rowList due to new rows
rowList = thisXDocument.D OM.selectNodes( "//Test_Requests") ;
// Fill the main table
nnm = rowList.nextNod e().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>

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

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

//Add new rows to your table to adapt to datarows from the web service
for (int i = 0; i < (dataList.lengt h - rowList.length) ; i++)
{
thisXDocument.V iew.ExecuteActi on("xCollection ::insert", "Test_Requests_ 2");
}

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

for (int i = 0; i < dataList.length ; i++)
{
IXMLDOMNode dataNode = dataList.nextNo de();
dataAttrs = dataNode.attrib utes;
string sGrpCode = dataAttrs.getNa medItem("Group_ Test_Code").tex t;
string sCode = dataAttrs.getNa medItem("Test_C ode").text;
string sDesc = dataAttrs.getNa medItem("Test_D escription").te xt;

// Fill the main table
nnm = rowList.nextNod e().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 2836

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

Similar topics

0
965
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) consisting of 2 tables - one is coming from a table in SQL, the other from a view. The 1st table is populating correctly , but the 2nd isn't. I'm assuming I can't populate my dataset twice and have it work properly. Am I even on the right...
2
3108
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, removed and dispose of the table in the dataset that was used which should have nothing in it any way. I then clean up the search string that I built at run time. Now in the same screen, user change one of the search criteria and now there are...
0
1457
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 never change. What would be the command to rerieve these single column lookups in ASP script? Or do I have to create access tables just to hold these static lookup values?
6
2883
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 a denormalized mirror of the database, but I'm not having much luck getting the selection logic down (I haven't found a 'hook' where I can access the listbox object as an object to set the listitem's selected property before it gets rendered).. ...
11
4164
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 similar using just ASP.NET (and not Infopath)? I'd hate to think that I'll need to write all the javascript/dhtml to mimic that functionality and I don't really feel the need to re-invent the wheel. Has MS designed such a control? A 3rd party? ...
2
3346
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 Usercontrols. Problem: When I am populating dynamic user control (ascx) page in Page_load event it works fine for the first list item from combobox. When I change the item in combobox, usercontrols are build properly but value will be same in second...
6
14313
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 table also contains a field for photographerID which is used to join the two tables. I'm having problems with populating a dropDownList using the complete set of photographerNames and IDs from the 'photographer' table but
6
1748
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'. Because of this I have used 'is_material_lookup' as a reference lookup table containing the 'style_code' and 'material_code' which refer to their full details in the respective tables.
2
1613
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 one goes onto the following line. Just like "text flow". Each "box" will contain an image and some "formatted" text, possibly held in a small table or something similar (depends what I get to work). Picture something like a business card. ...
0
9670
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9518
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10430
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
10159
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
6776
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 then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5436
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5560
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4111
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 we have to send another system
3
2917
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.