if i enter the value in my textbox(edit_mo bileno) i want to search for the matching and i want to read all the xmlelements in that perticular<cust omer></customer> tag... see below for myxml file...
XmlTextReader xr = new XmlTextReader(@ "D:\Newfolder\t irumala\myxml.x ml");
while (xr.Read())
{
if (xr.Name == "MobileNo")
{
if (edit_mobileno. Text.ToString() == xr.ReadString() )
{
messagebox.show (" the valuematched");
}
XML FILE(myxml.xml)
- <Registration >
- <Customer>
<Fullname>Mr. tirumalareddy</Fullname>
<HouseNo>1-23-234</HouseNo>
<Street>whitefi eld</Street>
<State>karnatak a</State>
<City>bangalore </City>
<Zipcode>560066 </Zipcode>
<PhoneNo>080293 9930</PhoneNo>
<MobileNo>99860 08230</MobileNo>
<CheckoutDate >5/3/2007 12:00:00 AM</CheckoutDate>
<CheckinDate> 4/30/2007 12:00:00 AM</CheckinDate>
<RoomType>Singl enonAC</RoomType>
<Amtpayable>150 </Amtpayable>
<EmailID>tiruma lab@yahoo.com</EmailID>
</Customer>
- <Customer>
<Fullname>Mr. ravithakur</Fullname>
<HouseNo>1-43-2345</HouseNo>
<Street>koramon gala</Street>
<State>karnatak a</State>
<City>bangalore </City>
<Zipcode>530066 </Zipcode>
<PhoneNo>080453 622</PhoneNo>
<MobileNo>93434 51521</MobileNo>
<CheckoutDate >5/4/2007 12:00:00 AM</CheckoutDate>
<CheckinDate> 4/30/2007 12:00:00 AM</CheckinDate>
<RoomType>Singl eAC</RoomType>
<Amtpayable>800 </Amtpayable>
<EmailID>ravik@ yahoo.com</EmailID>
</Customer>
Kindly help me.......i am helpless here........
XmlTextReader xr = new XmlTextReader(@ "D:\Newfolder\t irumala\myxml.x ml");
while (xr.Read())
{
if (xr.Name == "MobileNo")
{
if (edit_mobileno. Text.ToString() == xr.ReadString() )
{
messagebox.show (" the valuematched");
}
XML FILE(myxml.xml)
- <Registration >
- <Customer>
<Fullname>Mr. tirumalareddy</Fullname>
<HouseNo>1-23-234</HouseNo>
<Street>whitefi eld</Street>
<State>karnatak a</State>
<City>bangalore </City>
<Zipcode>560066 </Zipcode>
<PhoneNo>080293 9930</PhoneNo>
<MobileNo>99860 08230</MobileNo>
<CheckoutDate >5/3/2007 12:00:00 AM</CheckoutDate>
<CheckinDate> 4/30/2007 12:00:00 AM</CheckinDate>
<RoomType>Singl enonAC</RoomType>
<Amtpayable>150 </Amtpayable>
<EmailID>tiruma lab@yahoo.com</EmailID>
</Customer>
- <Customer>
<Fullname>Mr. ravithakur</Fullname>
<HouseNo>1-43-2345</HouseNo>
<Street>koramon gala</Street>
<State>karnatak a</State>
<City>bangalore </City>
<Zipcode>530066 </Zipcode>
<PhoneNo>080453 622</PhoneNo>
<MobileNo>93434 51521</MobileNo>
<CheckoutDate >5/4/2007 12:00:00 AM</CheckoutDate>
<CheckinDate> 4/30/2007 12:00:00 AM</CheckinDate>
<RoomType>Singl eAC</RoomType>
<Amtpayable>800 </Amtpayable>
<EmailID>ravik@ yahoo.com</EmailID>
</Customer>
Kindly help me.......i am helpless here........
Comment