Can somebody help me here? i have managed to import excel data into a datagridview but am having problems saving and updating it. It is saving alright but when it comes to updating that's when i have problems.
here is my code:
If mysqldr.HasRows Then mysqldr.Close() newcommand = New MySqlCommand(" Update item_stock set Item_Name = '" & Replace(itemname, "'", "''") & "' ,Sale_Price = "' & Retailprice &"'" , newconnection) newcommand.ExecuteNonQuery() Else mysqldr.Close() sqrs = "insert into item_stock(Item_Name,Vehiclename,VAT_Rate,Supp_Name,Binno,Gearboxtype,Superseedingno,Engineno,Partno,oemname,model,Qty,Buyingprice,Sale_Price)values('" & _ Replace(itemname, "'", "''") & "','" & vname & "',16,'" & suppname & "'" )" newcommand = New MySqlCommand(sqrs, newconnection) newcommand.ExecuteNonQuery() Me.ProgressBar1.Increment(id) End If id = id + 1 ProgressBar1.Maximum = DataGridView1.RowCount - 1
if somebody can help me out i would really appreciate it.Please......... :-)
Edited 5 Years Ago by __avd: Added [code] tags. Do wrap your programming code blocks within [code] ... [/code] tags