我想检查用户是否在我的 winForm 中输入了错误的登录信息……那么我在哪里可以在我的连接类中添加异常?
class Connection
{
public static OracleConnection Connection(string Source, string Name, string pass)
{
OracleConnection conn = null;
if(!string.IsNullOrWhiteSpace(Source) && !string.IsNullOrWhiteSpace(Name) && !string.IsNullOrWhiteSpace(pass))
{
conn = new OracleConnection("Data Source=" + Source + ";User Id=" + Name + ";Password=" + pass + ";");
return con;
}
return con;
}
}