Hi all as is known to all,the char '<','>','&' is XML format. but when i want to write a string that contain a '<' or '>' or '&' in a XML,i could replace it such as : string XMLstring = x[y].ToString(); XMLstring = XMLstring.Trim(); XMLstring = XMLstring.Replace("&", "&"); XMLstring = XMLstring.Replace(">", ">"); XMLstring = XMLstring.Replace("<", "<"); excelDoc.Write("<Cell ss:StyleID=\"StringLiteral\">" + "<Data ss:Type=\"String\">"); excelDoc.Write(XMLstring);
but i failed : excelDoc.Write("<Cell ss:StyleID=\"BoldColumn\"><Data ss:Type=\"String\">");
what should i do ? Thanks!
panyl
Posts
-
How to write my string "<" in XML format -
what type of value does switch statement allow to use?such as switch(?){....}private static string ToDbfFieldTypeString(Type pType) { string sResult = ""; try { if (pType == typeof(int)) { sResult = "int"; return sResult; } if (pType == typeof(long)) { sResult = "long"; return sResult; } if (pType == typeof(float)) { sResult = "float"; return sResult; } if (pType == typeof(double)) { sResult = "double"; return sResult; } if (pType == typeof(decimal)) { sResult = "number"; return sResult; } if (pType == typeof(bool)) { sResult = "char(2)"; return sResult; } if (pType == typeof(DateTime)) { sResult = "date"; return sResult; } if (pType == typeof(string)) { sResult = "string"; return sResult; } } catch //(Exception excp) { sResult = ""; } return sResult; } ------------------------------------------------------------------- i change the if-else structure to switch structure as follow: but it tell me to input an integer value at switch(); switch (pType) { case typeof(int): return "int"; case typeof(long): return "long"; case typeof(float): return "float"; case typeof(double): return "double"; case typeof(decimal): return "number"; case typeof(bool): return "char(2)"; case typeof(DateTime): return "date"; case typeof(string): return "string"; } So,buddy,could you help me modify the c
-
How to get first N rows from a datatableThank you very much!i will try. Thank you!
-
How to get first N rows from a datatablethanks,thank you very much! accrooding your way i have solve my question.I could get the first 100Rows, But another question is how do i get the second 100 rows(101-200)? because i want to display 100rows/page. thanks for any help.
-
How to get first N rows from a datatableThere is a method called datatable.select(string) to filter rows from a datatalbe But the string must contains one columnname in the datatable.I know nothing about the datatable,what i want to get is just the first N rows in the datatable. what should i do? Thanks
-
Get information about serval given keys is pressed?Thanks for you reply! I have solve my question. code: //Onkeydown if(e.KeysData.tostring().contains("Control")&&(e.Keysdata.tostring().contains("Left")) { // do my work; } But i found a erratic thing: if i press keys.left or Right/up/down,it ignore me in function OnKeyDown,OnKeyUp,OnKeyPress; if i press keys.control and keys.left,it will process my work; if i press keys.shift and keys.left,it will ignore me in function OnKeyDown,but process in OnkeyUp; ..... i want to know when will those events occur?Could you help me?
-
how to select specific row in DataGridif("dd"==DataGrid.items(i).cells(j).text) so what you want may be: DataGrid.items(i).cells(j).RowNumber(this is the row index in the control)
-
Get information about serval given keys is pressed?I want to process something when keys.control and keys.left are pressed at the same time,so how do i know if them are pressed at the same time? Thanks!(C#)