Link to home
Start Free TrialLog in
Avatar of tvenkat9
tvenkat9

asked on

ASP.NET - Reading a tab delimited file and update the database table

Hi,

I want to read the data from  tab delimited text file into variables and pass this data as variables to stored procedure to update a sql server database table.
I want this to be done from ASP.NET PAGE, when the user selects the the file to update and clciks on the update button,
the program should read the data from text file and update the table.

Can any one suggests me what is the best way to do this.

Thanks
Avatar of nauman_ahmed
nauman_ahmed
Flag of United States of America image

The following article will be helpfull:

Reading a Delimited File Using ASP.Net and VB.Net
http://www.devarticles.com/c/a/ASP.NET/Reading-a-Delimited-File-Using-ASP.Net-and-VB.Net/


Reading a Delimited File using ASP.NET and VB.NET
http://www.theukwebdesigncompany.com/articles/article.php?article=151

-Nauman.
You can read the textfile and bound the results from reading it to a dropdown list so users can select the option they want to update "Stored procedure" and you can do the databased updating based on their selection
take a look here to see how can a delimited textfile can be read in asp.net

http://www.devarticles.com/c/a/ASP.NET/Reading-a-Delimited-File-Using-ASP.Net-and-VB.Net/

Make sense?

Good luck
Avatar of Melih SARICA
if u ll work with SQL server database and with a huge text file , best way to use bulk insert method of SQL Server.
its faster then .NET technology.

if ur situation suits this scene .. i can explain how.

Melih SARICA
Avatar of tvenkat9
tvenkat9

ASKER

I want to update the table from Asp.net application, user will not have access directly to the sql server database.
Can we use bulk insert method of SQL Server from web application?
yes .. bulk insert is an TSQL command on SQL server

But csv file must be located on SQL server drives.

Create a tmp table that has same column count with csv file
First load ur data in to a tmp table
check data in tmp table to be sure data is valid.
then copy to the original localtion





Can you give some more details about bulk insert ,
How do I write code for bulk insert , How do I call the this function from asp.net (Can I create stored procedure?).

Thanks
ASKER CERTIFIED SOLUTION
Avatar of Melih SARICA
Melih SARICA
Flag of Türkiye image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial