hi I'm new to Linux and mono. I am using Mono 3.6 and Debian 7.6
I keep getting object reference not set to an instance of an object. I use the same code that I compile on windows with VS 2013 and it works fine.
string connstring = string.Format
("Data Source={0},{1};Initial Catalog={2};User ID={3};Password={4};Application Name={5};Connect Timeout=120",
IP, Port, database, Username, Password, InstanceID);
settings = new ConnectionStringSettings("sqlServer",
connstring, "System.Data.SqlClient");
using (data = new SwitchDataDataContext(settings.ConnectionString)){
BlockList.Clear();
foreach (var item in data.BlockLists)
{// so this works
if (BlockList.ContainsKey(item.TN) == false)
BlockList.TryAdd(item.TN, item.TN);
}
// this is where it crashes
var custs = data.CustomerGateways.Where(p => p.isEnabled == true);
}
When I call the code it throws an exception.
Any idea what could be wrong?
works fine on Windows.
I wrote the exception to the screen. DbLinq.Data.Linq.Mapping.AttributedMetaType+c__Iterator0.MoveNext() [0x00000] in :0 at System.Collections.Generic.List System.Data.Linq.Mapping.MetaAssociation .AddEnumerable