Solved

Create Struct then write to Random Access File

Posted on 2008-06-20
2
999 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
Comment Utility
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
Comment Utility
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

Maximize Your Threat Intelligence Reporting

Reporting is one of the most important and least talked about aspects of a world-class threat intelligence program. Here’s how to do it right.

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
send mail from app.net 8 27
C# Reverse int in fast ways 6 27
Hide Tab Page 3 18
Long URL in SMS 6 22
This article describes a simple method to resize a control at runtime.  It includes ready-to-use source code and a complete sample demonstration application.  We'll also talk about C# Extension Methods. Introduction In one of my applications…
We all know that functional code is the leg that any good program stands on when it comes right down to it, however, if your program lacks a good user interface your product may not have the appeal needed to keep your customers happy. This issue can…
It is a freely distributed piece of software for such tasks as photo retouching, image composition and image authoring. It works on many operating systems, in many languages.
This video demonstrates how to create an example email signature rule for a department in a company using CodeTwo Exchange Rules. The signature will be inserted beneath users' latest emails in conversations and will be displayed in users' Sent Items…

772 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

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now