站内搜索
广告
实现一个客户端的DataSet-----ClientDataSet.htc
作者:    来源:    点击:    日期:2007-7-5 0:53:33   
<PUBLIC:COMPONENT lightWeight="true">
    <PUBLIC:PROPERTY name="Name" value="DataSet" />
    <PUBLIC:PROPERTY name="Namespace" value="http://tempuri.org" />
    <PUBLIC:PROPERTY name="XmlData" />
    <PUBLIC:PROPERTY name="XmlSchema" />
    
    <PUBLIC:METHOD name="ReadXml" />
    <PUBLIC:METHOD name="ReadXmlSchema" />
    <PUBLIC:METHOD name="GetTable" />
    <PUBLIC:METHOD name="AcceptChanges" />
    <PUBLIC:METHOD name="RejectChanges" />
    <PUBLIC:METHOD name="GetChanges" />

    <PUBLIC:EVENT name="ondatachanged" id="datachanged" />
</PUBLIC:COMPONENT>   

<SCRIPT>

//////////////////////////////////////////////////////////
// 实现一个客户端的DataSet
//////////////////////////////////////////////////////////

function DataRow(dt, oNode)
{
    this.DataTable        = dt;
    this.XmlNode        = oNode;
    this.GetValue        = DataRow_GetValue;
    this.SetValue        = DataRow_SetValue;
    this.Delete        = DataRow_Delete;
}

function DataRow_GetValue(vIndex)
{
    var oNode;
    switch (typeof(vIndex))
    {
        case "string":
            oNode = this.XmlNode.selectSingleNode(vIndex);
            break;
        default:
            throw "You must index into a DataRow using the string name.";
    }
首页 上一页 [1] [2] [3] [4]  下一页 尾页 
实现一个客户端的DataSet-----ClientDataSet.htc 评论