After some research, the fastest thing I found turns out to be just using linq for sql with a GridView. I was looking for a solution that can easily integrate into existing pages. Without the benefits of auto-scaffolding and generated pages, Dynamic Data kinda skips the mark. 99% of what I wanted was to avoid entering SQL statements and manually processing UpdateCommands commands.
Here are the steps I wrote for my personal link. It depends heavily on designers, but for what I need it, it's perfect:
- New project (or existing project)
- Add LinqToSqlClass file to project
- Add relevant tables from a data source for surface design (use server explorer)
- Build a project (so that the datacontext class is generated)
- Go to aspx page
- Drag the linqdatasource object from the toolbar.
- Configure the data source (be sure to enable the update if necessary)
- Drag the grid from the toolbar
- Set data source for created linqdatasource object
- Customize columns if necessary (i.e. set the readonly property to immutable columns, hide inappropriate columns.)
Regarding dynamic data, documentation is currently lacking. There are many things that reference earlier versions that are currently not working. I watched the video here and followed the steps here , but ended up having problems when I tried to hide non-editable columns. The update statement created by linq did not refer to the primary key, and I got a string not found or modified . I gave up and used the solution above.
Hope this helps someone else in the future!
Tim coker
source share