Strange problem on some Windows 2000 machines

Posts   
 
    
JMitchell avatar
JMitchell
User
Posts: 128
Joined: 01-Sep-2006
# Posted on: 26-Sep-2008 14:07:46   

I am seeing a strange problem which seems to be isolated to some Windows 2000 PCs.

I am using C# in Visual Studio 2008, targeting .Net 2.0 with LLBLGen Pro 2.6 Self Servicing.

I am using the TypedListDAO class to populate a DataTable.

Several instances of this code work fine every time, several other instances work fine on my development PC and others running XP but don't work on several Windows 2000 PCs I need to deploy the software on to.

I get a "Object not set to instance of an object" error but I can't see why.

One code section that works is:

TravelDB.HelperClasses.ResultsetFields fields = new TravelDB.HelperClasses.ResultsetFields(1);
fields.DefineField(TravelDB.HelperClasses.AirportLocationFields.TrAirportName, 0);
IPredicateExpression FromFilter = new PredicateExpression(TravelDB.HelperClasses.AirportLocationFields.Airport == strAirportCode);
TravelDB.DaoClasses.TypedListDAO CustomerDynamicList = new TravelDB.DaoClasses.TypedListDAO();
AirportList.Clear();
CustomerDynamicList.GetMultiAsDataTable(fields, AirportList, 0, null, FromFilter, null, false, null, null, 0, 0);

One code section that doesn't is:

TravelDB.HelperClasses.ResultsetFields fields = new TravelDB.HelperClasses.ResultsetFields(2);
fields.DefineField(TravelDB.HelperClasses.CountryFields.CountryCode, 0);
fields.DefineField(TravelDB.HelperClasses.CountryFields.Name, 1);
IPredicateExpression FromFilter = new PredicateExpression();
if (AllNations == false)
{
    TravelDB.EntityClasses.AirportLocationEntity Arpt = new TravelDB.EntityClasses.AirportLocationEntity(strAirportCode);
    if (Arpt.CountryCode != "?")
        FromFilter.Add(TravelDB.HelperClasses.CountryFields.CountryCode == Arpt.CountryCode);
}
ISortExpression sorter = new SortExpression(TravelDB.HelperClasses.CountryFields.Name | SortOperator.Ascending);
TravelDB.DaoClasses.TypedListDAO CountryDynamicList = new TravelDB.DaoClasses.TypedListDAO();
DataTable NationsList = new DataTable();
CountryDynamicList.GetMultiAsDataTable(fields, NationsList, 0, sorter, FromFilter, null, false, null, null, 0, 0);
cmbCountry.DataSource = NationsList;
cmbCountry.DisplayMember = "Name";
cmbCountry.ValueMember = "CountryCode";

As mentioned, it works on my development PC so it's really hard to debug. All I've managed to determine is that it's the GetMultiAsDataTable that fails.

JMitchell avatar
JMitchell
User
Posts: 128
Joined: 01-Sep-2006
# Posted on: 26-Sep-2008 15:50:52   

I have a screenshot of a new build with slightly more debug information. I'll try to attach it here...

The fact the DLL was generated in VB not C# shouldn't affect this should it?

Attachments
Filename File size Added on Approval
StackTrace.gif 4,543 26-Sep-2008 15:51.18 Approved
JMitchell avatar
JMitchell
User
Posts: 128
Joined: 01-Sep-2006
# Posted on: 26-Sep-2008 16:27:34   

I've now tried using Typed Lists in the dll generated via the GUI but it still doesn't work. All very strange...

Otis avatar
Otis
LLBLGen Pro Team
Posts: 39614
Joined: 17-Aug-2003
# Posted on: 27-Sep-2008 14:46:55   

please run the code with teh debug build of the ormsupportclasses which is in the runtimelib folder (please download the latest build as well), which will give you the line number where things go wrong so we can look what might be null and start going back from there.

Frans Bouma | Lead developer LLBLGen Pro
JMitchell avatar
JMitchell
User
Posts: 128
Joined: 01-Sep-2006
# Posted on: 29-Sep-2008 11:13:22   

I used the debug build with the latest version and it turned out the problem was related to a user not having select permissions on the relevant table, rather than being related to being run on Windows 2000.

Otis avatar
Otis
LLBLGen Pro Team
Posts: 39614
Joined: 17-Aug-2003
# Posted on: 29-Sep-2008 11:31:49   

JMitchell wrote:

I used the debug build with the latest version and it turned out the problem was related to a user not having select permissions on the relevant table, rather than being related to being run on Windows 2000.

Still a strange thing, as the error is a nullref issue, not a server error. Could you give me the line where the code crashed?

Frans Bouma | Lead developer LLBLGen Pro