Quantcast
Channel: VBForums - Visual Basic .NET
Viewing all articles
Browse latest Browse all 27514

Remove Line Break

$
0
0
Hi, can anyone tell me how to remove the extra line break when using this code:

Code:

        Dim str As String = SerialTextBox.Text.Replace(" ", vbCrLf).Replace(vbTab, vbCrLf)
        For Each s As String In str
            Dim query As String = "INSERT INTO SerialNumbers (Serial) VALUES ('" & s & "')"
            Dim adapter As New OleDbDataAdapter(query, con1)
            Dim dt As New DataTable("SerialNumbers")
            adapter.Fill(dt)
            adapter.Update(dt)
            con1.Close()
        Next

If i put the following in a textbox:

1
2
3

it gets input into the database as

1

2

3

instead of

1
2
3

Viewing all articles
Browse latest Browse all 27514

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>