#include <EEPROM.h> #include <SoftwareSerial.h> SoftwareSerial xbee(2, 3); int incoming; int id; int rea; int comp=0; void setup() { Serial.begin(9600); xbee.begin( 9600 ); } void loop() { if(Serial.available()) { Serial.print("hhhh"); id = Serial.read(); incoming = Serial.read(); if(id!='New') { xbee.println(id); xbee.println(incoming); EEPROM.write(id, incoming); rea = EEPROM.read(id); Serial.print(id); } else { EEPROM.write(comp, incoming); rea = EEPROM.read(id); Serial.print(id); comp+=1; } } }
protected void Button7_Click(object sender, EventArgs e) { { SerialPort comPort = new SerialPort("COM3", 9600, Parity.None, 8, StopBits.One); try { comPort.Open(); comPort.Write(TextBox1.Text); comPort.Write("Delete"); comPort.Close(); } catch (UnauthorizedAccessException ex) { Response.Write("Error:" + ex.ToString()); } try { OleDbConnection conn = new OleDbConnection("Provider= Microsoft.Jet.OLEDB.4.0;Data Source=" + Server.MapPath("App_Data\\Stock.mdb")); conn.Open(); Int32 ash = Convert.ToInt32(TextBox1.Text); string deleteQuery = "delete from Instock where ID= '" + ash + "'"; OleDbCommand com = new OleDbCommand(deleteQuery, conn); com.ExecuteNonQuery(); Response.Write("Item deleted successfully"); Response.Redirect("UpdateDB.aspx"); conn.Close(); } catch (Exception ex) { Response.Write("Error:" + ex.ToString()); } } }
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)