Open sharpcoder7 opened 8 years ago
Can you give me some sample code? Are you using DynamicDb
or DynamicRepository
?
dynamic db = new DynamicDb();
var all = db.Order.All();
Just change this line: https://github.com/amirrajan/Oak/blob/master/Oak/DynamicDb.cs#L30 to
var tableName = "[" + callInfo.Name + "]";
The source code should be under a folder called /Oak
in your project.
sorry but this will not work. In method TableExists
.
we quering .Query("select name from sysobjects where name = @0", table)
if table name will contain square brackets like [DailySettlements]
then this script returns zero record.
program will fail due table [DailySettlements] is not exists
Hmm, maybe just put "[" + tableName + "]"
around this line? https://github.com/amirrajan/Oak/blob/master/Oak/DynamicDb.cs#L39
You could also add table.Replace("[", "").Replace("]", "")
here: https://github.com/amirrajan/Oak/blob/master/Oak/Association.cs#L1031
Hello! I begin dig this good project and found an issue. If I have table
[Order]
massive throws an exception because the table name is a t-sql keyword. So in all requests we need to use [Order]
instead ofOrder
. So I think the solution will be a creating ofHashSet
of t-sql keywords and check table name before it will be inserted into a query. Possible another easiest solutions exists?ps I cant rename the table because another software uses this database .