This question is locked. New answers and comments are not allowed.
Hello,
Im evaluating Data Access ORM as a gate to also purchase DevCraft complete package , I want to move away from Entity Framework into a more powerful and clean ORM, I read the features and I like it, installed the free edition but having a problem getting data binding to work properly as I expect in a windows forms test app, here is what I did (im using SQL Server 2012):
1. Create a class lib project , create the domain model , insert only 1 table
2. at same solution in the main app exe windows forms app , I referenced the open access 2 dlls , config file , class lib project , no problem
3. in the main app , I created a project new data source , pointed to the domain model then the table object (entity)
4. in a new form, i dragged a MS DataGridView , then dragged the object entity from the data source window into the GridView , then columns are automatically created and a BindingSource is created in the form tray , no problem so far and this exactly so far like entity framework
5. in the form load I created a new context , then a LINQ query to read all the data like that
myContext=new ControlModel
dim IPList = From a in db.IPLists
IPListBindingSource.DataSource=IPList
6. running the app , now I can see the data in the grid and edit it , however I can NOT add new rows, the + sign of the navigator is not active , if I enforce that by
IPListBindingSource.AllowNew=True
then the + sign in the navigator is now active and I can add new row to the grid but when I try to save to SQL server later by running
db.SaveChanges
nothing is saved to the database
7. same problem with deleting rows , when I delete a row from the grid then save
db.SaveChanges
its not deleted from database
so I have problem in both Delete & Insert , but SELECT (LINQ) & EDIT then save works fine
can you kindly tell me what im doing wrong , all this works fine with Entity Framework with exactly same steps
Thank you
Bassam
Im evaluating Data Access ORM as a gate to also purchase DevCraft complete package , I want to move away from Entity Framework into a more powerful and clean ORM, I read the features and I like it, installed the free edition but having a problem getting data binding to work properly as I expect in a windows forms test app, here is what I did (im using SQL Server 2012):
1. Create a class lib project , create the domain model , insert only 1 table
2. at same solution in the main app exe windows forms app , I referenced the open access 2 dlls , config file , class lib project , no problem
3. in the main app , I created a project new data source , pointed to the domain model then the table object (entity)
4. in a new form, i dragged a MS DataGridView , then dragged the object entity from the data source window into the GridView , then columns are automatically created and a BindingSource is created in the form tray , no problem so far and this exactly so far like entity framework
5. in the form load I created a new context , then a LINQ query to read all the data like that
myContext=new ControlModel
dim IPList = From a in db.IPLists
IPListBindingSource.DataSource=IPList
6. running the app , now I can see the data in the grid and edit it , however I can NOT add new rows, the + sign of the navigator is not active , if I enforce that by
IPListBindingSource.AllowNew=True
then the + sign in the navigator is now active and I can add new row to the grid but when I try to save to SQL server later by running
db.SaveChanges
nothing is saved to the database
7. same problem with deleting rows , when I delete a row from the grid then save
db.SaveChanges
its not deleted from database
so I have problem in both Delete & Insert , but SELECT (LINQ) & EDIT then save works fine
can you kindly tell me what im doing wrong , all this works fine with Entity Framework with exactly same steps
Thank you
Bassam