PC Review Forums Newsgroups Microsoft DotNet Microsoft Dot NET Compact Framework Re: Creating structures to hold data

Reply

Re: Creating structures to hold data

 
Thread Tools Rate Thread
Old 08-07-2003, 09:53 PM   #1
Neil Cowburn [MVP]
Guest
 
Posts: n/a
Default Re: Creating structures to hold data


You can achieve the same thing with a class. Also, StringBuilder allows you
to define the size of the string.

Try something this:

public class RECORD
{
public StringBuilder Reference;
public StringBuilder Description;

public RECORD()
{
Reference = new StringBuilder(5);
Description = new StringBuilder(50);
}
}

HTH
Neil

--
Neil Cowburn
OpenNETCF.org Advisor

www.opennetcf.org




"Martin Robins" <martin - robins @ ntlworld dot com> wrote in message
news:uhDrecZRDHA.2228@tk2msftngp13.phx.gbl...
> I am using C# on the compact fdramework and, having seen the performance

of
> SqlCe, have decided to work with flat data files rather than trying to use
> SqlCe.
>
> Back in the days of BASIC, I was able to define a type and this could then
> be used as my record format within a flat file. However, I have tried
> creating a struct in C# and do not seem to be able to achieve the same.
>
> The MarshalAs atribute is not supported on the compact framework and as
> such, I cannot specify specific data sizes for the values, string for
> instance.
>
> Any suggestions?
>
> I am looking for something like the original BASIC
>
> Type RECORD
> Reference as String * 5
> Description as String * 50
> End Type
>
> Cheers.
>
>




  Reply With Quote
Reply



Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off