asp 语言中,如何判断 access数据库表中有多少列数据?不胜感激的请教。
3个回答
展开全部
下面是一个 Asp.net 不知道对你有用不!
//======
private OleDbConnection _sqlConn = null;
/// <summary>
/// 获取一个 Ole 中的一个表字段详细信息
/// </summary>
/// <param name="TableName">表名</param>
/// <returns></returns>
override public DataTable GetColumnInfoList(string TableName)
{
object[] restrictions = new object[4];
restrictions[2] = TableName;
DataTable oleDbSchemaTable = _sqlConn.GetOleDbSchemaTable(OleDbSchemaGuid.Columns, restrictions);
return oleDbSchemaTable;
}
//======
private OleDbConnection _sqlConn = null;
/// <summary>
/// 获取一个 Ole 中的一个表字段详细信息
/// </summary>
/// <param name="TableName">表名</param>
/// <returns></returns>
override public DataTable GetColumnInfoList(string TableName)
{
object[] restrictions = new object[4];
restrictions[2] = TableName;
DataTable oleDbSchemaTable = _sqlConn.GetOleDbSchemaTable(OleDbSchemaGuid.Columns, restrictions);
return oleDbSchemaTable;
}
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询