誤差圖像http://i.stack.imgur.com/AC5sE.pngC#錯誤(對象引用不設置爲一個對象的一個實例。)
我想添加數據到DATAZ但發現錯誤時生成
這是我的代碼
int i = 0;
string[][,] dataz = null;
conn.Open();
OleDbCommand db = conn.CreateCommand();
db.CommandType = CommandType.Text;
db.CommandText = "select name,img from [building] order by id asc ";
OleDbDataReader oReader = db.ExecuteReader();
while (oReader.Read())
{
string name = oReader.GetString(0);
string img = oReader.GetString(1);
dataz[i] = new string[,] { { "name", name }, { "img", img } };
i++;
}
conn.Close();
編輯你的問題並不意味着它不是一個重複... – 2014-12-07 21:58:41