Hello
I'm trying to create a form for updating different tables.
I've created sqldatasource controls that connect to the database and by dropdown their select command changes so that the selected item(table) in the dropdown displays the desired table. Now my question is, what would be the best way to update/edit the different tables? I cannot create textboxes because the tables are different in amount of columns and type of columns.
I hope I was understandble. Any help is greatly appreciated.
By the way, I tried using the update command with the gridview control but since the columns are changed by dropdown I cannot write the update command query.(Any ideas?)
Thanks,
Guy
Posted Jul 30, 2008, 5:31 AM
Use Following Steps:
1. Get the All Tables of a database using "Select Name From Sysobjects Where Type='U' Order By crDate Desc"
2. For getting the column of a particular table use "Select Column_Name From Information_Schema.Columns Where Table_Name=TableName"
3. Display these values in checkbox or any other controls as per your convenient step second also give you the data type
step 2 query also give you the datatype of column so you can easily validate input data