I am pretty new to asp.net and I am trying to make a simple form with a few textboxes and dropdown lists. I am using Visual Web Developer 2008 express.
The customer enters their information in the web form and hits the submit button.
When the submit button is hit, I am trying to update one table which will run a query and display the results of another table.
So far, I have the form set up and the drop down lists populated from tables in the db.
I can display the information from any of the fields. I can insert into the table, but what I need to do is first delete all contents of the table and then insert information into the same table. Alternately updating may work, but I am not sure how update works.
I have an old asp page existing that works but it is way past time to update that page.
If I set up gridview, I can select, delete and insert, but I can't figure out how to do this with a submit button.
Any help here would be greatly appreciated - I have been working at this for days.
Here is the code:
Sub OnBtnSendClicked(ByVal s As Object, ByVal e As EventArgs) Dim strConn As String = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & Server.MapPath("IndividualRates.mdb") & ";" Dim MySQL As String = "UPDATE problemdefinition SET client = @txtname, memberage = @txtage" Dim MyConn As New OleDBConnection(strConn) Dim cmd As New OleDBCommand(MySQL, MyConn) MyConn.Open() cmd.ExecuteNonQuery() MyConn.Close() Response.Redirect("gbresults.aspx") End Sub