I am having trouble with textbox multiline when it store to Access database and returning in gridview show one chunk of string. Is there anyway to place each data into each own row?
Input:
yahoo
msn
Output:
But right now it is give me www.googleyahoomsn.com
Here is my code:
Sub btnSubmitClicked(ByVal S As Object, ByVal e As EventArgs)
Dim conn1 As New OleDbConnection("Provider=Microsoft.jet.oledb.4.0;Data Source=C:\Data\audit.mdb")
Dim strInsert As String
Dim strDelete As String
Dim cmdInsert As OleDbCommand
Dim cmdDelete As OleDbCommand
TextBox1.TextMode = TextBoxMode.MultiLine
TextBox1.MaxLength = 15
strInsert = "Insert into audit(fldLocation) values ('" & TextBox1.Text & "')"
strDelete = "DELETE * FROM audit "
cmdInsert = New OleDbCommand(strInsert, conn1)
cmdDelete = New OleDbCommand(strDelete, conn1)
conn1.Open()
cmdDelete.ExecuteNonQuery()
cmdInsert.ExecuteReader()
conn1.Close()
Response.Redirect("audit.aspx")
End Sub
End Class