本文整理汇总了C#中Oracle.DataAccess.Client.OracleConnection.Clone方法的典型用法代码示例。如果您正苦于以下问题:C# OracleConnection.Clone方法的具体用法?C# OracleConnection.Clone怎么用?C# OracleConnection.Clone使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Oracle.DataAccess.Client.OracleConnection
的用法示例。
在下文中一共展示了OracleConnection.Clone方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: isRegulated
private bool isRegulated()
{
if (username.Trim().Length == 0)
{
MessageBox.Show("Username is empty!");
return false;
}
if (password.Trim().Length == 0 || repPassword.Trim().Length == 0)
{
MessageBox.Show("One of the password fields is empty!");
return false;
}
if (!password.Equals(repPassword))
{
MessageBox.Show("Passwords do not match.");
return false;
}
username = username.Trim();
using (OracleConnection conn = new OracleConnection(FormLogin.connString)) // using avtomatski ja zatvora otvorenata konekcija
{
conn.Open();
// mozhebi bi bilo podobro da se realizira so funkcija na nivo na baza
string query = "SELECT COUNT(*) FROM Tipster WHERE UPPER(username) LIKE '" + username.ToUpper() + "'";
OracleCommand commCheck = new OracleCommand(query, conn);
commCheck.CommandType = CommandType.Text;
Object o = commCheck.ExecuteScalar();
int numRows = Int32.Parse(o.ToString());
if (numRows != 0)
{
MessageBox.Show("Already exists tipster with that username.");
conn.Clone(); // za sekoj slucaj
return false;
}
}
return true;
}
示例2: GetCommonData
private void GetCommonData()
{
List<HejriCommonDate> hejriCommonDateList = new List<HejriCommonDate>();
OracleConnection conn = new OracleConnection(ConfigurationManager.ConnectionStrings["ConnectionString"].ConnectionString);
OracleCommand com = new OracleCommand("VW_HEJRA_DATES_FIND_ALL", conn);
try
{
conn.Open();
com.CommandType = System.Data.CommandType.StoredProcedure;
OracleParameter parameter = new OracleParameter();
parameter.Direction = System.Data.ParameterDirection.InputOutput;
parameter.OracleDbType = OracleDbType.RefCursor;
com.Parameters.Add(parameter);
OracleDataReader reader = com.ExecuteReader();
while (reader.Read())
{
HejriCommonDate hejriCommonDate = new HejriCommonDate();
hejriCommonDate = HejriCommonDateHelper(reader);
if (hejriCommonDate != null)
hejriCommonDateList.Add(hejriCommonDate);
}
}
catch (Exception ex)
{
}
finally
{
conn.Close();
conn.Clone();
com.Clone();
}
list = hejriCommonDateList;
}