the table has created my problem is how do you insert the values in the database and when you opening the page how do you diplay the values on the form...
If you have use a "DataTable"/"DataSet", it will automatically keep track of additions/updates/deletions, and you can utilize the "SqlDataAdapter" (or "OleDbDataAdapter") and its "InsertCommand" property in conjuntion with an "SqlCommand" to communicate additions to the database.
As far as displaying the data on a Web Form, you can easily bind a DataTable or DataSet to a DataGrid control using something like this:
A DataGrid is rendered as a <table> on the client, it's just that the table is built for you, and it has a bunch of bells and whistles attached (like Events).
You may be crippling yourself if you insist on using a plain old HTML table (assuming there aren't constraints I don't know about). It's much more difficult to keep track of user interactions without the DataGrid.
i did try using Datagrid but i was struggling, my form has to diplay more that 20 rows with 8 colums and on of the columns populate a dropdownlistbox and i was struggling to populate the listbox that why i chose to use html table, unless you can help me in using a datagrid
The DataGrid is a little tricky to get used to, but once you do, you'll love it.
What you probably want to do is create a DataTable full of your data, and manually create a column on the DataGrid for each column of the DataTable (through the designer).
For the column with the DropDownList, create a TemplateColumn. This looks like a good, pretty simple tutorial on the subject:
I am, of course, assuming that your table of data has rows with a common column structure.
All of the DataGrid stuff is, indeed, overwhelming at first, but the time you spend learning it early will pay big-time rewards in your future development.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.