I have an ASP.NET project and would like to create a page where my system admins can modify database table data (insert, update, and delete rows).
First, I have a drop down that is databound based on the tables in the database:
DdlTable.DataSource = from x in dc.Mapping.GetTables()
orderby x.TableName.Replace("dbo.", "")
select new {TableName = x.TableName.Replace("dbo.", "")};
DdlTable.DataTextField = "TableName";
DdlTable.DataValueField = "TableName";
DdlTable.DataBind();
DdlTable.Items.Insert(0, "Select a Table");
Next, I would like to have a gridview (or some other data object) that is bound to a table upon selection, and have the columns, insert, update, and delete functionality built dynamically. Can this be done without coding for each specific table?
Obviously, I can create x number of gridviews and datasources, but I would like it to be built dynamically for flexibility and minimal coding.
Essentially, I want to have a simple web-based SQL manager.