欢迎光临
我们一直在努力

ACCESS数据库访问组件(四)-.NET教程,数据库应用

建站超值云服务器,限时71元/月

using system;

using system.data;

using system.data.oledb;

using system.collections;

namespace xlang.videoonline.framework.database.access

{

/// <summary>

/// summary description for access_dataviewscollection.

/// </summary>

public class dataviewscollection

{

private database.access.dataview[] _views;

private int _count;

public int count

{

get

{

return _count;

}

}

public dataviewscollection(oledbconnection connection)

{

system.data.datatable schematable = connection.getoledbschematable(oledbschemaguid.tables,

new object[] {null, null,null, "view"});

_count=schematable.rows.count;

_views=new database.access.dataview[_count];

for(int i=0;i<_count;i++)

{

_views[i]=new database.access.dataview(schematable.rows[i][2].tostring());

}

}

public database.access.dataview this [int tableindex]

{

get

{

return _views[tableindex];

}

set

{

_views[tableindex]=value;

}

}

public database.access.dataview this [string viewname]

{

get

{

return this [nametoindex(viewname)];

}

set

{

this [nametoindex(viewname)]=value;

}

}

private int nametoindex(string viewname)

{

for(int i=0;i<_views.length;i++)

{

if(_views[i].name.toupper()==viewname.toupper())

return i;

}

return -1;

}

}

}

赞(0)
版权申明:本站文章部分自网络,如有侵权,请联系:west999com@outlook.com 特别注意:本站所有转载文章言论不代表本站观点! 本站所提供的图片等素材,版权归原作者所有,如需使用,请与原作者联系。未经允许不得转载:IDC资讯中心 » ACCESS数据库访问组件(四)-.NET教程,数据库应用
分享到: 更多 (0)

相关推荐

  • 暂无文章