473,396 Members | 1,712 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

Big table of constants initialising

I am novice in C#. I did write on C++ before.
In my current program i need to use big constant table. Each string is a
some struct what contain following fields:

MyEnum f1;
MyEnum f2;
bool f3;
double[] f4;
ushort[] f5;

Fields f1 and f2 have enum type what i define early. Last two fields is a
arrays by 9 items. Now i need get some f1, f2 and f3 values + some index and
find corresponding row in my table and corresponding index ushort and double
from last fields.
I don't want to put my table in external file. What offers do you have ? I
have some myself ideas but may be i don't know a some C# specifical features
for it.

Thank you.

Nov 17 '05 #1
1 2324
Hi,

First of all, you will have to create and fill it at least once :)

What you could do is serialize the collection to a file, then include this
file in your project as an "embedded resource" doing so will put the file
inside your main output ( .exe or .dll ) then at runtime you can access it
and recreate your collection from it. easier and faster that create the
collection all the time.

how do you store your table? cause you will need a class that support
serialization, take a look at ISerializable interface and
SerializableAttribute , there are articles in MSDN too that you should read.
cheers,

--
Ignacio Machin,
ignacio.machin AT dot.state.fl.us
Florida Department Of Transportation
"Serj Kondryukov" <ks*@tornado.nsk.ru> wrote in message
news:OD**************@TK2MSFTNGP09.phx.gbl...
I am novice in C#. I did write on C++ before.
In my current program i need to use big constant table. Each string is a
some struct what contain following fields:

MyEnum f1;
MyEnum f2;
bool f3;
double[] f4;
ushort[] f5;

Fields f1 and f2 have enum type what i define early. Last two fields is a
arrays by 9 items. Now i need get some f1, f2 and f3 values + some index
and find corresponding row in my table and corresponding index ushort and
double from last fields.
I don't want to put my table in external file. What offers do you have ? I
have some myself ideas but may be i don't know a some C# specifical
features for it.

Thank you.

Nov 17 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: -b | last post by:
I have a STATUS table consisting of a uid and description, that looks like this: 1 Accept 2 Accept with corrections 3 Reject I have a CHOICE table which referrs to the uid of...
3
by: Jeff J. | last post by:
The basic concept is a music playlist that I'm trying to write as a table inside a div. I have Song and Playlist 'classes'. The Song class has a Write() method, as does the Playlist. The...
6
by: SpOiLeR | last post by:
Hi! q1: What is C++ equivalent for: #define MY_CHAR_ARRAY_CONSTANT "My constant" if I want to define that constant in protected area of some class? I assume it has something to do with...
8
by: Nick Keighley | last post by:
Hi, is there a way of initialising a vector in a similar fashion to initialising an array? consider: Shape* triangle = new Triangle (); Shape* square = new Square (); Shape* shape_arr =...
0
by: David W. Fenton | last post by:
Today I was working on a hideous old app that I created a long time ago that does a lot of showing/hiding/resizing of fields on one of the forms. I had used constants to store reference values for...
1
by: Earl | last post by:
How do I add a new field to a table. the code below gives a type mismatch error --------------- Dim db As DAO.Database Dim rs As DAO.Recordset Set db = CurrentDb Set rs =...
107
by: DaveC | last post by:
I always used to initialise variables at declaration, then a couple of colleagues started telling me it was bad practice and that the compiler should be left to spot the use of uninitilised...
7
by: Kamal | last post by:
Hello all, I have a very simple html table with collapsible rows and sorting capabilities. The collapsible row is hidden with css rule (display:none). When one clicks in the left of the...
54
by: shuisheng | last post by:
Dear All, I am always confused in using constants in multiple files. For global constants, I got some clues from http://msdn.microsoft.com/en-us/library/0d45ty2d(VS.80).aspx So in header...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.