For this purpose, I decided to recreate the sample pages from the ASP.Net book. During the process, it made sense to combine the GridView and DetailsView pages into one, which will serve as a model page to create all the Web table management pages. Any table management page should have the display, edit and delete functions.
I recreated the model page, using the Smart Tag on the Design View. I found it very easy to create SqlDataSource, GridView and DetailsView, as the Smart Tag function generates the ASP.Net Code and SQL Query automatically. This function sets Auto Generate Columns or Rows to False and generates Bound Fields by Code on the ASPX page direct, which saves me from creating by the lengthy code in On_Init. However, I found the Query Builder function useless and I had to copy the Delete and Upgrade Query lines from the Book sample page.
Before creating the table management page based on the above model, I decided to create the Anti-Bots defense page, where I display only 100 rows of comments/trackbacks last entered and test whether the table is not filled with Bots’ attack. If there is an attack, all that are displayed can be deleted by a button click. If there is no attack, there is the link to jump to the normal table management page. I also created the button to display the Bots table, from which I found that all the data are stored from the attacks recorded last year. Looking at the display, I realized that it is necessary to display them sorting by the order of the Bots’ addresses recorded.
I started to create the Bots table management page using the GridView model created before. However, the Smart Tag function proved to be disappointing, as it failed to establish the connection using the TIMEO connection string. It looks like that the database has to resides on the same computer in order for this function to work. Therefore, I will have to go to the same route of writing SQL connection codes as before, which will take more time than using the Smart Tag on the Design page. I may have to create a different coding model for all the table management pages.