All pastes #32520 Raw Edit

bipolar

public text v1 · immutable
#32520 ·published 2005-12-05 16:10 UTC
rendered paste body
		private void populate_to ()
		{
			Gtk.ListStore cb_to_model = new Gtk.ListStore (typeof(string), typeof(string));
			//cb_to is a Gtk.ComboBox
			cb_to.Model = cb_to_model;
			string query = "SELECT Employee_Number AS \"ID\", IF(Suffix is null,"
							+ "CONCAT(First_Name, \" \", Last_Name),CONCAT"
							+ "(First_Name, \" \", Last_Name, \", \", Suffix)) "
							+ "AS \"Name\" FROM tbl_employees WHERE "
							+ "Gets_Issues = -1 AND Fire_Date IS Null";

			DataSet ds = ((cl_getdata)cl_Vars.cl_getdata).returndataset(query);
			DataTable table = ds.Tables[0];

			foreach (DataRow row in table.Rows)
			{
				Console.WriteLine(row["Name"].ToString() + "::" + row["ID"].ToString());
				cb_to_model.AppendValues(row["Name"].ToString(),row["ID"].ToString());

			}
			
			Gtk.CellRendererText nameCell = new Gtk.CellRendererText ();
			cb_to.PackStart (nameCell,true);
			cb_to.AddAttribute (nameCell, "text", 0);

		}