17,377
社区成员
发帖
与我相关
我的任务
分享
string connStr = "Data Source=orcl;Persist Security Info=True;User ID=system;Password=a;Unicode=True;";
OracleConnection conn = new OracleConnection(connStr);
conn.Open();
OracleCommand cmd = new OracleCommand(connStr, conn);
cmd.CommandType = CommandType.Text;
cmd.CommandText = "SELECT count(*) FROM images";
OracleDataReader reader = cmd.ExecuteReader();
reader.Read();
Console.WriteLine("line count: "+reader[0]);
conn.Close();