S
steven_licciardinnoossppaamm
Does anyone have an example of constructing command
strings using column names with spaces? For example I
have :
Dim strCommUpd As String = "UPDATE DTable SET [AESLRef]=@
[AESLRef], [Test Column]=@[Test Column] WHERE ID=@ID"
My parameters would then take the form:
commUpd.Parameters.Add("@[AESLRef]", sqlDBType.VarChar,
50, "[AESLRef]")
commUpd.Parameters.Add("@[Test Column]",
sqlDBType.DateTime, 8, "[Test Column]")
When I try and do an update to save changes in the data I
get an error of the form : Incorrect syntax near 'varchar'
If I get rid of the varchar column then the error
specifies the next type (i.e. Incorrect syntax
near 'datetime')
This is the same code that works for the column names
without spaces so I can only assume I have an error
somewhere else.
Thanks,
Steven
strings using column names with spaces? For example I
have :
Dim strCommUpd As String = "UPDATE DTable SET [AESLRef]=@
[AESLRef], [Test Column]=@[Test Column] WHERE ID=@ID"
My parameters would then take the form:
commUpd.Parameters.Add("@[AESLRef]", sqlDBType.VarChar,
50, "[AESLRef]")
commUpd.Parameters.Add("@[Test Column]",
sqlDBType.DateTime, 8, "[Test Column]")
When I try and do an update to save changes in the data I
get an error of the form : Incorrect syntax near 'varchar'
If I get rid of the varchar column then the error
specifies the next type (i.e. Incorrect syntax
near 'datetime')
This is the same code that works for the column names
without spaces so I can only assume I have an error
somewhere else.
Thanks,
Steven