.net中XML文件作为数据源的操作类
不解释了,自己看代码吧.......................
using System;
using System.Text;
using System.Data;
using System.Web.UI.WebControls;
using System.Data.SqlClient;
using System.Web;
using System.Web.UI;
using System.Xml;
namespace Gogofly.CommonOperation
{
/// <summary>
/// 数据类型转换
/// </summary>
public class DataTypeConvert
{
#region 数据类型转换
public DataTypeConvert(){}
/// <summary>
/// 字符串转换为整数
/// </summary>
/// <param name="value"></param>
/// <returns></returns>
public static int ConvertToInt(string value)
{ ///数据为空,返回-1
if(string.IsNullOrEmpty(value))return -1;
int result = -1;
///执行转换操作
Int32.TryParse(value,out result);
return result;
}
/// <summary>
/// 字符串转换为时间
/// </summary>
/// <param name="value"></param>
/// <returns></returns>
public static DateTime ConvertToDateTime(string value)
{ ///定义初始化值
DateTime result = DateTime.Parse("1900-01-01");
if(string.IsNullOrEmpty(value)) return result;
///执行转换操作
DateTime.TryParse(value,out result);
return result;
}
/// <summary>
/// 字符串转换为实数
/// </summary>
/// <param name="value"></param>
/// <returns></returns>
public static decimal ConvertToDecimal(string value)
{ ///定义初始化值
decimal result = 0.0M;
if(string.IsNullOrEmpt
相关文档:
Reviewer Approved
The following example shows how to parse XML file using Symbian OS C++ class, CParser. CParser is basically a SAX (Simple API for XML)-based XML parser.
It uses an active object to read the XML file chunk by chunk (see CXmlHandler::StartParsingWithAoL( ......
antonypr | 14 April, 2007 00:05
A couple of weeks ago, I had a plan to write an article and example code of using XML parser in Symbian OS. It seems that another Forum Nokia Champion, Paul Todd had the same idea. He posted a nice article about XML parser in Symbian OS 9.x to Forum Nokia Blogs. It's ......
[Bug 230608] missing config.h in latest -14
Ralf Corsepius rc040203 at freenet.de
Tue Mar 6 13:31:13 UTC 2007
Previous message: [Bug 230608] missing config.h in latest -14
Next message: [Bug 230608] missing config.h in latest -14
Messages sorted by: [ date ] [ thread ] [ subject ] [ author ] ......
XML的全称Extensible Markup Language,意思是可扩展的标记语言,是标准通用标记语言SGML(Standard Generalized Markup Language)的一个子集。1998年2月,W3C发布了XML1.0标准,其目的是为了在Web上能以现有的超文本标记语言HTML的使用方式提供,接收和处理通用的SGML。XML是SGML的一个简化子集,它以一种开放的,自我描述的 ......
XmlDocument doc = new XmlDocument();
string strtxt = "";
doc.Load(Server.MapPath("XMLFile1.xml"));
&nbs ......