how to upload text file to SQL using VB? Urgent
Its been almost 2 weeks that im trying to figure this out and next week is already the deadline. I hope someone can help me with this.
I am developing a system whereby the user will upload a text file via visual studio(using the fileupload control) and the data in the file will be inserted in SQL table. However the txt file are of fixed length therefore i included a schema file in order for the data to be inserted in the right column.
And then i did more and more research and i find that i need to create a stored procedure too and so i did. And the problem now is that my SQL select statement all can work in SQL but i do not know how to put all this data together and do not know any coding whereby i can insert the data from the file into SQL table using VB.
below are the schama.ini the text file and the stored procedure coding. can anyone help??? thnkx!
MORNING CONTAINER AIR AV
HALEX FRIENGT AH
AMARA SUITE HOTEL AC
ARMANY SWEDEN AMBASSY AP
CARGO FRIEGHT HOLS AJ
AREA OF DEFENCE DEF AT
CONTAINER SHIPPER AW
WHITE ROSE AMBASSY AZ
ALLIES DNA SWE AI
ColNameHeader = False
CharacterSet = ANSI
Format = FixedLength
Col1=FullName Text width 23
Col2=OpCode Text Width 2
create procedure spUploadFile
Insert Operator(FullName, OpCode)
By thunder777 in forum VB Classic
Last Post: 10-21-2008, 08:28 AM
By Mark in forum Database
Last Post: 05-30-2002, 10:38 AM
By Andrew McLellan in forum Java
Last Post: 05-09-2001, 06:34 PM
By Bharat in forum Database
Last Post: 03-06-2001, 09:42 AM
By Gerald in forum VB Classic
Last Post: 06-14-2000, 09:14 AM
Top DevX Stories
Easy Web Services with SQL Server 2005 HTTP Endpoints
JavaOne 2005: Java Platform Roadmap Focuses on Ease of Development, Sun Focuses on the "Free" in F.O.S.S.
Wed Yourself to UML with the Power of Associations
Microsoft to Add AJAX Capabilities to ASP.NET
IBM's Cloudscape Versus MySQL