Reputation: 95
I am trying to perform INSERT INTO
Operation using SqlCommand
in VB .NET. My DataTable
has one Column with a space in its Name. Due to this column name I am not able to perform INSERT INTO Operation. I am getting an error message stating:
Incorrect Syntax near Column Name
I don't want to change the column name in the DataTable. Is there a way to fix this problem?
Upvotes: 0
Views: 159
Reputation: 1989
Use [table name]. Same thing for columns. Means anything with spaces must be placed inside the braces as mentioned by Tushar
Upvotes: 0
Reputation: 15913
That can be rectified Just place your name in []
, If naming is the only issue.
Upvotes: 2