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);
}
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!!!
conexion.Close();
}
i need help to solve that!!
Thanks!!!
_______________________________________________ Mono-list maillist - Mono-list@lists.ximian.com http://lists.ximian.com/mailman/listinfo/mono-list