• SQL转换


      private void Page_Load(object sender, System.EventArgs e)
      {
       String Sql = "INSERT INTO ssUser (UID, UserID, UserPwd) VALUES ('1', '2', '2')";
       Sql = Sql.Substring(Sql.IndexOf("INTO") + 4);
       string table =  Sql.Substring(0,Sql.IndexOf("("));
       string psv =  Sql.Substring(Sql.IndexOf("VALUE"));

       Hashtable ht = new Hashtable();

       string[] Psn = SubString(Sql,"\\(","\\)").Split(',');
       string[] Psv = SubString(psv,"\\(","\\)").Split(',');
       this.Response.Write(Psn[1] + ":" +Psv[1]);

     


      }

      /// <summary>
      /// 返回字符串的字串
      /// </summary>
      /// <param name="s1">被处理的字符串</param>
      /// <param name="startSign">开始标记</param>
      /// <param name="endSign">结束标记</param>
      /// <returns>返回字串</returns>
      private string SubString(string s1,string startSign,string endSign)
      {
       return System.Text.RegularExpressions.Regex.Match(s1, startSign + "(.*?)" + endSign).Result("$1");
      }


    OleDbConnection cnn = new ...;
    OleDbDataAdapter da = new ....("select * from table1",cnn);
    da.MissingSchemaAction = MissingSchemaAction.AddWithKey;
    DataTable dt = new ...
    da.Fill(dt);
    //通过PrimaryKey属性取主键
    Response.Write(dt.PrimaryKey[0].ColumnName);

  • 相关阅读:
    Helm安装带验证的ElasticSearch 6.x 7.x 集群
    K8S权限控制,限制用户在多个namespace上的访问权限
    Helm安装spinnaker到k8s集群
    离线安装spinnaker到K8S集群
    Kubernetes之CronJob
    GO语言GIN框架入门
    Kubernetes kubectl 命令概述
    Kubernetes Service
    Kubernetes Ingress
    centos+Jenkins+maven搭建持续集成
  • 原文地址:https://www.cnblogs.com/ejiyuan/p/947211.html
Copyright © 2020-2023  润新知