0条评论
还没有人评论过~
//
user id=system;password=admin;data source=127.0.0.1/BZEY;persist security info=false;Connection Timeout=120;
//
await using (var conn = new OracleConnection(_oracleConn))
{
await using (var cmd = new OracleCommand())
{
cmd.CommandType = CommandType.Text;
cmd.CommandText = _sqlQuery;
cmd.Connection = conn;
await conn.OpenAsync();
await using (var read = await cmd.ExecuteReaderAsync())
{
while (await read.ReadAsync())
{
items.Add(new IcdM
{
Code = read["code"].ToString(),
Name = read["name"].ToString(),
PY = read["py"].ToString(),
WB = read["wb"].ToString()
});
}
}
}
}
错误信息:
debug 打开数据库的时候报错了(await conn.OpenAsync()