I'm using the newly released Managed ODP.NET driver from Oracle to connect to my database (see here). Connection setup is fine. I now try to use a very simple LINQ to SQL example. The problem is that I get the an ArgumentOutOfRangeException. It appears on the foreach-Statement.
My very simple object:
[Table(Name = "my_mgr.ADDRESS")]
public class Address
{
[Column(Name = "NAME")]
public string Surname;
[Column(Name = "VNAME")]
public string Forename;
[Column(Name = "ANZ")]
public int Anz;
}
The part of testing the query:
DataContext db = new DataContext(inst.Connection);
Table<Address> addressTable = db.GetTable<Address>();
if (addressTable != null)
{
//"SELECT * from my_mgr.ADDRESS WHERE anz > 0";
var query = from p in addressTable where p.Anz > 0 select p;
foreach (var p in query)
{
MessageBox.Show(
"Forename: " + p.Forename + "\n" +
"Surname: " + p.Surname
);
}
}
Whereas my original SQL query was (which is actually working):
SELECT * from my_mgr.ADDRESS WHERE anz > 0
I actually searched a lot for this but I cannot find valid results since the driver is very new and it seems nobody had the problem before. I am very sure that the driver supports LINQ to SQL, as stated on this website. Sadly I'm not able to use neither the Entity Framework nor auto-generation tools provided by Visual Studio.