Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / ASP.NET / General / February 2008

Tip: Looking for answers? Try searching our database.

reading a xml value from text box

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
deepak - 08 Feb 2008 18:51 GMT
Hi All,

On a asp.net web page, i have a text box and a button ('Submit') , the text
box has below contents

<SXPTaskUpdateOrAdd Revision="7.5.0" Source="India_Bharti">
<Task>
<NOCRefID>SH123456</NOCRefID>
<TaskType>Corrective</TaskType>
<EarlyStart>2006-02-03T00:00:00</EarlyStart >
<DesiredDueDate>2006-02-05T00:00:00</DesiredDueDate >
<NumberOfRequiredEngineers>1</NumberOfRequiredEngineers>
<AutoCreate>true</AutoCreate>
</Task>
</SXPTaskUpdateOrAdd>

in my VB.NET code(ASP.NET), i want to read value of EarlyStart during
pageload event i.e. here it is 2006-02-03T00:00:00 inside <EarlyStart > tag.

How can i read it?Kindly Guide me please

Thanks,
Deepak
kr_deepak123@hotmail.com
kr_deepak123@yahoo.co.in
LVP - 08 Feb 2008 19:10 GMT
1- You can load into XML DOM
2- RegExp
or
3  If you have this

string tt =
"<TaskType>Corrective</TaskType><EarlyStart>2006-02-03T00:00:00</EarlyStart><DesiredDueDate>2006-02-05T00:00:00</DesiredDueDate
>";  // TextBox.Text;

int startTagPos = tt.IndexOf("<EarlyStart>");

int endTagPos = tt.IndexOf("</EarlyStart>");

int EarlyStartLen = endTagPos - startTagPos - 12;

string EarlyStart = tt.Substring(startTagPos + 12, endTagPos - startTagPos -
12);

Also I notice you have an extra space in </EarlyStart >  "t >"

LVP

> Hi All,
>
[quoted text clipped - 23 lines]
> kr_deepak123@hotmail.com
> kr_deepak123@yahoo.co.in
deepak - 08 Feb 2008 19:21 GMT
may u tell me through vb.net code please as its hard for me to understand urs
points properly.? Also that extra space is by mistake.in actual there is no
space...kindy tell me by code step by step...i would be greateful.....

> 1- You can load into XML DOM
> 2- RegExp
[quoted text clipped - 45 lines]
> > kr_deepak123@hotmail.com
> > kr_deepak123@yahoo.co.in
deepak - 08 Feb 2008 19:26 GMT
Also this webpage (having textbox is demo) for us.in actualy production
environment,we will get this SXP message through http protocol so consider
that scenario  plz and tell me

> 1- You can load into XML DOM
> 2- RegExp
[quoted text clipped - 45 lines]
> > kr_deepak123@hotmail.com
> > kr_deepak123@yahoo.co.in
LVP - 08 Feb 2008 19:42 GMT
1- You can load into XML DOM, could be overkill
2- RegExp
or
3  If you have this

Dim tt as string = DemoYourTextBoxID.Text

Dim startTagPos as integer = tt.IndexOf("<EarlyStart>")

Dim endTagPos as integer = tt.IndexOf("</EarlyStart>");

Dim EarlyStartLen as integer = endTagPos - startTagPos - 12;

Dim  EarlyStart as string = tt.Substring(startTagPos + 12, EarlyStartLen);

LVP

> 1- You can load into XML DOM
> 2- RegExp
[quoted text clipped - 45 lines]
>> kr_deepak123@hotmail.com
>> kr_deepak123@yahoo.co.in
deepak - 08 Feb 2008 23:10 GMT
Hi LVP,
the question is that how to get this xml as there is no textbox in real
production environment and this xml message will come through internet via
http protocol.
tHIS PAGE dont play any role in actual production environment and this is
just asumption that we r goign to process the message of production (present
in this text box) through this page but in actual the same xmlmessage
willcome through http protocol... then how to get the xml message through
request object like request.form.getvalues(...).....Kinldy tell me i would be
highly helped by this?

> 1- You can load into XML DOM, could be overkill
> 2- RegExp
[quoted text clipped - 62 lines]
> >> kr_deepak123@hotmail.com
> >> kr_deepak123@yahoo.co.in

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.