这是我的代码
con = new OleDbConnection("Provider=Microsoft.ACE.OLEDB.12.0;Data Source=C:/techsoft /PP1.accdb;Persist Security Info=False");
con.Open();
cm = new OleDbCommand("select aa from ab", con);
OleDbDataReader qq;
qq = cm.ExecuteReader();
ArrayList ss = new ArrayList();
while (qq.Read())
{
object[] values = new object[qq.FieldCount];
qq.GetValues(values);
ss.Add(values);
}
如果我使用这个语法来转换。
int[] i = (int[])ss.ToArray(System.Type.GetType("System.Int32"));
以下错误出现:"源数组中至少有一个元素无法向下转换为目标数组类型。"
请提供一种解决方案或其他替代方法。
values
包含的不是整数。 - Will Vousden