This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| To Get escapded values | |
| public string EscapeXMLValue(string value) | |
| { | |
| if (string.IsNullOrEmpty(s)) return s; | |
| string temp = s; | |
| temp = temp.Replace("'","'").Replace( "\"", """).Replace(">",">").Replace( "<","<").Replace( "&","&"); | |
| return temp ; | |
| } | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| using System; | |
| using System.Collections.Generic; | |
| using System.Linq; | |
| using System.Web; | |
| using System.Web.UI; | |
| using System.Web.UI.WebControls; | |
| namespace Test.linq | |
| { | |
| public partial class WebForm1 : System.Web.UI.Page |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <AML> | |
| <Item type='Part' action='add'> | |
| <item_number>P0011</item_number> | |
| <title>My Part1</title> | |
| <name>P0011</name> | |
| <major_rev>B</major_rev> | |
| <description>Welcome new part1</description> | |
| </Item> | |
| </AML> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| if (variables == null) | |
| { | |
| variables = new Dictionary<string, object>(); | |
| } | |
| if(variables.ContainsKey(name)) | |
| { | |
| variables[name] = value; | |
| } | |
| else | |
| { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| First clone the DataTable, make all columns of type string, replace all null values with string.empty, then call GetXml on a new DataSet. | |
| //First bind XML data in to data set..objDataSet | |
| DataTable dt = objDataSet.Tables[0]; | |
| DataTable dtCloned = dt.Clone(); | |
| foreach (DataColumn dc in dtCloned.Columns) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| XmlRootAttribute xRoot = new XmlRootAttribute(); | |
| xRoot.ElementName = "RootElementName"; | |
| xRoot.IsNullable = true; | |
| XmlSerializer objSer = new XmlSerializer(typeof(Result), xRoot); | |
| FileStream objF = new FileStream("C:\\a.xml", FileMode.Open); | |
| Result varResult = (Result)serializer.Deserialize(objF); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| XmlDocument xmlD = new XmlDocument(); | |
| xmlD.Load("C:\\a.xml"); | |
| string strxml = xmlD.OuterXml.ToString(); | |
| Regex regEx = new Regex(@"< \?xml.*?\?>"); | |
| strxml = regEx.Replace(strxml, " "); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| OleDbConnection objConnection; | |
| DataSet objDs; | |
| OleDbDataAdapter objCommand; | |
| string strExcelPath = "C:\\MyExcel.xlsm"; | |
| if (Path.GetExtension(strExcelPath) == ".xls") | |
| { | |
| objConnection = new OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" + strExcelPath + ";Extended Properties=\"Excel 8.0;HDR=Yes;IMEX=2\""); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| using System.Threading.Tasks; | |
| using System.Data.OleDb; | |
| using System.Data; | |
| using System.IO; | |
| //Code | |
| OleDbConnection oledbConn; | |
| string path = "C:\\MyExcel.xlsx"; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Innovator inn = this.getInnovator(); | |
| string AML = "<AML><Item type='Customer' action='get'/></AML>"; | |
| Item result = inn.applyAML(AML); |