Help needed, VB.NET questions

View previous topic View next topic Go down

Help needed, VB.NET questions

Post by NamelessNinja on Fri 05 Aug 2016, 9:19 am

Hello guys, I want to ask, is there any other way to enter data to access database?

My current solution:
Code:
Dim sql as String = "insert into blablabla(bla1, bla2, bla3) values("
sql = sql & "'" & Textbox1.Text & "',"    'this is to fill bla1
sql = sql & "'" & Textbox2.Text & "'."    'this is to fill bla2
sql = sql & "'" & Textbox3.Text & “')"    'this is to fill bla3
command = New OleDb.OleDbCommand(sql, connection)
command.ExecuteNonQuery()
But I notice that, this is a very inefficient way because I noticed, a single symbol can crash the system.
For example, I entered ' inside the textbox, and submit it, the system will crash.

Dear sifus, can you teach me how to enter data in different way other than what I show above?
avatar
NamelessNinja
New User
New User

Republican Party Liberal Democrats Donald Trump
Posts : 6
Join date : 2016-08-05
Male Age : 21
Location : Bishan

View user profile

Back to top Go down

Re: Help needed, VB.NET questions

Post by Baronic on Mon 08 Aug 2016, 8:44 am

Learn code VB.NET ah
avatar
Baronic
New User
New User

Conservative Party Les Républicains
Gary Johnson
Posts : 44
Join date : 2015-12-16
Male Age : 27
Location : Malaysia

View user profile

Back to top Go down

View previous topic View next topic Back to top

- Similar topics

 
Permissions in this forum:
You cannot reply to topics in this forum