10-25-04 01:46 AM
MHS
One method you can use, is to create an .XSD schema in your BizTalk
Project, that represents the dataset that you have in your .net assembly.
1) If the you are using a strongly typed dataset, then you can copy the .xsd
file
from your .net assembly to your BizTalk assembly. If not, then you will
have to create the schema. I believe there is a method on the dataset to do
this (creating the schema from the dataset).
2) Now in your Orchestration you can create a message that represents the
BTS xsd schema.
3) In an expression shape you can then populate the BizTalk Message by
calling your .Net assembly.
4) Now you can use xpath in your message to get the total row count and loop
through the items in your message like below:
// In one expression shape get the total count :
orderItemCount = 1;
orderItemTotal = xpath(InComingOrder,"number (count (//OrderItems))");
// Usiing a Looping Shape (with a contained expression shape get specific
// attributes from the BizTalk Message that you are interested in, using xpa
th
currentAmount = xpath(InComingOrder,"string(//OrderItems[" +
strorderItemCount + "]//@Amount)");
// Increment the counter
orderItemCount = orderItemCount + 1;
// Your loop shape will have an expression like this:
orderItemCount <= orderItemTotal
Matt
"MHS" wrote:
> Hello,
>
> I have a .net Assembly that returns a dataset. I created an instance of my
> class in expression shape and assigned it to dataset variable.
>
> in order to get the row count I am unable to write
> dataset.tables[0].rows.count. It gives an error. More over I do not se
e
> rows.count in context menu when I type dataset.tables[0].
>
>
> I was hoping to get the row count and assign it to a variable and then use
> loop shape to loop through and try to retrieve values from dataset rows by
> incrementing index.
>
> Can I do this?
>
> Can anyone please suggest how can I make this to work?
>
> Any help would be greatly appreciated.
>
> Thanks
> MHS
>
[ Post a follow-up to this message ]
|