Welcome to the new platform of Programmers Heaven! We apologize for the inconvenience caused, if you visited us from a broken link of the previous version. The main reason to move to a new platform is to provide more effective and collaborative experience to you all. Please feel free to experience the new platform and use it's exciting features. Contact us for any issue that you need to get clarified. We are more than happy to help you.
I'm doing an application where I want to store some data, but I've had no luck connecting to databases and my brother in law, doesn't have SQL Server and I don't know how to write to Access, though I could learn if convinced that's a good solution. So, in order to do what I want to, I've been feeding strings to text files with separators between data points. For instance, a string my look like this:
Here is my writing code:
[code]using (StreamWriter sw = File.AppendText(filename))
sw.WriteLine(filedate + "!" + txtCity.Text + ", " +
cbState.SelectedItem + "@" + txtJobType.Text + "#" +
txtAmountPaid.Text + "%" + txtPaidLabor.Text + "^" +
txtMileage.Text + "&" + txtGasCost.Text + "*" + txtMiscCost.Text +
I need to total up the number after #, the number after %, the number after ^, the number after &, and the number after *. What I planned to do, what I've done before, years ago in a C++ app, was move to the #, read until the %, save that to a string, convert it to float, add it to itself, then read fom % to ^ and save to string and convert it to float, add it to itself, etc... Obviously, this is a very brute force way to do this data handling, but I have forgotten how to do this. Can anyone tell me how I would implement this solution?
Secondly, is there a better way to do this with perhaps Microsoft Access or Microsoft Excel on a Windows XP system, the only two programs my brother has? Is there perhaps a good tutorial in doing this? My books only cover C# apps to SQL Server.