How to use textbox value in sql statement
-
Hi all, here's a part of the code im tryin to use "WHERE PSCustID LIKE '"+ txtSearchString.Text +"%'"; and i got error when running it... am i doin it right? tnx in advance ;) -::maximus::-
-
Hi all, here's a part of the code im tryin to use "WHERE PSCustID LIKE '"+ txtSearchString.Text +"%'"; and i got error when running it... am i doin it right? tnx in advance ;) -::maximus::-
-
An unhandled exception of type 'System.Data.OleDb.OleDbException' occurred in system.data.dll -::maximus::-
-
An unhandled exception of type 'System.Data.OleDb.OleDbException' occurred in system.data.dll -::maximus::-
Hi.. The part of the SQL statement that you've sent seems correct...You need to get a specific error to understand what exactly is going wrong.. You can do one thing, use Try-Catch to handle the exception. Try //code Catch ex as OleDbException' MessageBox.Show(ex.Message) End Try
-
Hi all, here's a part of the code im tryin to use "WHERE PSCustID LIKE '"+ txtSearchString.Text +"%'"; and i got error when running it... am i doin it right? tnx in advance ;) -::maximus::-
You should use parameterized qzeries to increase security of your code as well as readibility. Take a look at the following article here on CP: SQL Injection Attacks and Some Tips on How to Prevent Them[^]
"Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning." - Rick Cook
-
Hi.. The part of the SQL statement that you've sent seems correct...You need to get a specific error to understand what exactly is going wrong.. You can do one thing, use Try-Catch to handle the exception. Try //code Catch ex as OleDbException' MessageBox.Show(ex.Message) End Try
ok tnx, ill try it. -::maximus::-