what datasource control to use on a web from 2010
-
In a vb.net 2010 web form application, I have a request from the user to be able to insert,update, and/or delete a row in a single table. Thus I have the following questions to ask: 1. I am trying to decide if I should use a detailsviews, formview, gridview, and/or a different control for this purpose. Thus would you tell me what control you would recommend and why you would recommend that particular control? 2. For the different options for insert, update, and delete, would I use the buttons that are on the control that you recommend? If not would I use, new buttons that I place on the webform page? 3. For the control that you recommend that I use, should I place the sql 'embedded' in the sqldatasource, the control you recommend and/or access the sql from a different location(vb.net code in a new location)? Would you tell me , show me with pictures, and/or point to me to links (urls) that will show me how to accomplish this
-
In a vb.net 2010 web form application, I have a request from the user to be able to insert,update, and/or delete a row in a single table. Thus I have the following questions to ask: 1. I am trying to decide if I should use a detailsviews, formview, gridview, and/or a different control for this purpose. Thus would you tell me what control you would recommend and why you would recommend that particular control? 2. For the different options for insert, update, and delete, would I use the buttons that are on the control that you recommend? If not would I use, new buttons that I place on the webform page? 3. For the control that you recommend that I use, should I place the sql 'embedded' in the sqldatasource, the control you recommend and/or access the sql from a different location(vb.net code in a new location)? Would you tell me , show me with pictures, and/or point to me to links (urls) that will show me how to accomplish this
The traditional way of solving this is using a master/detail scenario: 1. Drag a gridview to the site, and bind it to the database's table. Rightclick it and choose to have a Select field shown. 2. Drag a details view to the page, and bind it as well. In its bidning window, you can graphically set a WHERE statement. Set your statement to Control, then chose your gridview as the control. Also click the advanced button to enable DELETE, UPDATE, and INSERT. If done right, this means that when a user clicks the Select button for a particular row in the gridview, this row's data will appear in the detailsview. Then it can be updated or deleted, and more data can be inserted from the detailsview. I don't know how much you know about binding to a database, but be sure you stay out of SQL injection trouble. Note that searching for master/detail, gridview and detailsview you should be able to fond a lot of info on how to do this. Good luck!