Is there a way to store data in a table format:

Inside the SettingsModel column, which is defined in Linq-to-Sql as follows:

And also with the DataContext option:

With the SettingsModel class defined like this:
namespace ElQueue.DataClasses { [DataContract] public sealed class SettingsModel { [DataMember(IsRequired = true)] public int[] VideoMediaData { get; set; } } }
Here?...
using (SomeDataContext dataContext = new SomeDataContext()) { SettingsModel m = new SettingsModel(); m.VideoMediaData = new int[] { 1, 2, 3 }; dataContext.MainTableSettings.InsertOnSubmit(new MainTableSetting() { SettingsModel = m }); dataContext.SubmitChanges(); } using (SomeDataContext dataContext = new SomeDataContext()) { var r = dataContext.MainTableSettings.Single(); }
You see, the above code does not work correctly, it throws an exception that says that it cannot convert the string to MainTableSetting , which means that either it cannot save all the serialized data, or this plus cannot deserialize it back.
I need some tips on how to tell this Linq-to-Sql to actually execute serialization (and vice versa) when I access the database.
AgentFire
source share