Hello,
I am developing one inventory software. It an software, hardware and user details entry. Insert and delete operations working properly. Some times There are many entries in same name. So i doing update and delete process are based upon serial number. Before that search the data and display it in gridview.
Update:
From that gridview data will reterive. If there is one entry means click update all the data are passed into insert form. From there the update is performing.
But more there one entry means how can do it?
Update statement is working. It showing data is updated. But data is not updated in database. or it showing syntax error.
See this code please. This is the code i tried,
protected void Button4_Click(object sender, EventArgs e)
{
int x;
String s;
s = TextBox24.Text;
x = (Convert.ToInt32(s));
cmd = new OleDbCommand("UPDATE hardware SET hardwarename=@HW, purchasedate=@PD, description=@DE, rate=@RA, deliverydate=@DD, vendarname=@VN, AMC=@AM, firstname=@FN, lastname=@L, assettag=@AT, processor=@PR, RAM=@RA, harddisk=@HD, DVD=@DVD, serivce tag=@ST WHERE sno=@SN", con);
cmd.Parameters.AddWithValue("@HW", TextBox2.Text);
cmd.Parameters.AddWithValue("@PD", TextBox4.Text);
cmd.Parameters.AddWithValue("@DE", TextBox6.Text);
cmd.Parameters.AddWithValue("@RA", TextBox7.Text);
cmd.Parameters.AddWithValue("@DD", TextBox8.Text);
cmd.Parameters.AddWithValue("@VN", TextBox39.Text);
cmd.Parameters.AddWithValue("@AM", TextBox11.Text);
cmd.Parameters.AddWithValue("@FN", TextBox12.Text);
cmd.Parameters.AddWithValue("@LN", TextBox31.Text);
cmd.Parameters.AddWithValue("@AT", TextBox25.Text);
cmd.Parameters.AddWithValue("@PR", TextBox27.Text);
cmd.Parameters.AddWithValue("@RA", TextBox28.Text);
cmd.Parameters.AddWithValue("@HD", TextBox29.Text);
cmd.Parameters.AddWithValue("@DVD", TextBox30.Text);
cmd.Parameters.AddWithValue("@ST", TextBox32.Text);
cmd.Parameters.AddWithValue("@SN", x);
cmd.ExecuteNonQuery();
Response.Write("<Script>alert('Data has been updated Successfully')</Script>");
}
Search:
The search option is based on name, department, softwarename in one button option.
Can you say the coding for this option.
I am waiting for your kind reply. Because I need to complete soon.
Thank you,