版本说明
- .net 5.0
- oracle 10g
代码如下
//
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()
相关问题
- ASP.NET Core ConfigureServices 中从 appsettings.json
- .Net5 强制https请求重复跳转问题
- HttpContext.Items["Properties"]全局获取
- asp.net core 连接Oracle数据,异常,无法正常open
- 博客园的服务怎么实现预热后加入K8S集群的
https://github.com/dotnet/aspnetcore/issues/27872
如何解决: https://github.com/GrabYourPitchforks/docs/blob/bf_obsoletion_docs/docs/standard/serialization/resolving-binaryformatter-obsoletion-errors.md