Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Create Struct then write to Random Access File

Posted on 2008-06-20
2
Medium Priority
?
1,046 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 2000 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

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Question has a verified solution.

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

Introduction This article series is supposed to shed some light on the use of IDisposable and objects that inherit from it. In essence, a more apt title for this article would be: using (IDisposable) {}. I’m just not sure how many people would ge…
Introduction Although it is an old technology, serial ports are still being used by many hardware manufacturers. If you develop applications in C#, Microsoft .NET framework has SerialPort class to communicate with the serial ports.  I needed to…
This Micro Tutorial will teach you how to add a cinematic look to any film or video out there. There are very few simple steps that you will follow to do so. This will be demonstrated using Adobe Premiere Pro CS6.
Please read the paragraph below before following the instructions in the video — there are important caveats in the paragraph that I did not mention in the video. If your PaperPort 12 or PaperPort 14 is failing to start, or crashing, or hanging, …
Suggested Courses

782 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