vb.net program + database
Posted on 2004-08-09
I am doing a small project..This is a small project I need to transfer the information from the text file into a database
Here is the question..
Each row in the text file represents the data for one customer..Each piece of data about a customer within a row is separated by the character ‘#’
Here is the example which can be found in the textfile...
So i now need create customer table in MS SQL Server 2000 and write a VB.NET program that will read all the customer data from the text file and store the data into the customer table.
The CustID is automatically generated by SQL Server 2000 upon the insertion of a row of customer data.
To avoid invalid data, the program has to check that there are 5 data fields for each row in the text file before inserting the row into the database.
There is also records which have only 3data fields...So these records should not be added..This should be displayed in a label to show that these are invalid data..
My program should have a Datagrid to display(the table)
1 label to show the contents in the file
1 label to show invalid data
1 label to display the statistics
The program must also provide the following information after the task is completed:
i) Total number of customer records read. This number should be the same as the total number of customer records in the text file.
ii) Total number of customer records created in the SQL Server. (i.e. valid records with 5 data fields).
I am stuck with the coding in reading my file and checking if my data is valid(min 5data fields) and adding it to my data grid..