[Gtk-sharp-list] GDA#

Wolfgang Mauer W.Mauer@top-soft.info
Fri, 2 Jul 2004 21:18:33 +0200


Hi all,

at my program i do some like this

			private Gda.DataModel kundendataset = null;
			...

			for (int i = 0; i < this.kundendataset.NColumns; i++)
			{
				Gtk.Widget widget = null;
				string column = this.kundendataset.GetColumnTitle(i);
				widget = gxml.GetWidget(column);
				if (widget != null) 
				{
Exception ---> 	       Gda.Value _value = this.kundendataset.GetValueAt(i, 0);
					if (widget.GetType() == typeof(Gtk.Entry))
					{ 
						((Gtk.Entry)gxml.GetWidget(column)).Text = _value.Stringify();
					} 
					else if (widget.GetType() == typeof(TextView))
					{ 
						((Gtk.TextView)gxml.GetWidget(column)).Buffer.Text = _value.Stringify();
					}
				} 
			}

my mysql table have 13 fields (all varchar)

i get a exception like this
allways on a different column!!!!!!
i also tryed 
					_value = this.kundendataset.GetRow(0).GetValue(i);

Unhandled Exception: System.NullReferenceException: Object reference not set 		
to an instance of an object
in (unmanaged) (wrapper managed-to-native) 
System.Object:__icall_wrapper_mono_string_new_wrapper (intptr)
in <0x00004> (wrapper managed-to-native) 
System.Object:__icall_wrapper_mono_string_new_wrapper (intptr)
in <0x001a6> (wrapper unknown) Gda.Value:PtrToStructure (intptr,object)
in (unmanaged) (wrapper managed-to-native) 
System.Runtime.InteropServices.Marshal:PtrToStructure (intptr,System.Type)
in <0x00004> (wrapper managed-to-native) 
System.Runtime.InteropServices.Marshal:PtrToStructure (intptr,System.Type)
in <0x0008f> Gda.Value:New (intptr)
in <0x00061> Gda.DataModel:GetValueAt (int,int)
in <0x0012a> Assistent.KundenView:UpdateData (bool)

i this a bug ???
i missing a method like SetValue ????
how to store values back to row or datamodel ????


thanks a lot for help
Wolfgang Mauer