Permalink
Browse files

put [] around table name

we had a table called Order which is a keyword in sql.
using [] around the table name will allow for a statement like this.
INSERT INTO [Order] (Product) VALUES ('Hat')
  • Loading branch information...
1 parent 32b0dee commit ce1d125a8398face1ed28e761aa206a6e27da3b4 @eiu165 eiu165 committed Oct 2, 2012
Showing with 1 addition and 1 deletion.
  1. +1 −1 Massive.cs
View
@@ -424,7 +424,7 @@ private dynamic BuildPagedResult(string sql = "", string primaryKeyField = "", s
var settings = (IDictionary<string, object>)expando;
var sbKeys = new StringBuilder();
var sbVals = new StringBuilder();
- var stub = "INSERT INTO {0} ({1}) \r\n VALUES ({2})";
+ var stub = "INSERT INTO [{0}] ({1}) \r\n VALUES ({2})";
result = CreateCommand(stub, null);
int counter = 0;
foreach (var item in settings) {

0 comments on commit ce1d125

Please sign in to comment.