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


Top 5 Contributors of the Month
david stephan
Santhakumar Munuswamy
Asad Ali
Fauzul Azmi
Post New Web Links

select particular field from xml file

Posted By:      Posted Date: October 27, 2010    Points: 0   Category :ASP.Net
 

Hi friends this is my xml file


<?xml version="1.0" encoding="utf-8" ?>
<Employees>
  <Employee>
    <Id>100</Id>
    <Name>arun</Name>
    <Dept>Electrical</Dept>
    <dtdate>12-05-2010 </dtdate>
  </Employee>
  <Employee>
  <Id>101</Id>
  <Name>Aji</Name>
  <Dept>Computer</Dept>
    <dtdate>13-05-2010 </dtdate>
  </Employee>
  <Employee>
  <Id>102</Id>
  <Name>Kiran</Name>
  <Dept>civil</Dept>
    <dtdate>14-05-2010 </dtdate>
  </Employee>

</Employees>


i want to display records of employee with id=100.


i tried this example

XmlDocument xmlDoc = new XmlDocument();
        xmlDoc.Load(Server.MapPath("Employee.xml"));
        DataSet ds = new DataSet();
        ds.ReadXml(xmlDoc.SelectNodes("//Employees//Employe


View Complete Post


More Related Resource Links

Problems creating a BDC file that use a unique select statment

  

I'm trying to build an BDC file that will pull information back from two tables in an Oracle database, I can import it without any errors, but then it tells me I do not have a filter when I try and select an item.  When I add a filter I get an error when I import the file.  The error I get is the following.
"Application definition import failed. The following error occurred: The IdentifierName Attribute of the TypeDescriptor named 'TestDate' of the Parameter named ':TestDate' of the Method named 'Get_TestTwelve_List' of the Entity named 'TestTwelve' does not match any of the defined Identifiers for the Entity. Error was encountered at or just before Line: '133' and Position: '16'."

Here is the section of

      <Property Name="RdbCommandText" Type="System.String"><![CDATA[

select of X items in a single field

  
Hi! I've a select like this:select fieldA,fieldBfrom tablebut fieldB must be a list of items of another table:something like this:select fieldA, (select itemA from table2 where idref = table.id) AS fieldB from tableI need to show in fieldB a list of items (X records) returned from my second SELECT with a "-" for separate X fieldsI should show in fielB this:itemA - itemB - item C - item Dis it possible?Thanks

How to select data from xml file

  
Hi, I have the xml file below....<?xml version="1.0" encoding="utf-8"?> <feed xmlns="http://www.w3.org/2005/Atom" xmlns:g="http://base.google.com/ns/1.0"> <Title>Products</Title> <link rel="self" href="localhost" /> <updated>01-09-2010T11:42:47Z</updated> <author> <Name>Yasmin</Name> </author> <id>tag:localhost,1-9-2010:/support/products</id> <entry Prd_ID="222" Cat="Hell" Type="0" xmlns="http://www.w3.org/2005/Atom"> <id>222</id> <title>Hell is here</title> </entry> <entry Prd_ID="220" Cat="Hell" Type="0" xmlns="http://www.w3.org/2005/Atom"> <id>222</id> <title>heaven2222 is here</title> </entry> <entry Prd_ID="221" Cat="Hell" Type="1" xmlns="http://www.w3.org/2005/Atom"> <id>222</id> <title>heaven is here</title> </entry> </feed> I want to select all nodes with entry[@type=0] and display the first childnode in response.write but dont know how to do it plz help .......   Thanks, Yasmin

Flat file upload: Error when inserting into datetime field.

  
Hi All I am having an issue with uploading a txt file into an SQL table and one of the fields needs to go into a datetime column. The issue is with column3 I have been into the advanced editor of the flat file source and set the output column to decimal and it fails. The error I am getting is below: Error: 0xC02020A1 at Materials Transfer, Flat File Source [1]: Data conversion failed. The data conversion for column "Column 3" returned status value 2 and status text "The value could not be converted because of a potential loss of data.". Error: 0xC0209029 at Materials Transfer, Flat File Source [1]: SSIS Error Code DTS_E_INDUCEDTRANSFORMFAILUREONERROR.  The "output column "Column 3" (48)" failed because error code 0xC0209084 occurred, and the error row disposition on "output column "Column 3" (48)" specifies failure on error. An error occurred on the specified object of the specified component.  There may be error messages posted before this with more information about the failure. Error: 0xC0202092 at Materials Transfer, Flat File Source [1]: An error occurred while processing file "D:\Development\r3_downloads\mat.txt" on data row 1. Any help would be great.   Thanks BigGopher

Writing to excel file - The field is too small to accept the amount of

  

Hi

I am writing to excel file using jet driver. If the length of value exceeds 255 characters i get the below error.

'The field is too small to accept the amount of data you attempted to add.  Try inserting or pasting less data'

Please could you provide a solution to how can i add values with length greater than 255. Excel file is 97-2003 format.

System.Data.OleDb.OleDbCommand command = new System.Data.OleDb.OleDbCommand();
 
 System.Data.OleDb.OleDbConnection connection =
          new System.Data.OleDb.OleDbConnection(
              "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" + destinationFilePath + ";Extended Properties=Excel 8.0;");
 
command.CommandText = "Insert into [sheet1$] (col1, col2) values ('1', 'TEXT Message greater than 255 characters')
 

Cannot upload file : 'You must specify a value for the required field'

  

Hi,

In any web app, any Sharepoint site, and any document library in my farm (WSS 3.0, Sharepoint Designer 2007), I can't upload any file :

I can select my file in my hard drive with the browse button, but when I click OK button, I get this message :

'You must specify a value for the required field '

I think it's a required field which is hidden : I found 2 required fields, description and name (name is the file path so is mandatory). Changing description's required property didn't solve the problem.

I made a lot of change in a lot of file such as customization and configuration.

Replacing upload.aspx and application.master files with files from a working farm didn't solve the problem too...

However I don't have any problem when adding attachments in announcements ...

Having a Sharepoint site where you can't upload any file in a library is a big problem and I don't find any solution !

Thanks in advance.


Select statement with two group level to create addtional field.

  

Here is an example of my question

I have  a column called Department, a column called Employee Name and a column called EmployeeAbsent.

Obviously i can easily use a select satement to get each employee's absent status. However, I would like to generate an additional field called DepartmentAbsent to see if anyone in a particular depart is absent based on the EmployeeAbset field.

how should I write the query?


select specific field from DB

  

how to select  a specific field data from DB

using  HQL   ,  working with Nhibernate    with C#.net


Additional " mark at the end of field (CSV file to SQL table) - URGENT

  

Hi All,

 

I have a csv file which I am loading into a sql table and for some reason it is leaving a " mark at the end of one of the fields.  I cannot seem to get rid of it and need some urgent help as the data is needed immediately!

 

When I look at the source CSV file in notepad it looks like this:

92|"ITEMS FOR DELETION"|36|"ORGANIC BEEF SET"|6001056858861|"B/SNACK DGSTV CARAME"

42|"BISCUITS"|2|"BRANDED SAVOURY"|5410041001204|"TUC SALT"

42|"BISCUITS"|99|"ELIMINATED"|6009171986766|"Cherry + Orange Bisc"

42|"BISCUITS"|99|"ELIMINATED"|6009171986773|"Nut + Fruit Biscuits"

92|"ITEMS FOR DELETION"|36|"ORGANIC BEEF SET"|6009171987909|"Choc Biscuit Creams"

 

So you can see that Ints are not qualified and text is qualified with double quotations, all fields are pipe seperated.

My CSV connection in SSIS is set as follows:

Format = Delimited

Text qualifier = "

Header row delimiter {CF}{LF}

Header rows to skip = 0

No column names in first data row

Row delimiter {LF}

Column delimiter {|}

 

Once the data is in SQL I get the following:

In Crystal Reports selection formulas/select expert with formula field and parameter field together

  

I have this report that does not yield the same output from my crystal reports to ssrs due to below selection formula.  Any help would be much appreciated.

Is there any workaround on this combined formula of parameter and formula field i.e {@HomeCo} in {?Company}

@HomeCo as being ...

if isnull({VP_TIMESHEET.LABLEVELNAME4})=true or {VP_TIMESHEETITMV42.LABLEVELNAME4} = "00000"
    or isnull({VP_TIMESHEET.LABLEVELNAME5})=true or {VP_TIMESHEETITMV42.LABLEVELNAME5} = "00000"
    then {view_EmpMaster_ca1.LABLEV4NM}
else {VP_TIMESHEET.LABLEVELNAME4}

and {?Company} as being ...

select distinct COMP_ID,COMP_DESC
from COST_ALLON.dbo.COMP where COMP_ID NOT IN ('0110', '0610')

Thanks,

Sweet_and_Sour


new line to field name in rdl file to generate a report

  

Hey i want to generate a report and so while designing the rdl file i want to place some label in the same column name to display ex:

employee details - COLUMN NAME

name

full name

address etc

all these 3 fields should come under the column name "employees".

my question is - i need the code to place these sub labels in new lin

select record where field = variable?

  

Hi, I'm very new to SQL so please excuse how simple this problem is:

I've got a web page which contains a form, the form holds the following boxes:

  • Latitude
  • Longitude
  • Accuracy
  • Update
  • UserName

I have also got an access database , containing one table (Table1) which has the fields:

  • Latitude
  • Longitude
  • Accuracy
  • Update
  • UserName

The "UserName" field is the primary key (containing an email address)

What I want to do is select the record that has the same email address as entered into the form and update the rest of the fields with the data entered into the form.

The problem I'm having, as I see it, is that I can't seem to compare a string to a record UserName?

When I enter the email address manually it works and updates the record but it won't pull the email address from the variable string?

Here is my .asp code:

 

<%
'Dimension variables
Dim adoCon 'Holds the Database Connection Object
Dim rsUpdateEntry 'Holds the recordset for the record to be updated
Dim strSQL 'Holds the SQL query for the database
Dim email 'Holds the current users email address

email = (Request.Form("UserName"))

Set dbConn = Server.CreateObject(

when I select to 'set field in current item', the only option available is name

  

Hi Clayton,

I have published my form and promoted the fields and ticked the appropriate box when publishing, but when I select to 'set field in current item', the only option available is name (For Use In Forms). I would like to be able to set the value of an infopath field from within the SPD workflow workflow. So for instance, when the form is approved, a field is set to approved on the form and a button becomes available.

 

Thanks in advance


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

AJAX GridView Checkbox Select All in ASP.Net

  
In the previous article GridView Select Multiple Rows you learnt the multiple row selection in GridView control. Here you will get the C# code sample to select all the gridview rows using single checkbox server control. You can highlight the selected rows with different color and Font state Bold. If you want to use the selection values on different ASP.Net

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
Categories: 
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