A careless mistake in ActiveRecord for MySql
I am writing a program for myself by using ActiveRecord. I am an MS SQL Server Develper. So, I just did in a careless mistake. I called a table , User. If you call a table will crash with system table name, we use '[' and ']'. I hardcoded the table name in '[User]' in a Model class for ActiveRecord. I can't create a schema by Active Record. Because in MySql, we use '`'. So, it should be
Code
[ActiveRecord("`User`")] | |
| |
public class User : ActiveRecordBase |
Not
Code
[ActiveRecord("[User]")] | |
| |
public class User : ActiveRecordBase |
Trackback address for this post
Trackback URL (right click and copy shortcut/link location)
Feedback awaiting moderation
This post has 10 feedbacks awaiting moderation...
Form is loading...