当前位置: 首页>>代码示例>>C#>>正文


C# DataConnection.execQuery方法代码示例

本文整理汇总了C#中DataConnection.execQuery方法的典型用法代码示例。如果您正苦于以下问题:C# DataConnection.execQuery方法的具体用法?C# DataConnection.execQuery怎么用?C# DataConnection.execQuery使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在DataConnection的用法示例。


在下文中一共展示了DataConnection.execQuery方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: Page_Load


//.........这里部分代码省略.........
                                              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);
                                            }
                                            else if (resultA.GetFieldType(i) != typeof(String))
                                            {

                                                sql2 += theComma + "TO_CHAR(" + resultA.GetName(i) + ") " + resultA.GetName(i);
                                            }
                                            else
                                            {
                                                sql2 += theComma + resultA.GetName(i);
                                            }
                                            if (!sql2.Equals(""))
                                            {
                                                theComma = ", ";
                                            }
                                        }
                                    }
                                    resultA.Close();

                                    finalSQL = sql + sql2 + " from " + (String)requestData["fromEmailSource"] + " where " + (String)requestData["fromEmailUserID"] + " = '" + (userName.Substring(userName.LastIndexOf("\\") + 1)).Replace("'", "''") + "'";
                                    //finalSQL = "select * from (" + finalSQL + ") where ROWNUM <= 100";
开发者ID:RandomMinds,项目名称:WebAppToolkit,代码行数:67,代码来源:default.aspx.cs


注:本文中的DataConnection.execQuery方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。