hi i m working on Student Database Management system, I have used button s for insertion, deletion, and update. Insert and delete button is working but update's click gives syntax error: Pls help as soon as possible:
Try Dim com As New OleDbCommand com.Connection = con com.CommandText = "update BCA2 set Rollno= " & trollno.Text & ",Stu_Name='" & tname.Text & "', FORTRAN = " & tfor.Text & ", Data Structures = " & tds.Text & ", Oracle =" & toracle.Text & ", C++=" & tcpp.Text & ", Unix = " & tunix.Text & " , Lab1 = " & tlab1.Text & ", Lab2 = " & tlab2.Text & ") where Rollno = " & ComboBox1.Text com.ExecuteNonQuery() MsgBox("Record Updated") Call Md_Settings() Catch exp As Exception MsgBox(exp.ToString()) End Try
Edited 6 Years Ago by __avd: Added [code] tags. For easy readability, always wrap programming code within posts in [code] (code blocks).
Don't form a sql string, use parametrized query.
.. com.CommandText = "update BCA2 set [Rollno]= " & trollno.Text & ",[Stu_Name]='" & tname.Text & "', [FORTRAN]= " & tfor.Text & ", [Data Structures]= " & tds.Text & ", [Oracle]=" & toracle.Text & ", [C++]=" & tcpp.Text & ", [Unix] = " & tunix.Text & " , [Lab1] = " & tlab1.Text & ", [Lab2] = " & tlab2.Text & " where [Rollno] = " & ComboBox1.Text ..
thank you............ hehehehe you don't know how happy i am. :) :) :)... It works. Now My student management System is working flawlessly.
Thanks a tonn. :)
i am using visual studio 2015 and trying to export data which i am importing through excel by the user selected Excel file. Now the importing part has been successfully completed i am using OLEDB Connection but Stuck in exporting the same data to a new Excel file. tried ...
I am creating a program that when you print an author, you must show all the information of all the books that the author has written. Add a new attribute in the Author class that will be "BooksWriting: List (Book)".
I have expanded the program so that it also ...
I am currently creating a simulation of a pizza ordering system in object oriented program. I have some question. the instruction and guideline is long but I will try and cut it down a lot. the instruction is to create a program that simulate a pizza restaurant using ...