SensorValue is < 20
try { SqlConnection sqlconn = new SqlConnection("Data Source=AN-PC;Initial Catalog=Feb12;Integrated Security=True"); SqlDataAdapter sa = new SqlDataAdapter(); string query; query = "insert into Table_1( SensorID,SensorValue,DateTime) values( @TM, @NT, @MN)"; sa.InsertCommand = new SqlCommand(query, sqlconn); sa.InsertCommand.Parameters.AddWithValue("@TM", y); sa.InsertCommand.Parameters.AddWithValue("@NT", x); sa.InsertCommand.Parameters.AddWithValue("@MN", DateTime.Now.ToString()); sqlconn.Open(); try { sa.InsertCommand.ExecuteNonQuery(); } catch (FormatException ex) { MessageBox.Show(ex.Message); } feb12DataSet.GetChanges(); table_1TableAdapter4.Fill(feb12DataSet.Table_1); sqlconn.Close(); } catch (SqlException ea) { MessageBox.Show(ea.Message); }
DataTable tblMEN = dsView.Tables["MEN"]; DataRow[] results = tblMen.Select("SensorValue < 20");
DataTable dtSensor = feb12DataSet.Tables[0].Select("SensorValue < 20") // use Table index or Name of table
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)