本文整理汇总了C#中DataConnection.CloseConnection方法的典型用法代码示例。如果您正苦于以下问题:C# DataConnection.CloseConnection方法的具体用法?C# DataConnection.CloseConnection怎么用?C# DataConnection.CloseConnection使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类DataConnection
的用法示例。
在下文中一共展示了DataConnection.CloseConnection方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Page_Load
//.........这里部分代码省略.........
sql = "select ";
sql2 = "";
theComma = "";
for (int i = 0; i < resultA.FieldCount; i++)
{
if ((String)requestData["key"] == resultA.GetName(i) || (String)requestData["value"] == resultA.GetName(i))
{
if (resultA.GetFieldType(i) == typeof(DateTime))
{
sql2 += theComma + "TO_CHAR(" + resultA.GetName(i) + ", 'MM/DD/YYYY') " + resultA.GetName(i);
}
else if (resultA.GetFieldType(i) != typeof(String))
{
sql2 += theComma + "TO_CHAR(" + resultA.GetName(i) + ") " + resultA.GetName(i);
}
else
{
sql2 += theComma + resultA.GetName(i);
}
if ((String)requestData["key"] == resultA.GetName(i))
{
sql2 += " KEY ";
}
else if ((String)requestData["value"] == resultA.GetName(i))
{
sql2 += " VALUE ";
}
if (!sql2.Equals(""))
{
theComma = ", ";
}
}
}
resultA.Close();
finalSQL = sql + sql2 + " from " + request;
if ((String)requestData["filter"] != "")
{
finalSQL += " where " + ((String)requestData["filter"]).Replace("'", "''") + "'";
}
//finalSQL = "select * from (" + finalSQL + ") where ROWNUM <= 100";
result = theDB.execQuery(finalSQL);
if (result != null)
{
while (result.Read())
{
response = new Dictionary<String, String>();
for (int i = 0; i < result.FieldCount; i++)
{
String theValue = "";
try
{
theValue = result.GetString(i);
}
catch (Exception ex) { }
response.Add(result.GetName(i), theValue);
}
responses.Add(response);
}
result.Close();
responses.Sort(delegate(Dictionary<String, String> d1, Dictionary<String, String> d2) { return d1["VALUE"].CompareTo(d2["VALUE"]); });
}
result.Close();
status.Add("result", "true");
status.Add("message", "");
responsePackage.Add("data", responses);
responsePackage.Add("status", status);
Response.Write(rs.Serialize(responsePackage));
//Response.Write(rs.Serialize(responses));
break;
}
theDB.CloseConnection();
}
break;
}
}
catch (Exception ex)
{
status.Add("result", "false");
status.Add("message", ex.Message + "\n" + ex.StackTrace);
responsePackage.Add("data", "");
responsePackage.Add("status", status);
Response.Write(rs.Serialize(responsePackage));
//Response.Write(ex.Message + "\n" + ex.StackTrace);
}
}