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

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

 
0
  #1
Oct 2nd, 2009
Hi, it's me agian... I was asked to do reasearch on how to upload a txt file's data into a MS SQL Database (corresponding columns etc.) I've searched a bit on the internet but don't find what i'm looking for... I just want to ask does anyone have an idea of where i can go and look for information on this. (I'm still very new to C# and ASP.NET programming) (It's so that i can present this topic in class and implement it in my class project) I would really appreciate any suggestions, and i thank you in advance!
Reply With Quote Quick reply to this message  
Join Date: Mar 2007
Posts: 155
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
  #2
Oct 2nd, 2009
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
  #3
Oct 2nd, 2009
Lol tnx i just got that page before i saw your reply tnx!
Reply With Quote Quick reply to this message  
Join Date: Mar 2007
Posts: 155
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
  #4
Oct 2nd, 2009
Am glad you got your Solution . Mark your Post as Resolved

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: 29
Reputation: phoenix911 is an unknown quantity at this point 
Solved Threads: 0
phoenix911 phoenix911 is offline Offline
Light Poster

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

 
0
  #5
Oct 2nd, 2009
i still dont think its solved... XD
Reply With Quote Quick reply to this message  
Join Date: Mar 2007
Posts: 155
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
  #6
Oct 2nd, 2009
What is the Problem ?
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
  #7
Oct 2nd, 2009
Oky i've got it partially working now. My only question now is will i be able to have a autonumber column aswell in the database table so that the autonumber keeps on adding numbers as i upload my data into the table? (i hope so but i know that it will most probably only work with an insert statement? right or wrong?)

I saw that to skip the first row you can simply say FIRSTROW = 2 and so i tried FIRSTCOLUMN = 2 but doesn't work. Here is my code:

  1. BULK INSERT dbo.testTBLUpload
  2. FROM 'C:\Users\GOgGA\Desktop\upload1.txt'
  3. WITH (
  4. FIRSTROW = 2,
  5. FIELDTERMINATOR = '|',
  6. ROWTERMINATOR = '\n'
  7. )
Reply With Quote Quick reply to this message  
Join Date: May 2009
Posts: 29
Reputation: phoenix911 is an unknown quantity at this point 
Solved Threads: 0
phoenix911 phoenix911 is offline Offline
Light Poster

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

 
0
  #8
Oct 2nd, 2009
problem stated above
Last edited by phoenix911; Oct 2nd, 2009 at 9:57 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
  #9
Oct 2nd, 2009
O snd sorry for this little bit of SQL code in the C# section on the forum. But this is for my C# class so yea!
Reply With Quote Quick reply to this message  
Join Date: Mar 2007
Posts: 155
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
  #10
Oct 2nd, 2009
Remove the First Column and let SQl add it for you as an identity Column.
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



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC