INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Jobs

Temporary, non SQL, free table

Temporary, non SQL, free table

(OP)
Hello,

I need some sort of simple, non SQL based tables to be used temporary in a C# App.
I just need to create them (with 3 or 4 fields), populate them from a text file, have some statistics
based on some index field and then discard them.
Is there such a mechanism ?

Thank you,
Daniel

RE: Temporary, non SQL, free table

If the text file will always have the same structure, you could design a DataSet that will hold the data. Then you would read the file, split the data and add it to the DataSet.

Another way to do this would be to create a class that has all of the fields from the data. You would read the data into an object of that class. If there is more than one row, you would add each object to a List of objects of that class and then continue your processing.

I have used both of the methods on various projects.

-Dell

DecisionFirst Technologies - Seven-time SAP BusinessObjects Solution Partner of the Year
www.decisionfirst.com

RE: Temporary, non SQL, free table

(OP)
Thank you, Dell

I'll go with DataSet.

Does it have Seek / Locate mechanism?

Thank you,
Daniel

RE: Temporary, non SQL, free table

Yes, it does. If you pre-define a DataTable in your DataSet, you can indicate which fields are keys and VS will automatically create "Find" methods for those keys. If you don't want to do that, you can use the Select() method of a DataTable to find data based on a selection formula. The code for this will look something like this:

groups = dsAuditInfo.reportSecTable.Select(string.Format("reportID = {0}",myReportID));

-Dell

DecisionFirst Technologies - Seven-time SAP BusinessObjects Solution Partner of the Year
www.decisionfirst.com

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members!

Resources

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close