This is a migrated thread and some comments may be shown as answers.

Dynamic Datasource / Grid

1 Answer 85 Views
Grid
This is a migrated thread and some comments may be shown as answers.
David Boylan
Top achievements
Rank 2
David Boylan asked on 25 Feb 2009, 03:52 PM
Hi All

I have a requirement to have a grid that can display, update, insert and delete items from multiple tables.  I will have a dropdown list which contains the list of tables and then a grid which is bound when a dropdown list item is selected.  The grid is setup to generate the columns headers at runtime.

I basically have a function that takes a table name and returns the data for that table.  Select * from "table_name".

The problem comes when I need to insert, update and delete.  The grid control requires me to bind to a ObjectDataSource or SQLDataSource control.  I obviously cannot use a SQLDataSource as the table / select statement changes.  A ObjectDataSource could bind to a class that some how constructed the statements on the fly but you start to get issues.

Is there any simpler way of doing this ?  Has anyone done it before?  Would apperciate some help.

Thanks

Michael

1 Answer, 1 is accepted

Sort by
0
Princy
Top achievements
Rank 2
answered on 26 Feb 2009, 05:24 AM
Hi Michael,

Refer the code library which explains how to perform Insert/Update/Delete with stored procedure. I hope this helps you.
Update/Insert/Delete with stored procedures and SqlDataSource control

Thanks,
Princy. 
Tags
Grid
Asked by
David Boylan
Top achievements
Rank 2
Answers by
Princy
Top achievements
Rank 2
Share this question
or