The answer is simple:
- Design a database that actually represents whatever it is you are trying to store
- Use one of the following to get the data in/out of the database: ADO.NET, Linq to Sql, Enitity Framework.*
* You will need to google for these, there are 1000s of examples for each, and each has its own strengths and weaknesses. I'd start with ADO as the other two are based on it. This list includes just the Microsoft options available in the .Net Framework, you could also add NHibernate to that list.