944,082 Members | Top Members by Rank

Ad:
  • C# Discussion Thread
  • Marked Solved
  • Views: 7937
  • C# RSS
You are currently viewing page 3 of this multi-page discussion thread; Jump to the first page
Oct 4th, 2009
0

Re: Upload txt data to MS SQL Database (Using C# and ASP.NET)

yeah tnx didn't think of that thanx for all the help! ;-)
Reputation Points: 11
Solved Threads: 0
Junior Poster in Training
phoenix_dwarf is offline Offline
57 posts
since May 2009
Oct 5th, 2009
0

Re: Upload txt data to MS SQL Database (Using C# and ASP.NET)

Your SQL Table Must have a Identity Column first change the Defination of your table to this
C# Syntax (Toggle Plain Text)
  1. CREATE TABLE mytable
  2. (
  3. id INT IDENTITY(1,1) PRIMARY KEY not null,
  4. Fname text,
  5. Surname text,
  6. Tel text,
  7. Salary DECIMAL(18,2)
  8. );
Reputation Points: 31
Solved Threads: 14
Posting Whiz
vuyiswamb is offline Offline
310 posts
since Mar 2007
Oct 5th, 2009
0

Re: Upload txt data to MS SQL Database (Using C# and ASP.NET)

K I tried to do it like this but it still isn't working. here is the error i get:

Msg 4864, Level 16, State 1, Line 1
Bulk load data conversion error (type mismatch or invalid character for the specified codepage) for row 1, column 5 (Salary).
Msg 4864, Level 16, State 1, Line 1
Bulk load data conversion error (type mismatch or invalid character for the specified codepage) for row 2, column 5 (Salary).

And this is what i'm uploading:

0123313470|Hein|Oosthuyzen|15489.62
0126547896|Johan|du Toit|13240.27
0124784532|Nico|Fourie|14500.20
0123546987|Shaun|Venter|16320.12
0124872134|Burnabe|Jordaan|12480.80

NOTE: I moved the Tel to infront of the Fname column!
Last edited by phoenix_dwarf; Oct 5th, 2009 at 11:44 am.
Reputation Points: 11
Solved Threads: 0
Junior Poster in Training
phoenix_dwarf is offline Offline
57 posts
since May 2009
Oct 5th, 2009
0

Re: Upload txt data to MS SQL Database (Using C# and ASP.NET)

Right it's working! Thnx vuyiswamb, all i had to do is instead of

0124784532|Nico|Fourie|14500.20

i had to

|0124784532|Nico|Fourie|14500.20

then it skips the first column and goes on. Thnx for all the help, sorry for any inconvenience!
Reputation Points: 11
Solved Threads: 0
Junior Poster in Training
phoenix_dwarf is offline Offline
57 posts
since May 2009
Oct 5th, 2009
0

Re: Upload txt data to MS SQL Database (Using C# and ASP.NET)

Mark the Post as Resovled and give Reputation if i deserve it

Kind Regards

Vuyiswa Maseko
Reputation Points: 31
Solved Threads: 14
Posting Whiz
vuyiswamb is offline Offline
310 posts
since Mar 2007
Oct 7th, 2009
0
Re: Upload txt data to MS SQL Database (Using C# and ASP.NET)
You deserve it thanx! XD
Reputation Points: 11
Solved Threads: 0
Junior Poster in Training
phoenix_dwarf is offline Offline
57 posts
since May 2009
Oct 7th, 2009
0
Re: Upload txt data to MS SQL Database (Using C# and ASP.NET)
You are Welcome
Reputation Points: 31
Solved Threads: 14
Posting Whiz
vuyiswamb is offline Offline
310 posts
since Mar 2007
Jan 5th, 2010
0
Re: Upload txt data to MS SQL Database (Using C# and ASP.NET)
I'm sorry for the long wait to mark this thread as solved (been really busy)... My apologies!
Reputation Points: 11
Solved Threads: 0
Junior Poster in Training
phoenix_dwarf is offline Offline
57 posts
since May 2009
Jan 14th, 2010
0
Re: Upload txt data to MS SQL Database (Using C# and ASP.NET)
NO Problem
Reputation Points: 31
Solved Threads: 14
Posting Whiz
vuyiswamb is offline Offline
310 posts
since Mar 2007

This thread is solved

Either the thread starter or a moderator has marked this thread as solved. You can most likely trust the responses and answers given. There is most likely no reason for any further responses to be posted here. If you have a related question, please start a new thread in this forum instead.

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in C# Forum Timeline: Execution of AT commands??
Next Thread in C# Forum Timeline: Call a procedure to another application on remote computer





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC