| |

VerySource

 Forgot password?
 Register
Search
View: 999|Reply: 7

How to use .net to import txt files to a database

[Copy link]

1

Threads

2

Posts

2.00

Credits

Newbie

Rank: 1

Credits
2.00

 Invalid IP Address

Post time: 2020-1-7 10:10:01
| Show all posts |Read mode
How do I import a txt file to a database using vb.net?

Each field in my txt document is separated by spaces.

Thank you ~
Reply

Use magic Report

1

Threads

2

Posts

2.00

Credits

Newbie

Rank: 1

Credits
2.00

 Invalid IP Address

 Author| Post time: 2020-1-7 12:00:01
| Show all posts
Waiting for reply online ~
Reply

Use magic Report

1

Threads

9

Posts

8.00

Credits

Newbie

Rank: 1

Credits
8.00

 China

Post time: 2020-1-28 15:54:01
| Show all posts
Can't read and write
Reply

Use magic Report

0

Threads

1

Posts

2.00

Credits

Newbie

Rank: 1

Credits
2.00

 China

Post time: 2020-1-29 14:09:01
| Show all posts
Can read text into a DataTable and write to the database
Reply

Use magic Report

0

Threads

8

Posts

9.00

Credits

Newbie

Rank: 1

Credits
9.00

 China

Post time: 2020-3-6 02:30:01
| Show all posts
See if you can pass ODBC.
Reply

Use magic Report

1

Threads

4

Posts

4.00

Credits

Newbie

Rank: 1

Credits
4.00

 United States

Post time: 2020-8-7 12:00:01
| Show all posts
Are the fields in txt rules
If this happens.
Read txt file
Use split('') to divide into arrays
Pay each parameter separately
Then update to the database
Reply

Use magic Report

0

Threads

1

Posts

2.00

Credits

Newbie

Rank: 1

Credits
2.00

 China

Post time: 2020-8-7 15:15:01
| Show all posts
I read and write no matter what
Reply

Use magic Report

0

Threads

1

Posts

2.00

Credits

Newbie

Rank: 1

Credits
2.00

 China

Post time: 2020-8-10 10:00:01
| Show all posts
If it is a sql server, I suggest you write a stored procedure to encapsulate bcp, you can call this procedure with a program, and the speed is very fast, so you can also do secondary processing in the database
Reply

Use magic Report

You have to log in before you can reply Login | Register

Points Rules

Contact us|Archive|Mobile|CopyRight © 2008-2023|verysource.com ( 京ICP备17048824号-1 )

Quick Reply To Top Return to the list