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

Please support our C# advertiser: Intel Parallel Studio Home
Reply

Join Date: May 2009
Posts: 40
Reputation: phoenix_dwarf is an unknown quantity at this point 
Solved Threads: 0
phoenix_dwarf phoenix_dwarf is offline Offline
Light Poster

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

 
0
  #21
Oct 4th, 2009
yeah tnx didn't think of that thanx for all the help! ;-)
Reply With Quote Quick reply to this message  
Join Date: Mar 2007
Posts: 158
Reputation: vuyiswamb is an unknown quantity at this point 
Solved Threads: 5
vuyiswamb's Avatar
vuyiswamb vuyiswamb is offline Offline
Junior Poster

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

 
0
  #22
Oct 5th, 2009
Your SQL Table Must have a Identity Column first change the Defination of your table to this
  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. );
Few companies that installed computers to reduce the employment of clerks have realized their expectations.... They now need more and more expensive clerks even though they call them "Developers" or "Programmers."
Reply With Quote Quick reply to this message  
Join Date: May 2009
Posts: 40
Reputation: phoenix_dwarf is an unknown quantity at this point 
Solved Threads: 0
phoenix_dwarf phoenix_dwarf is offline Offline
Light Poster

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

 
0
  #23
Oct 5th, 2009
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.
Reply With Quote Quick reply to this message  
Join Date: May 2009
Posts: 40
Reputation: phoenix_dwarf is an unknown quantity at this point 
Solved Threads: 0
phoenix_dwarf phoenix_dwarf is offline Offline
Light Poster

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

 
0
  #24
Oct 5th, 2009
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!
Reply With Quote Quick reply to this message  
Join Date: Mar 2007
Posts: 158
Reputation: vuyiswamb is an unknown quantity at this point 
Solved Threads: 5
vuyiswamb's Avatar
vuyiswamb vuyiswamb is offline Offline
Junior Poster

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

 
0
  #25
Oct 5th, 2009
Mark the Post as Resovled and give Reputation if i deserve it

Kind Regards

Vuyiswa Maseko
Few companies that installed computers to reduce the employment of clerks have realized their expectations.... They now need more and more expensive clerks even though they call them "Developers" or "Programmers."
Reply With Quote Quick reply to this message  
Join Date: May 2009
Posts: 40
Reputation: phoenix_dwarf is an unknown quantity at this point 
Solved Threads: 0
phoenix_dwarf phoenix_dwarf is offline Offline
Light Poster
 
0
  #26
Oct 7th, 2009
You deserve it thanx! XD
Reply With Quote Quick reply to this message  
Join Date: Mar 2007
Posts: 158
Reputation: vuyiswamb is an unknown quantity at this point 
Solved Threads: 5
vuyiswamb's Avatar
vuyiswamb vuyiswamb is offline Offline
Junior Poster
 
0
  #27
Oct 7th, 2009
You are Welcome
Few companies that installed computers to reduce the employment of clerks have realized their expectations.... They now need more and more expensive clerks even though they call them "Developers" or "Programmers."
Reply With Quote Quick reply to this message  
Reply

Tags
c#, sql, uploadatextfile

Message:


Thread Tools Search this Thread



Tag cloud for c#, sql, uploadatextfile
About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC