Home » questions » Can i stored any statement in XML file and retrive it and exucute it in c#?

Can i stored any statement in XML file and retrive it and exucute it in c#?

2006-08-08 06:51:10, Category: Programming & Design
I want to store validation condition statement in xml file and at the time of validation i retrieve that and put into if condition instring and simply put in if condition. Is this possible. e.g Suppose i want to validate data which in the range 1 - 100. I can write in Xml file data > 0 && data < 101 then i retrieve this condition Like string condition; condition = fromxmlfile(); if( condition) { do something }

Answers

  1. Kryzchek

    On 2006-08-08 09:46:14


    Sure. You could use the WriteXml() method of a DataTable to save and then the ReadXml() method to restore your Xml data. As far as executing it--what kind of statement is it? If it's an SQL statement, you can simply use ADO.NET. If it's a method call or something of the like, you'll want to use reflection.