Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
XML to datarow
Message
De
14/05/2013 03:13:33
 
 
Information générale
Forum:
ASP.NET
Catégorie:
Code, syntaxe and commandes
Titre:
Versions des environnements
Environment:
C# 4.0
OS:
Windows 7
Network:
Windows 2003 Server
Database:
MS SQL Server
Divers
Thread ID:
01573699
Message ID:
01573742
Vues:
47
J'aime (1)
>>>
>>>scatter memvar memo blank
>>>      .GatherFrom("<ALIAS>B_SCHED</ALIAS>" + tcActionList)
>>>      .write_log('m.Booking_ID = ' + alltrim(str(m.booking_id,16))+;
>>>         ' m.Resource1='+m.resource1+' m.start_time='+transform(m.start_time)+;
>>>         ' m.end_time='+transform(m.end_time)+' m.layer='+transform(m.layer)+;
>>>         ' m.lessontype='+transform(m.lessontype)+' m.podbktype='+transform(m.podbktype),;
>>>         program(), '5')
>>>
>>>So, I would need the values in the row and to me it's easier to use them as datarow.
>>>
>>>Here is part of what I wrote so far:
>>>
>>>
>>>String cActionList = GetParameterString(parameters, "tcActionList");
>>>
>>>            DataSet rowData = new DataSet();
>>>
>>>            rowData.ReadXml(new XmlTextReader(new StringReader(String.Format("{0}{1}{/0}", "b_sched", cActionList))));
>>>
>>>            Boolean max4s_over = database.GetPreferenceBoolean("prefs_bk", "max4s_over");
>>>            DataRow  row = rowData.Tables[0].Rows[0];
>>>
>>>            Logging.LogFormat(5, "m.Booking_ID = {0} m.Resource1={1} m.start_time={2} m.end_time={3} m.layer={4} m.lessontype={5} m.podbktype={6}",
Sorry, still doesn't make sense to me. No idea what the VFP .GatherFrom() is and still don't know why you need a DataTable. What do you eventually want to do with the XML content ?
>
>The GatherFrom method generates variables for each column, e.g.
>
>m.booking_id, m.layer, etc.
>
>These values are used down below in the method for different manipulations. In other words, I need to get columns values.
>
>Say, a bit down bellow I have
>
>
> if m.booking_id > 0 and m.podbktype=2     && are we changing the schedule of a "book entire" booking?
>&& are there any existing max4sale restrictions (besides the current one)?  If so, that's a conflict
>            lcSQLReturn=.mysqlexec("select start_time, end_time, type, lessontype, max_sale, "+;
>               "id, e_mail_l1, mail1_sent, e_mail_l2, mail2_sent "+;
>               "from dbo.max4sale where start_time<"+.VFP2SQL(m.end_time)+" and end_time>"+;
>               .VFP2SQL(m.start_time)+" and type=5 and pod_id="+;
>               .VFP2SQL(padr(m.resource1,12))+" and not exists(select booking_id from dbo.b_sched where start_time<"+;
>               .VFP2SQL(m.end_time)+" and end_time>"+.VFP2SQL(m.start_time)+" and podbktype=2 and resource1="+;
>               .VFP2SQL(padr(m.resource1,12))+" and booking_id = "+.VFP2SQL(m.booking_id)+")", 'csrMax', program())
>
>
>In other words, in VFP I converted passed XML string into individual variables for each column.

Not important, but I still don't see it. AFAICS you just need to grab a few values from the XML to use in a SQL statement. If that's the case why bother building a comparatively heavy datatable to do the job. Linq to XML, for example, would be simpler and cleaner.
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform