19 Replies - 432 Views - Last Post: 14 January 2013 - 04:05 PM
#16
Re: Having trouble with proper syntax for sql update statement.
Posted 11 January 2013 - 04:46 PM
I would prefer to prepend 'p' to distinguish between the table and parameter-names, but that's just the way I am
#17
Re: Having trouble with proper syntax for sql update statement.
Posted 11 January 2013 - 04:55 PM
andrewsw, on 11 January 2013 - 05:37 PM, said:
But shouldn't TableEmail, etc., be properties of an object,
They are. They are properties of the PreferencesObj class and get loaded when the application launches. I wouldn't want to have to recompile an application because the DB manager changed the column names. Its much easier to edit the Preferences file the application is reading. The example above is simplistic and just shows the default name, which gets changed when the preferences load.
#18
Re: Having trouble with proper syntax for sql update statement.
Posted 11 January 2013 - 05:05 PM
Don't let anyone change the table names
#19
Re: Having trouble with proper syntax for sql update statement.
Posted 14 January 2013 - 03:56 PM
Is there a a better way of passing null values to parameters?
If DateTimePicker1.Checked = False Then
.Parameters.AddWithValue("@value1", DBNull.Value)
Else
.Parameters.AddWithValue("@value1", DateTimePicker1.Text)
End If
#20
Re: Having trouble with proper syntax for sql update statement.
Posted 14 January 2013 - 04:05 PM
A slight variation is
I don't know if there is a better way.
We can nest With statements as well, but this won't help
/>
.Parameters.AddwithValue("@value1",
If(DateTimePicker1.Checked, DateTimePicker1.Text, DBNull.Value))
I don't know if there is a better way.
We can nest With statements as well, but this won't help
This post has been edited by andrewsw: 14 January 2013 - 04:12 PM
|
|

New Topic/Question
Reply




MultiQuote




|