Question: I have a list as defined below that is populated from a `GridView`. Everything is OK.

What is the best method of saving / loading this list to/from a file (XML or otherwise is OK)?

Note: In the future, I will be encrypting the file.

**C# Code**

```
List<Item> lstNewItems = new List<Item>(); // Control Items  
lstNewItems.Clear();

foreach (GridViewRow PendingItemUnderControl in GridViewPendingList.Rows)
{
    Item NewItem = new Item();
    NewItem.Paramater = PendingItemUnderControl.Cells[0].Text.ToLower();
    NewItem.Type = (String)Session["BrowseType"];
    lstNewItems.Add(NewItem);
}

public class Item
{
    public Item(string Paramater, string Type)
    {         
        _Paramater = Paramater;
        _Type = Type;
    }
    private string _Paramater;
    [DataMember]
    public string Paramater
    {
        get { return _Paramater; }
        set { _Paramater = value; }
    }
    private string _Type;
    [DataMember]
    public string Type
    {
        get { return _Type; }
        set { _Type = value; }
    }
}

```

Answer: 
[ProtoBuf Net](http://code.google.com/p/protobuf-net/) is a binary serializer but it is very flexible and fast
for structured data, either XML or a very lightweight SQL RDBMS like SQLite or SQL Server Compact Edition will work well 

I recommend `XML` reader/writer class for files because it is easily serialized  

Serialization is an easy way to convert an object to a binary representation that can then be written to disk or sent over a wire.