[Gtk-sharp-list] too many GDA nullpointers!!

Soeren stp@kabelnettet.dk
Sat, 10 Apr 2004 18:33:23 +0200

Im trying to figure out how to use the wrapper
for Gnome Data Access (GDA) but I keep getting
nullpointers all over the place.

For instance if I try to get a value from a 
datamodel row or directly from the datamodel:

	DataModel dm = 
		conn.ExecuteSingleCommand(cmd, new ParameterList());
	int n = dm.NRows;
	for (int rowindex=0; rowindex<n; rowindex++) {
		Row row = dm.GetRow(rowindex);
		Gda.Value val = row.GetValue(1);  // <- nullptr inside GetValue()!!

The datamodel in this case consists of two cols (id int and name 
varchar(50)) and contains 4 rows (the property NRows confirm this).
If I try to use the method DataModel.GetValueAt(col,row) then I get
a nullptr as well.

Unhandled Exception: System.NullReferenceException: A null value was
found where an object instance was required.
in (unmanaged) /usr/local/lib/libmono.so.0(mono_string_new+0x1d)
in (unmanaged) /usr/local/lib/libmono.so.0(mono_string_new_wrapper+0x2d)
in <0x00205> (wrapper unknown) Gda.Value:PtrToStructure (intptr,object)
in (unmanaged) /usr/local/lib/libmono.so.0 [0x4004901b]
in (unmanaged) /usr/local/lib/libmono.so.0(mono_runtime_invoke+0x23)
in (unmanaged) /usr/local/lib/libmono.so.0 [0x4009dd08]
in (unmanaged) /usr/local/lib/libmono.so.0 [0x4009dd9a]
in <0x000b3> Gda.Value:New (intptr)
in <0x00055> Gda.Row:GetValue (int)
in <0x0016e> ChessServer.Datamodel.GameDatabase:Run ()
in <0x00031> ChessServer.Datamodel.GameDatabase:Main ()