Click here to Skip to main content
15,867,771 members
Please Sign up or sign in to vote.
1.00/5 (2 votes)
See more:
Hi all

I have a list in excel with 5 columns
i copy this list and paste in richtexbox

so i want ınsert database this list


but i didnt do it

What I have tried:

Dim Comm As New OleDbCommand(STR1, cn)
Posted
Updated 24-Feb-20 7:56am
v2
Comments
MadMyche 23-Feb-20 18:10pm    
You are going to do a lot better than that for a question. Did you just want that textbox content inserted into one field in the DB? Or did you want an array of multiple rows that is 5 columns wide inserted into the same amount of rows and columns.
** BEST thing to do is going to be to use the Improve Question widget on the original question- and NOT putting it into a bunch of replies on this comment
Member 14588284 24-Feb-20 1:14am    
i just want to load excel table to acces database.
and I want to do this work with the copy-paste method
Richard MacCutchan 24-Feb-20 3:24am    
You cannot do it through a text box, since all the columns will be merged into a single string.

We are more than willing to help those that are stuck: but that doesn't mean that we are here to do it all for you! We can't do all the work, you are either getting paid for this, or it's part of your grades and it wouldn't be at all fair for us to do it all for you.

So we need you to do the work, and we will help you when you get stuck. That doesn't mean we will give you a step by step solution you can hand in!
Start by explaining where you are at the moment, and what the next step in the process is. Then tell us what you have tried to get that next step working, and what happened when you did.
 
Share this answer
 
For x = 0 To TextBox1.Lines.Count - 1
    Dim tx = TextBox1.Lines(x).ToString
    If tx <> "" Then
        Dim i = DataGridView1.Rows.Add
        DataGridView1.Rows(i).Cells(0).Value = tx.Split(vbTab)(0)
        DataGridView1.Rows(i).Cells(1).Value = tx.Split(vbTab)(1)
        DataGridView1.Rows(i).Cells(2).Value = tx.Split(vbTab)(2)
        DataGridView1.Rows(i).Cells(3).Value = tx.Split(vbTab)(3)
        DataGridView1.Rows(i).Cells(4).Value = tx.Split(vbTab)(4)
        DataGridView1.Rows(i).Cells(5).Value = tx.Split(vbTab)(5)
        DataGridView1.Rows(i).Cells(6).Value = tx.Split(vbTab)(6)
    End If
Next


İ did it :))
i paste values textbox from excel table
then with this codes;
export to datagridview table
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900