本文整理汇总了C#中DataConnection.OpenConnection方法的典型用法代码示例。如果您正苦于以下问题:C# DataConnection.OpenConnection方法的具体用法?C# DataConnection.OpenConnection怎么用?C# DataConnection.OpenConnection使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类DataConnection
的用法示例。
在下文中一共展示了DataConnection.OpenConnection方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Page_Load
//.........这里部分代码省略.........
//Response.Write(rs.Serialize(responses));
}
else
{
/* This is what I want to do:
status.Add("result", "true");
status.Add("message", "");
responsePackage.Add("data", response);
responsePackage.Add("status", status);
Response.Write(rs.Serialize(responsePackage));
*/
if (action != "Search" || action.ToLower() == "loadselect")
{
//response.Add("success", "true");
//Response.Write(rs.Serialize(response));
status.Add("result", "true");
status.Add("message", "");
responsePackage.Add("data", response);
responsePackage.Add("status", status);
Response.Write(rs.Serialize(responsePackage));
}
}
break;
}
break;
case "DATABASE":
if (theDB.OpenConnection((String)requestData["form:connection"]))
{
String sql = "";
String sql2 = "";
String sql3 = "";
String sql4 = "";
String finalSQL = "";
String theComma = "";
String theComma2 = "";
// Allow for case insensitive search.
theDB.execNonQuery("alter session set NLS_SORT=BINARY_CI");
theDB.execNonQuery("alter session set NLS_COMP=LINGUISTIC");
OracleDataReader resultA = null;
switch (action)
{
case "Email":
sql = "select * from " + (String)requestData["fromEmailSource"] + " where 1=2";
resultA = theDB.execQuery(sql);
sql = "select ";
sql2 = "";
theComma = "";
for (int i = 0; i < resultA.FieldCount; i++)
{
if ((String)requestData["emailID"] == resultA.GetName(i))
{
if (resultA.GetFieldType(i) == typeof(DateTime))
{
sql2 += theComma + "TO_CHAR(" + resultA.GetName(i) + ", 'MM/DD/YYYY') " + resultA.GetName(i);