Solved

Create Struct then write to Random Access File

Posted on 2008-06-20
2
1,025 Views
Last Modified: 2012-05-05
I need to create a random access file. What I am trying to do is query a MySQL database then return the results then write them into a file to be read from later. I think I should create structs then write the data to the file. Then read the file and write them back to the structs. However I am not sure how to start. I can query the database but everything else I have little knowledge.

If someone can help me with some example code to start me off Id appreciate it. I would specifically like help that sends my Query Results into a struct then send the struct into random access file then read from the random access file back to the struct. I;m not even sure how to create a Random Access file in C#. Any help to start would be appreciated. Thanks.
0
Comment
Question by:SaltyDawg
2 Comments
 
LVL 10

Accepted Solution

by:
margajet24 earned 500 total points
ID: 21836377
use the Serialization Capability in .Net

in that way, objects can be transformed into a xml or binary format data
then later on can be transformed back to objects..

0
 
LVL 1

Author Comment

by:SaltyDawg
ID: 21849001
I'm not too familiar with Serialization. Will I be able to get the same results as I would with a Random Access File? Could you point me to a place where I can find a good example? I looked it up but found some terrible tutorials online. Thanks
0

Featured Post

Free Tool: Postgres Monitoring System

A PHP and Perl based system to collect and display usage statistics from PostgreSQL databases.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction Hi all and welcome to my first article on Experts Exchange. A while ago, someone asked me if i could do some tutorials on object oriented programming. I decided to do them on C#. Now you may ask me, why's that? Well, one of the re…
Exception Handling is in the core of any application that is able to dignify its name. In this article, I'll guide you through the process of writing a DRY (Don't Repeat Yourself) Exception Handling mechanism, using Aspect Oriented Programming.
This video shows how to quickly and easily add an email signature for all users on Exchange 2016. The resulting signature is applied on a server level by Exchange Online. The email signature template has been downloaded from: www.mail-signatures…
This video shows how to use Hyena, from SystemTools Software, to bulk import 100 user accounts from an external text file. View in 1080p for best video quality.

828 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question