Exemplo n.º 1
0
 public static void InsertDTC(string Name1, string Name2, string Name3, string Name4, string Name5, string Name6)
 {
     try
     {
         string strInsert = " INSERT INTO [DTC] ([Name1],[Name2],[Name3],[Name4],[Name5],[Name6]) VALUES ('"
                            + Name1 + "','" + Name2 + "','" + Name3 + "','" + Name4 + "','" + Name5 + "','" + Name6 + "')";
         OleDbCommand inst = new OleDbCommand(strInsert, Conn);
         inst.ExecuteNonQuery();
     }
     catch
     {
         log.Info("DTC数据库储存出错!");
         MyMeans.AccessBreak();
     }
 }
Exemplo n.º 2
0
 public static void DropAccess()
 {
     try
     {
         MyMeans.AccessLink();
         string       strInsert = " delete * from ECD_ID ";
         OleDbCommand inst      = new OleDbCommand(strInsert, Conn);
         inst.ExecuteNonQuery();
         MyMeans.AccessBreak();
     }
     catch
     {
         log.Info("ID数据清除出错!");
         MyMeans.AccessBreak();
     }
 }
Exemplo n.º 3
0
 public static void InsertAccess(string ID, string Description, string TBytes, string Data, string Value)
 {
     try
     {
         MyMeans.AccessLink();
         string       strInsert = " INSERT INTO [ECD_ID] ([ID],[描述],[类型长度],[数据],[ASCII值]) VALUES ( '" + ID + "','" + Description + "','" + TBytes + "','" + Data + "','" + Value + "')";
         OleDbCommand inst      = new OleDbCommand(strInsert, Conn);
         inst.ExecuteNonQuery();
         MyMeans.AccessBreak();
     }
     catch
     {
         log.Info("ID数据储存出错!");
         MyMeans.AccessBreak();
     }
 }
Exemplo n.º 4
0
        /// <summary>
        /// 返回DataSet 数据
        /// </summary>
        /// <returns></returns>
        public static DataSet   GetEcuTrip(String EcuVersion)
        {
            DataSet ds = new DataSet();

            try
            {
                MyMeans.AccessLink();
                String           select = "SELECT * FROM  ECU13Tp  where EcuVersion='" + EcuVersion + "'";
                OleDbDataAdapter da     = new OleDbDataAdapter(select, Conn);
                da.Fill(ds, "Table1_1");
                MyMeans.AccessBreak();
            }
            catch (Exception e) {
                log.Info("read ecu tp  by version is error" + e.Message);
                MyMeans.AccessBreak();
            }
            return(ds);
        }
Exemplo n.º 5
0
 public static void DropDTC()
 {
     try
     {
         MyMeans.AccessLink();
         string       strInsert = " delete * from DTC ";
         OleDbCommand inst      = new OleDbCommand(strInsert, Conn);
         inst.ExecuteNonQuery();
         strInsert = " ALTER TABLE  DTC ALTER COLUMN ID COUNTER (1,1)";
         inst      = new OleDbCommand(strInsert, Conn);
         inst.ExecuteNonQuery();
         MyMeans.AccessBreak();
     }
     catch
     {
         log.Info("DTC数据库清除出错!");
         MyMeans.AccessBreak();
     }
 }
Exemplo n.º 6
0
 public static void InsertTrip(string Name1, string Name2, string Name3, string Name4, string Name5,
                               string Name6, string Name7, string Name8, string Name9, string Name10)
 {
     try
     {
         MyMeans.AccessLink();
         string strInsert = " INSERT INTO [Trip] ([Name1],[Name2],[Name3],[Name4],[Name5],[Name6],[Name7],[Name8],[Name9],[Name10]) VALUES ( '"
                            + Name1 + "','" + Name2 + "','" + Name3 + "','" + Name4 + "','" + Name5 + "','" + Name6 + "','" + Name7 + "','" + Name8
                            + "','" + Name9 + "','" + Name10 + "')";
         OleDbCommand inst = new OleDbCommand(strInsert, Conn);
         inst.ExecuteNonQuery();
         MyMeans.AccessBreak();
     }
     catch
     {
         log.Info("行程记录数据库储存出错!");
         MyMeans.AccessBreak();
     }
 }