.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Win Surprise Gifts!!!

Top 5 Contributors of the Month
Gaurav Pal
Post New Web Links

populate two ddl with one xml file.

Posted By:      Posted Date: May 22, 2011    Points: 0   Category :ASP.Net

I am trying to populate two drop down lists with one xml file...  Here is an example of what I want to do....

xml example...

    <item name="testA" disc="nice">
        <product name="big" price="15.00">
        <product name="small" price="7.50">
    <item name="testB" disc="good">
        <product name="big" price="15.00">
        <product name="small" price="7.50">

I want one drop down list populated with the items.  This I have just a basic xmlDataSource.  My issue is trying to get the second drop down list populated with the products for the selected item.  I hope this is as clear as mud, any help would be appreciated.


View Complete Post

More Related Resource Links

Populate Form Control from xml File -- Easy way--please

Hi All,Is there any easy way to populate control on .net page using xml file? I have below xml file and i need to generate control accordingly using VB language. <dive id="div1" title="genera information" > <fieldgroup id="iduser" title="User Information"> <field id="txtusername" title="UserName" type="Text" maxval="14"> </field> <field id="txtpws" title="passwprd" type="Text" maxval="14"> </fieldgroup> <fieldgroup id="pinfo" title="Personal Info"> <field id="idsex" title="Select Sex" type="Choice"> <option id="1" value="Male"></option> <option id="2" value="Female"></option> <option id="3" value="Other"></option> </field> <field id="idcomb" title="Country" type="Combo"> <option id="1" value="China"></option> <option id="2" value="India"></option> <option id="3" value="Nepal"></op

Populate a Data Flow Task's variables with values from a .dtsConfig file?

I have an SSIS Project to import exchange rates from an XML file into SQL. The project works when I have certain values hard-coded into variables, such as the URL of the XML File, proxy username and passwords etc. I decided to put in a .dtsConfig file, and have it update the values of the variables in the data flow task. So, one of my SSIS Packages in this solution is called ECBDailyRates.dtsx. It contains one control flow, which is a data flow task. The data flow task is a script task which does some XPATH on an XML file, and then provides outputs to an OLE DB Destination, which in turn puts the data into a table in SQL. That much worked before I put in the dtsConfig file. There are a few variables declared inside the data flow task, such as; PricesXMLUriDaily, String ProxyAddress, String ProxyAddressPort, Int32 etc. etc. These are now being updated from the dtsConfig, which is below. It was my understanding that SSIS would run through the config, and update any of the variables as required, and then run my data tasks. However when SSIS runs my script task, none of the variables have been populated, and so it falls over... as it were :) <?xml version="1.0"?> <DTSConfiguration> <DTSConfigurationHeading> <DTSConfigurationFileInfo GeneratedBy="...." GeneratedFromPackageName="dim_Institution" GeneratedFromPackageID="

populate a listbox from an xml file.

Hello, I want to populate a listbox with data from an xml file, but i only want to populate it with 2 ElementTagNames (id and name).  each item will have 2 values an id and a name and then on selectedindex i will call another class to do some other tasks based on the id of the item.  I want both of them because i want to display the name and use the ID to do some data manipulation. Here is what i come up with up untill now. I can only get one single ElementTagName per item.  XmlTextReader reader = new XmlTextReader("xmlfile"); XmlDocument XMLdoc = new XmlDocument(); XMLdoc.Load(reader); XmlElement RootNode = XMLdoc.DocumentElement; XmlNodeList nodeList = RootNode.GetElementsByTagName("Name"); int i; for (i = 0; i <= nodeList.Count - 1; i++) { lbox_Choices.Items.Add(nodeList.Item(i).InnerText); } XMLdoc = null;    

Populate ASP Table from Text File


Hey Guys, new developer here. I'm trying to populate a ASP table dynamically. This is what I'm trying to do.

I have table with 1 row and 4 cells. I want to import information from a text file into the various cells. Each line of the text file is what I want to go into each cell.

For example if the text file reads:





I want each line to go into each cell. Is this possible, or will I need to create a SQL Server table and read from that? THANKS!

Need to populate more than two dropdowns from xml file

How to populate more than 2 drop downs using xml file. The dropdowns contains different data.

New To SQL - need to populate a table from a TXT file


i am trying to populate a table from a txt file

this is the query i wrote

USE [Resolution & Ordenances]
INSERT INTO Resolutions (ResolutionID,ResolutionDate,ResolutionDescription)
OPENROWSET('MSDASQL', 'Driver={Microsoft Text Driver (*.txt; *.csv)};

i am getting an error msg

OLE DB provider "MSDASQL" for linked server "(null)" returned message "[Microsoft][ODBC Driver Manager] Data source name not found and no default driver specified".
Msg 7303, Level 16, State 1, Line 1
Cannot initialize the data source object of OLE DB provider "MSDASQL" for linked server "(null)".

any idea ?



File Splitter in .Net

I love to do utility programs in .Net. And this is one of them. As I was playing with JSplit (a free file splitter program), I wondered if I could do it in .Net. The framework supports file operations like reading files in bytes and creating them. It is indeed easy to do file operations in .Net Basics on File operations

Upload Multiple File using JQuery in asp.net

In this article I have explained how to upload multiple files using file upload control. I have used jQuery plugin for uploading multiple files.

I have also explained how to check for file type, file maximum size limit using jQuery & also using server side validation code.

Creating Excel file from C#

I used below coding for create a excel sheet.I got from on web site.
In below coding there is no problem.Its create the excel file.If i run second time,its ask to overwrite the current excel file.If I said "Yes" then it ok ,but If I select cancel button,its generate the Error message.The exception is

Upload a File to a SharePoint Document Library - Part I

The following helper class demonstrates a few techniques that allow documents to be uploaded to a SharePoint document library programmatically without using the API or a custom web service. You don't need to specify a document library name, and it will create any folders specified in the URL as required. File meta data will be updated if any properties are passed.

SmtpClient and Locked File Attachments

Got a note a couple of days ago from a client using one of my generic routines that wraps SmtpClient. Apparently whenever a file has been attached to a message and emailed with SmtpClient the file remains locked after the message has been sent. Oddly this particular issue hasn't cropped up before for me although these routines are in use in a number of applications I've built.

How to call an .exe file in .net

Sometimes a developer has to call an EXE from another EXE. While calling EXE there can be a requirement to pass parameter.

ClientAccessPolicy file in SharePoint 2010

I am upgrading my Silverlight demo code from the old beta to beta 2 and see that there are a few new considerations for the deployment of ClientAccessPolicy.xml files. In a previous post I demonstrated how to do this for SharePoint 2007. The heartburn that I get with that approach is any site collection owner or designer can drag the file into the site collection and open the site up to unwanted client access issues. In 2010 the virtual path provider no longer serves the files from the root of the site collection

Multi File Upload Using JQuery!

Everyone knows about the file upload in .NET. But the multi file upload is some what difficult in .NET. For that purpose we can have some AJAX or JQuery!. Jquery is the latest advanced version. It will give some animated upload. You can try it for your own!!!!

Transfering a file from Conputer to PDA

You can transfer one file at a time between your computer and another Bluetooth device by using the Bluetooth File Transfer Wizard. For example, you can transfer files between your computer and a mobile phone or a PDA. You can also transfer files between two computers that use Bluetooth.

The Free Barcode Creator produces barcode images one at a time, and allows easy saving to a file or

The Free Barcode Creator produces barcode images one at a time, and allows easy saving to a file or pasting into an application. 2D versions are also available:

Import XML File to SQL Table

Here is a brief example of importing an XML file into SQL Server table. This is accomplished by using the BULK option of OPENROWSET to load the file, and then utilizing the XQuery capabilities of SQL Server to parse the XML to normalized table format. This example requires SQL server 2005 or SQL Server 2008.

First, the following XML is saved to XML file C:\Products.xml.
ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  Silverlight  Others  All   

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend