Well, it looks like you have grabbed some code randomly from the internet, chucked it into your program, crossed your fingers and hoped it magically worked...
And it doesn't, does it?
First things first: look at your data:
"OrderID CustomerID EmployeeID OrderDate RequiredDate ShippedDate ShipVia Freight ShipName ShipAddress ShipCity ShipRegion ShipPostalCode ShipCountry"
That is the top line that you read as a special case to get the headings.
This is the code you use to get the headings as separate objects:
string Line=SR.ReadLine();
string[] Value=Line.Split(',');
Now, have a good close look at the data, and tell me how many commas it contains.
I'll wait while you count them...
None, right? So what effect do you think trying to split your data on a comma is going to have?
Start again, looking at the data first and work out what you have. Then write the code to split it out into the fields you want (nothing more, don't even think about going near SQL yet) and test it. Check it. Make sure it works, every single time, with every single line.
Then look at trying to transfer the data to SQL - but you can't even think of doing that until you have got the input data side working.
BTW: Personally, I would make the "Read Input" code a separate method - pass it a file, return a DataTable, or a List of a custom class. And I'd do the same for the SQL stuff as well...
"I did use internet help but didn't copy ; I actually tried this with some other data .
Am a beginner in this technology I am really nervous but hope that I will learn eventually but now am not sure anymore I used to work as a manual tester maybe thats the only thing I can do thanku I will try what u told me but can u explain me how to write logic for these kind of applications just start from basics??"
The first thing to do is look closely at your data (And I can't do that for you, it's been processed by your editor, the textbox paste filters, CodeProject database injection heckers, and Chrome at this end before I get to see it - you need to look at the source data directly).
Are those spaces? Or Tabs?
Are you columns separated by "one-or-more-spaces", or at fixed columns?
I'm just guessing from the "look" of the data, but it looks like tab-delimited data to me from here - and it is important to know exactly, or some assumption you make will blow up in your face at a later date.
So start by looking at the data, preferably with a Hex editor (If you don't have one, I can recommend
PsPad[
^] - it's free, and a useful editor to boot.
Sorry, but you are going to have to do this bit - as I said, the data is to "processed" to be much use to me as it is.
When you have that bit, we can make some decisions as to the best way to proceed.
BTW: Reply with the Comment feature below this - it means I get emails directly which can speed things up.