[Mono-list] ComboBox: can't select item
Marcos Perez
venezuelanman at gmail.com
Thu Jun 15 12:38:08 EDT 2006
hi, i'n developping a application on mono using Csharp
i use a combobox, where the data is loaded from a database, then the user
must select one option, but, when try to select one option, the terminal
display this menssaje gtk_entry_set_text: assertion `text != NULL' failed,
and nothing is selected... =S
i'm using this code where data is a stringconection
public void Cargar_Datos (string data, Gtk.ComboBoxEntry comboBox)
{
ListStore listStore = new Gtk.ListStore(typeof(string));
comboBox.Model = listStore;
CellRendererText text = new CellRendererText();
comboBox.PackStart(text, false);
comboBox.AddAttribute(text, "text", 0);
MySqlConnection conexion = new MySqlConnection(datos);
conexion.Open();
string query = "SELECT cod_concept, description FROM concepts ORDER
BY cod_concept";
MySqlCommand select = new MySqlCommand(query, conexion);
MySqlDataReader lector;
lector = select.ExecuteReader();
while (lector.Read())
{
string value= lector.GetString(0)+" | "+ lector.GetString
(1);
listStore.AppendValues(valor);
}
lector.Close();
conexion.Close();
}
i need help to solve that!!
Thanks!!!
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.ximian.com/pipermail/mono-list/attachments/20060615/70490f0e/attachment.html
More information about the Mono-list
mailing list