Esempio n. 1
0
 public static void Load_To_AQT_Database(OPCField F, float Value, DateTime time, MySqlConnection conn)
 {
     MySqlCommand c = new MySqlCommand("INSERT INTO opc_data (Value,Time,ID) VALUES (@val,@t,@id)", conn);
     c.Parameters.Add(FillP("@val", Value, MySqlDbType.Float));
     c.Parameters.Add(FillP("@id", F.ID, MySqlDbType.Int32));
     c.Parameters.Add(FillP("@t", time, MySqlDbType.DateTime));
     //c.Parameters.Add(FillParam("@st", d.fieldinfo.StationInfo.StationID, conn, System.Data.SqlDbType.TinyInt));
     c.ExecuteNonQuery();
 }
Esempio n. 2
0
        public static OPCField GetFieldInfo(string Name, MySqlConnection conn)
        {
            MySqlCommand c = new MySqlCommand(string.Format("SELECT * FROM fields WHERE Name ='{0}'", Name), conn);
            OPCField Field = null;

            MySqlDataReader reader = c.ExecuteReader();

            try
            {
                if (reader.Read())
                {
                    Field = new OPCField();
                    Field.ID = (int)reader["ID"];
                    Field.Name = (string)reader["Name"];
                    Field.Scale = reader.GetFloat("Scale");
                }
            }
            finally
            {
                reader.Close();
            }
            return Field;
        }
Esempio n. 3
0
 public void InsertnewOPCField(OPCField F, MySqlConnection conn)
 {
     MySqlCommand c = new MySqlCommand("INSERT into fields ( Name ) VALUES (  ) " , conn);
 }