D
daiyuan
Hi:
When I run this project,I miss a error:
it's say: convert is falied!
I don't konw why.
Please advice.
Thanks!!!
This is my codes:
////////////////////////////////////////////////////////////////////////////
///
using System.Data.OracleClient;
....
private int SetVirtualItemCount()
{
int result = 0;
// database connection
String strConn = "Password=;User ID=sa;Data Source=HBMIS";
OracleConnection conn = new OracleConnection(strConn);
// ¼ÆËã¼Í¼×ÜÊý
String strCmd = "SELECT COUNT(*) FROM Employees";
OracleCommand cmd = new OracleCommand(strCmd,conn);
// Ö´ÐÐ
conn.Open();
int count = (int)cmd.ExecuteOracleScalar(); //error
line
conn.Close();
//result = (int)count;
return result;
}
////////////////////////////////////////////////////////////////////////
When I run this project,I miss a error:
it's say: convert is falied!
I don't konw why.
Please advice.
Thanks!!!
This is my codes:
////////////////////////////////////////////////////////////////////////////
///
using System.Data.OracleClient;
....
private int SetVirtualItemCount()
{
int result = 0;
// database connection
String strConn = "Password=;User ID=sa;Data Source=HBMIS";
OracleConnection conn = new OracleConnection(strConn);
// ¼ÆËã¼Í¼×ÜÊý
String strCmd = "SELECT COUNT(*) FROM Employees";
OracleCommand cmd = new OracleCommand(strCmd,conn);
// Ö´ÐÐ
conn.Open();
int count = (int)cmd.ExecuteOracleScalar(); //error
line
conn.Close();
//result = (int)count;
return result;
}
////////////////////////////////////////////////////////////////////////