本文整理汇总了C#中Util.LogSQLError方法的典型用法代码示例。如果您正苦于以下问题:C# Util.LogSQLError方法的具体用法?C# Util.LogSQLError怎么用?C# Util.LogSQLError使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Util
的用法示例。
在下文中一共展示了Util.LogSQLError方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: ViziAppsExecuteScalar
public string ViziAppsExecuteScalar(Hashtable State, string sql)
{
try
{
MySqlConnection ViziAppsDB = (MySqlConnection)State["ViziAppsDB"];
if (ViziAppsDB == null || ViziAppsDB.State != ConnectionState.Open)
{
OpenViziAppsDatabase(State);
ViziAppsDB = (MySqlConnection)State["ViziAppsDB"];
}
MySqlCommand cmd = new MySqlCommand(sql, ViziAppsDB);
object result = cmd.ExecuteScalar();
if (result == null)
return null;
else
return result.ToString();
}
catch (MySqlException ex)
{
Util util = new Util();
util.LogSQLError(State, ex,sql);
throw new Exception("Error in ViziAppsExecuteScalar: sql: " + sql);
}
}
示例2: ViziAppsQuery
public DataTable ViziAppsQuery(Hashtable State, string sql)
{
try
{
MySqlDataAdapter adapter = new MySqlDataAdapter();
MySqlConnection ViziAppsDB = (MySqlConnection)State["ViziAppsDB"];
if (ViziAppsDB == null || ViziAppsDB.State != ConnectionState.Open)
{
OpenViziAppsDatabase(State);
ViziAppsDB = (MySqlConnection)State["ViziAppsDB"];
}
adapter.SelectCommand = new MySqlCommand(sql, ViziAppsDB);
DataTable table = new DataTable();
adapter.Fill(table);
return table;
}
catch (MySqlException ex)
{
Util util = new Util();
util.LogSQLError(State, ex,sql);
throw new Exception("Error in ViziAppsQuery: sql: " + sql);
}
}
示例3: ViziAppsExecuteNonQuery
public string ViziAppsExecuteNonQuery(Hashtable State, string sql)
{
try
{
MySqlConnection ViziAppsDB = (MySqlConnection)State["ViziAppsDB"];
if (ViziAppsDB == null || ViziAppsDB.State != ConnectionState.Open)
{
OpenViziAppsDatabase(State);
ViziAppsDB = (MySqlConnection)State["ViziAppsDB"];
}
MySqlCommand cmd = new MySqlCommand(sql, ViziAppsDB);
cmd.ExecuteNonQuery();
return null;
}
catch (MySqlException ex)
{
Util util = new Util();
util.LogSQLError(State, ex,sql);
throw new Exception("Error in ViziAppsExecuteNonQuery: sql: " + sql);
}
}