Click here to Skip to main content
15,887,336 members
Home / Discussions / Database
   

Database

 
GeneralRe: what is the best way indexing foreign key from multiple table? Pin
Gilbert Consellado10-Feb-17 3:25
professionalGilbert Consellado10-Feb-17 3:25 
QuestionNot sure how to handle this sort of speaking FoxPro DBF Pin
jkirkerx9-Feb-17 7:31
professionaljkirkerx9-Feb-17 7:31 
AnswerRe: Not sure how to handle this sort of speaking FoxPro DBF Pin
jkirkerx9-Feb-17 7:40
professionaljkirkerx9-Feb-17 7:40 
GeneralRe: Not sure how to handle this sort of speaking FoxPro DBF Pin
Gerry Schmitz9-Feb-17 8:17
mveGerry Schmitz9-Feb-17 8:17 
GeneralRe: Not sure how to handle this sort of speaking FoxPro DBF Pin
jkirkerx13-Feb-17 6:40
professionaljkirkerx13-Feb-17 6:40 
GeneralRe: Not sure how to handle this sort of speaking FoxPro DBF Pin
Gerry Schmitz13-Feb-17 9:32
mveGerry Schmitz13-Feb-17 9:32 
GeneralRe: Not sure how to handle this sort of speaking FoxPro DBF Pin
jkirkerx13-Feb-17 11:44
professionaljkirkerx13-Feb-17 11:44 
SuggestionRe: Not sure how to handle this sort of speaking FoxPro DBF Pin
Richard Deeming9-Feb-17 9:14
mveRichard Deeming9-Feb-17 9:14 
Your code is vulnerable to SQL Injection[^]. NEVER use string concatenation to build a SQL query. ALWAYS use a parameterized query.

Everything you wanted to know about SQL injection (but were afraid to ask) | Troy Hunt[^]
How can I explain SQL injection without technical jargon? | Information Security Stack Exchange[^]
Query Parameterization Cheat Sheet | OWASP[^]

VB.NET
Using c3 As New System.Data.OleDb.OleDbCommand("UPDATE ARTRS01.dbf SET FPRICE = @FPRICE, FAMOUNT = @FAMOUNT WHERE FINVNO LIKE '%' + @FINVNO + '%' AND FITEMNO = @FITEMNO", connection)
    c3.Parameters.AddWithValue("@FPRICE", pFPRICE)
    c3.Parameters.AddWithValue("@FAMOUNT", pFPRICE)
    c3.Parameters.AddWithValue("@FINVNO", pFINVNO)
    c3.Parameters.AddWithValue("@FITEMNO", pFITEMNO)
    ...
End Using


Also, be very wary of your LIKE clause. If your pFINVNO is, for example, "1", your query will update every record where the FINVNO column contains 1, including '10', '21', '123456', etc.



"These people looked deep within my soul and assigned me a number based on the order in which I joined."
- Homer


GeneralRe: Not sure how to handle this sort of speaking FoxPro DBF Pin
jkirkerx13-Feb-17 6:34
professionaljkirkerx13-Feb-17 6:34 
QuestionHow do I model this? Pin
Jörgen Andersson7-Feb-17 12:58
professionalJörgen Andersson7-Feb-17 12:58 
AnswerRe: How do I model this? Pin
Mycroft Holmes7-Feb-17 21:52
professionalMycroft Holmes7-Feb-17 21:52 
GeneralRe: How do I model this? Pin
Jörgen Andersson7-Feb-17 22:03
professionalJörgen Andersson7-Feb-17 22:03 
AnswerRe: How do I model this? Pin
Gerry Schmitz9-Feb-17 8:32
mveGerry Schmitz9-Feb-17 8:32 
AnswerRe: How do I model this? Pin
Eddy Vluggen9-Feb-17 10:28
professionalEddy Vluggen9-Feb-17 10:28 
GeneralRe: How do I model this? Pin
Jörgen Andersson13-Feb-17 2:46
professionalJörgen Andersson13-Feb-17 2:46 
GeneralRe: How do I model this? Pin
Eddy Vluggen13-Feb-17 6:42
professionalEddy Vluggen13-Feb-17 6:42 
QuestionLinq-ToSQL Invalid Cast Pin
Kevin Marois2-Feb-17 6:34
professionalKevin Marois2-Feb-17 6:34 
AnswerRe: Linq-ToSQL Invalid Cast Pin
Richard Deeming2-Feb-17 7:04
mveRichard Deeming2-Feb-17 7:04 
GeneralRe: Linq-ToSQL Invalid Cast Pin
Kevin Marois2-Feb-17 7:31
professionalKevin Marois2-Feb-17 7:31 
QuestionHow to convert total database columns datetime to date in the format of dd-mm-yyyy Pin
TarunKumarSusarapu30-Jan-17 19:53
professionalTarunKumarSusarapu30-Jan-17 19:53 
AnswerRe: How to convert total database columns datetime to date in the format of dd-mm-yyyy Pin
Peter Leow30-Jan-17 20:23
professionalPeter Leow30-Jan-17 20:23 
GeneralRe: How to convert total database columns datetime to date in the format of dd-mm-yyyy Pin
TarunKumarSusarapu30-Jan-17 20:29
professionalTarunKumarSusarapu30-Jan-17 20:29 
AnswerRe: How to convert total database columns datetime to date in the format of dd-mm-yyyy Pin
Peter Leow30-Jan-17 20:46
professionalPeter Leow30-Jan-17 20:46 
GeneralRe: How to convert total database columns datetime to date in the format of dd-mm-yyyy Pin
Chris Quinn31-Jan-17 0:33
Chris Quinn31-Jan-17 0:33 
GeneralRe: How to convert total database columns datetime to date in the format of dd-mm-yyyy Pin
TarunKumarSusarapu31-Jan-17 1:07
professionalTarunKumarSusarapu31-Jan-17 1:07 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.