public object Getlife1(string SQLString)
{
using (OracleConnection connection = new OracleConnection("Data Source=wgcs;Persist Security Info=True;User ID=wgcs;Password=wgcs;Unicode=True"))
{
using (OracleCommand cmd = new OracleCommand(SQLString, connection))
{
try
{
connection.Open();无法解析制定则字符串
object obj = cmd.ExecuteScalar();
if ((Object.Equals(obj, null)) || (Object.Equals(obj, System.DBNull.Value)))
{
return null;
}
else
{
return obj;
}
}
catch (System.Data.SqlClient.SqlException e)
{
connection.Close();
throw e;
}
finally
{
cmd.Dispose();
connection.Close();
}
}
}
连接字符串肯定没问题