I currently have a web form which allows a user to input multiple data entries by selecting a "+" button and adding an additional textbox for each additional entry. I would like to insert these entries as individual rows into the database table.
So for instance. user enters 2 entries
customer name: bobby
phone number: 123-456-7890 (presses "+" button to insert additional phone number)
phone number 2: 032-165-4987
I would like this record to show up in the database like this:
1. Bobby / 123-456-7890
2. Bobby / 032-165-4987
Here is my current code to insert data into the database (this only inserts the first record)
Dim ConnectionString As String
Dim Connection As SqlConnection
Dim Adapter As New SqlDataAdapter
Dim sql As String
ConnectionString = "Data Source=00.0.000.00;Initial Catalog=Database;User ID=user;pwd=pwd
Connection = New SqlConnection(ConnectionString)
sql = "insert into table(field1, field2, field3, field4, field5) VALUES ('" & tbpbrid.Text & "', '" & tbconvo.Text & "', '" & tbcn1.Text & "', '" & tbcp1.Text & "', '" & tbcif1.Text & "');"
Adapter.InsertCommand = New SqlCommand(sql, Connection)
Response.Write("<span style='color: green'>Data Submitted</span>")
Catch ex As Exception
Response.Write("<span style='color: red>Data Not Submitted</span>")
Can someone please help me with the code? Thanks!