コード例 #1
0
        void initSQLTable(ProcSql proc)
        {
            DataTable inTable = SQLFunction.GetResultTable(proc.InTable);

            DataRow[]         sqlRows = new DataRow[ResTable.Rows.Count];
            DataRowCollection resRows = ResTable.Rows;

            for (int i = 0; i < resRows.Count; i++)
            {
                DataRow newRow = inTable.Rows.Add();
                foreach (KeyValuePair <string, string> field in proc.inFields)
                {
                    switch (field.Key.ToLower())
                    {
                    case "ip":
                        newRow[field.Key] = Scan.GetLocalIPByte();
                        break;

                    case "row_id":
                        newRow[field.Key] = i;
                        break;

                    default:
                        newRow[field.Key] = resRows[i][field.Value];
                        break;
                    }
                }
                sqlRows[i] = newRow;
            }
            SQLFunction.ExecuteNonQuery(
                String.Format("delete from {0} where IP = 0x{1}", proc.InTable, Scan.GetLocalIPAddress(true))
                );
            SQLFunction.BulkWrite(proc.InTable, sqlRows);
        }
コード例 #2
0
 private void ClearSqlData()
 {
     SQLFunction.ExecuteNonQuery(
         String.Format("delete from {0} where IP = 0x{1} ",
                       SQLTableName,
                       Scan.GetLocalIPAddress(true)));
 }
コード例 #3
0
ファイル: ParamSys.cs プロジェクト: Kotvizky/ExcelConvertor
 public ParamSys(string paramName, string outName, FieldFunc ownField) : base(paramName, outName, ownField)
 {
     Service = true;
     if (!Enum.IsDefined(typeof(serviseFields), outName))
     {
         Error = String.Format("not a system field", outName);
     }
     else
     {
         XlsExist = true;
         if (outName == serviseFields.IP.ToString())
         {
             SysValue = Scan.GetLocalIPByte();
             strValue = Scan.GetLocalIPAddress(true);
         }
     }
 }
コード例 #4
0
        string execProcOnServer(ProcSql proc)
        {
            string result = String.Empty;

            if (proc.InPar != "")
            {
                string[] inParSql = new string[2];
                inParSql[0] = proc.InPar;
                if (proc.InPar.ToLower() == "ip")
                {
                    inParSql[1] = Scan.GetLocalIPAddress();
                }
                result = SQLFunction.ExecuteProc(proc.SpName, proc.OutPar, inParSql);
            }
            else
            {
                result = SQLFunction.ExecuteProc(proc.SpName, proc.OutPar);
            }
            return(result);
        }