错误图片http://i.stack.imgur.com/AC5sE.png
我想向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();
答案 0 :(得分:-2)
使用Linq To SQL
var data =
ctx.Buildings.OrderBy(x => x.id).Select(x => new { x.name, x.img }).ToArray();