Import delimited data into SQL Server database via textarea form field using ASP.NET

Greetings,

I am trying to find a way to import comma delimited data into a SQL Server database via a textarea form field using ASP.NET.

Here is some background.  I work for a school and I am trying to setup an online application where instructors can easily transfer student grades from a grade book application into an online database using a web form.  I already created the online database and have ASP.NET pages setup for viewing and searching records.  Now I just need the web form where the instructors paste the delimited data and hit submit to import it into the database.  

The delimited data that would get pasted into the textarea field looks something like this:

"Smtih, John",3434983,Fall 2005,HIST 101,A
"Rosenberg, Greg",3434984,Fall 2005,HIST 101,B
"Hall, John",3434985,Fall 2005,HIST 101,B+
"Perry, Joan",3434986,Fall 2005,HIST 101,C
"Lemke, Adrian",3434987,Fall 2005,HIST 101,C-
"Nguen, Jennifer",3434988,Fall 2005,HIST 101,D
"Arlan, Smantha",3434989,Fall 2005,HIST 101,A
"Jimenez, Damian",3434990,Fall 2005,HIST 101,B

Here are details on the database where it will be imported:

Database name: GradeArchive
Table: TblStudentGrades
Field/column names that correspond to delimited text to import:

StudentName
StudentID
Semester
Course
Grade

 Any help would be greatly appreciated.

Thanks!
relaydudeAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

f_o_o_k_yCommented:
Hello,
First of all databes design is really bad, but this is not what you are asking.
If you want to insert these data you can use two things.
1. Write your own code for parsing CSV.
2. Find some framework I remember that LumenWorks can parse CVS and then you can get to each fild like there were a table

First of all you need to use loop and go throught each line.
Then you need to split each line by , and check if line has apropriate number of ,
After that you need to insert data to databe

Do you need some example code?
Best Regards
FooKy
0
relaydudeAuthor Commented:
Hi Fooky,

Thanks for the response.  Yes...if you have some example code that would be great.  I am still sort of a newbie with respect to ASP.NET, so I am sort of hoping to get my hands on some code that either works, or doesn't take a lot of tweaking to make work.

I Googled LumenWorks and saw a few things that talked about importing csv, but nothing really specific to ASP.NET.

Thanks again.
0
nmcdermaidCommented:
Maybe there is some kind of ASP.Net grid control that you can paste CSV directly into? In the same way that you can paste a CSV directly into an Excel file.
0
The Ultimate Tool Kit for Technolgy Solution Provi

Broken down into practical pointers and step-by-step instructions, the IT Service Excellence Tool Kit delivers expert advice for technology solution providers. Get your free copy for valuable how-to assets including sample agreements, checklists, flowcharts, and more!

f_o_o_k_yCommented:
Hello
relaydude:
I'm so sorry for delay.
Here is an article about using lumenworks and example code.
http://www.codeproject.com/KB/database/CsvReader.aspx

Hope this will be helpful and explain you everything.
If you need any further help just ask.

And again sorry for delay.
Best Regards
FooKy
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
relaydudeAuthor Commented:
Thanks guys for the suggestions.  Sorry for the delayed response, I've been out of town and I am just getting caught up.  I'll give those suggestions a try and report back as soon as I can on whether or not I've been able to achieve my objective.  Thanks again.
0
Computer101Commented:
Forced accept.

Computer101
EE Admin
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
ASP.NET

From novice to tech pro — start learning today.