Click here to Skip to main content
15,867,835 members
Home / Discussions / Visual Basic
   

Visual Basic

 
QuestionLinq, GroupBy, Select, First() or Last() Pin
jkirkerx28-Aug-19 12:38
professionaljkirkerx28-Aug-19 12:38 
AnswerRe: Linq, GroupBy, Select, First() or Last() Pin
Maciej Los28-Aug-19 21:24
mveMaciej Los28-Aug-19 21:24 
GeneralRe: Linq, GroupBy, Select, First() or Last() Pin
jkirkerx29-Aug-19 6:59
professionaljkirkerx29-Aug-19 6:59 
AnswerRe: Linq, GroupBy, Select, First() or Last() Pin
Richard Deeming29-Aug-19 7:14
mveRichard Deeming29-Aug-19 7:14 
GeneralRe: Linq, GroupBy, Select, First() or Last() Pin
jkirkerx29-Aug-19 8:32
professionaljkirkerx29-Aug-19 8:32 
QuestionTrying to make a fixed asset program using visual studio and sql server I got a conversion error varchar to numeric Pin
Augusto10026-Aug-19 6:51
Augusto10026-Aug-19 6:51 
AnswerRe: Trying to make a fixed asset program using visual studio and sql server I got a conversion error varchar to numeric Pin
ZurdoDev26-Aug-19 7:38
professionalZurdoDev26-Aug-19 7:38 
AnswerRe: Trying to make a fixed asset program using visual studio and sql server I got a conversion error varchar to numeric Pin
Richard Deeming27-Aug-19 2:55
mveRichard Deeming27-Aug-19 2:55 
VB.NET
cmd.CommandText = "INSERT INTO [Equipos de Computacion] (CodigoInterno, NumerodeSerie, NumerodeFactura, FechadeCompra, Precio, Acargode, Estado, Caracteristicas, Depreciacion) VALUES  (@CodigoInterno, @NumerodeSerie, @NumerodeFactura, @FechadeCompra, @Precio, @Acargode, @Estado, @Caracteristicas, @Depreciacion)"

cmd.Parameters.AddWithValue("@CodigoInterno", CInt(Me.txtCodigoInterno.Text))
cmd.Parameters.AddWithValue("@NumerodeSerie", CInt(Me.txtNumerodeSerie.Text))
cmd.Parameters.AddWithValue("@NumerodeFactura", CInt(Me.txtNumerodeFactura.Text))
cmd.Parameters.AddWithValue("@FechadeCompra", CDate(Me.DateTimePicker1.Value))
cmd.Parameters.AddWithValue("@Precio", Me.nudPrecio.Value)
cmd.Parameters.AddWithValue("@Acargode", Me.txtACargode.Text)
cmd.Parameters.AddWithValue("@Estado", Me.txtEstado.Text)
cmd.Parameters.AddWithValue("@Caracteristicas", Me.txtCaracteristicas.Text)
cmd.Parameters.AddWithValue("@Depreciacion", Me.NudDepreciacion.Value)
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[^]

Once you've fixed that critical security vulnerability in your code, you'll need to check that the values you're trying to insert match the data types of the columns in your table.

You should also avoid using CInt and CDate to convert user input. If the user types in something that can't be converted, you'll get an exception. Instead, use Integer.TryParse[^] / Date.TryParse[^] and display a warning to the user if their input is invalid.



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

GeneralRe: Trying to make a fixed asset program using visual studio and sql server I got a conversion error varchar to numeric Pin
Augusto10027-Aug-19 5:36
Augusto10027-Aug-19 5:36 
GeneralRe: Trying to make a fixed asset program using visual studio and sql server I got a conversion error varchar to numeric Pin
Richard Deeming27-Aug-19 5:40
mveRichard Deeming27-Aug-19 5:40 
GeneralRe: Trying to make a fixed asset program using visual studio and sql server I got a conversion error varchar to numeric Pin
Augusto10027-Aug-19 6:23
Augusto10027-Aug-19 6:23 
GeneralRe: Trying to make a fixed asset program using visual studio and sql server I got a conversion error varchar to numeric Pin
Richard Deeming27-Aug-19 6:30
mveRichard Deeming27-Aug-19 6:30 
GeneralRe: Trying to make a fixed asset program using visual studio and sql server I got a conversion error varchar to numeric Pin
Augusto10027-Aug-19 6:36
Augusto10027-Aug-19 6:36 
GeneralRe: Trying to make a fixed asset program using visual studio and sql server I got a conversion error varchar to numeric Pin
Richard Deeming27-Aug-19 7:07
mveRichard Deeming27-Aug-19 7:07 
GeneralRe: Trying to make a fixed asset program using visual studio and sql server I got a conversion error varchar to numeric Pin
Mycroft Holmes27-Aug-19 15:14
professionalMycroft Holmes27-Aug-19 15:14 
QuestionCount the number of database hit were made Pin
desanti24-Aug-19 12:37
desanti24-Aug-19 12:37 
AnswerRe: Count the number of database hit were made Pin
Gerry Schmitz25-Aug-19 2:30
mveGerry Schmitz25-Aug-19 2:30 
GeneralRe: Count the number of database hit were made Pin
desanti25-Aug-19 3:49
desanti25-Aug-19 3:49 
GeneralRe: Count the number of database hit were made Pin
Gerry Schmitz25-Aug-19 11:38
mveGerry Schmitz25-Aug-19 11:38 
GeneralRe: Count the number of database hit were made Pin
desanti25-Aug-19 15:07
desanti25-Aug-19 15:07 
AnswerRe: Count the number of database hit were made Pin
Mycroft Holmes26-Aug-19 12:14
professionalMycroft Holmes26-Aug-19 12:14 
GeneralRe: Count the number of database hit were made Pin
desanti26-Aug-19 13:41
desanti26-Aug-19 13:41 
AnswerRe: Count the number of database hit were made Pin
Richard Deeming27-Aug-19 2:46
mveRichard Deeming27-Aug-19 2:46 
QuestionAre these queries doing the same thing Pin
desanti24-Aug-19 6:37
desanti24-Aug-19 6:37 
QuestionRe: Are these queries doing the same thing Pin
Richard MacCutchan24-Aug-19 20:54
mveRichard MacCutchan24-Aug-19 20:54 

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.