Hi,
I’m coding a program that calculates new par values after completing a course. I am using SQLite as the database engine and VB as the user interface. I have successfully created a database, added table to that database and show the data within a listbox. The problem I have is when I enter players into the database I want to add thier par. I want to run mathematical calculations on that data so I beleive it needs to be added as numerical data. I have used a NumericUpDown component to capture this data and used this code, which fails:
[SIZE=2]SQLcommand.CommandText = [/SIZE][SIZE=2][COLOR=#a31515][SIZE=2][COLOR=#a31515]"INSERT INTO par (player, para) VALUES ('"[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2] & txtName.Text.Replace([/SIZE][SIZE=2][COLOR=#a31515][SIZE=2][COLOR=#a31515]"'"[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2], [/SIZE][SIZE=2][COLOR=#a31515][SIZE=2][COLOR=#a31515]"''"[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2]) & [/SIZE][SIZE=2][COLOR=#a31515][SIZE=2][COLOR=#a31515]"', '"[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2] & numPar.value([/SIZE][SIZE=2][COLOR=#a31515][SIZE=2][COLOR=#a31515]"'"[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2], [/SIZE][SIZE=2][COLOR=#a31515][SIZE=2][COLOR=#a31515]"''"[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2]) & [/SIZE][SIZE=2][COLOR=#a31515][SIZE=2][COLOR=#a31515]"')"[/COLOR][/SIZE]
[/COLOR][/SIZE]
I’ve successfully captured the data in a textbox but I’m worried it being text I won’t be able to run calculations on it.
[SIZE=2]SQLcommand.CommandText = [/SIZE][SIZE=2][COLOR=#a31515][SIZE=2][COLOR=#a31515]"INSERT INTO par (player, para) VALUES ('"[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2] & txtName.Text.Replace([/SIZE][SIZE=2][COLOR=#a31515][SIZE=2][COLOR=#a31515]"'"[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2], [/SIZE][SIZE=2][COLOR=#a31515][SIZE=2][COLOR=#a31515]"''"[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2]) & [/SIZE][SIZE=2][COLOR=#a31515][SIZE=2][COLOR=#a31515]"', '"[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2] & txtPar.Text.Replace([/SIZE][SIZE=2][COLOR=#a31515][SIZE=2][COLOR=#a31515]"'"[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2], [/SIZE][SIZE=2][COLOR=#a31515][SIZE=2][COLOR=#a31515]"''"[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2]) & [/SIZE][SIZE=2][COLOR=#a31515][SIZE=2][COLOR=#a31515]"')"[/COLOR][/SIZE]
[/COLOR][/SIZE]
Can anyone point me in the write direction or tell me what I’m missing.