Search Results

Search found 6 results on 1 pages for 'arnoldino'.

Page 1/1 | 1 

  • c# reading integer fields from database, returning empty string when reading integer type field

    - by arnoldino
    what is wrong with this code? field="id"; table="MInvMonth"; condition="machine_id=37"; public static String getConditionedField(String field, String table, String condition) try { if (cmd == null) getConnection(); cmd.CommandText = "Select " + field + " from " + table + " where " + condition; SQLiteDataReader reader = cmd.ExecuteReader(); if (reader.HasRows==true) { reader.Read(); string s = reader[0].ToString(); // return first element reader.Close(); return s; } reader.Close(); return null; } catch (Exception e) { MessageBox.Show("Caught exception: " + e.Message+"|"+cmd.CommandText); return null; } I checked the sql statement, it turns the right value. why can't I read it? the returnvalue is "".

    Read the article

  • C# this.Controls.Remove problem

    - by arnoldino
    What is the problem with this code? for (int w = 0; w < this.Controls.Count; w++) { if (this.Controls[w] is TransparentLabel) { la = (TransparentLabel)this.Controls[w]; if (la.Name != "label1") { la.Visible = false; la.Click -= new System.EventHandler(Clicked); this.Controls.Remove(this.Controls[w]); la.Dispose(); } } } I want to clear the screen from the labels, but it doesn't work.

    Read the article

  • c# compact-framework textbox mouseleave

    - by arnoldino
    hello, I would like to leave the textbox via code. when user clicks in the textbox, and types in something , and then the user will click outside the textbox. on the screen there are just labels. only this one textbox is on the form. my problem is, that the textbox does not lost focus when I click everywhere on the screen. the texbox it still has the focus. this textbox is used to filter a list, built from labels. the complete story is: - I have no mainmenu on the screen, so the Sip icon is not visible - user clicks in the textbox, and i bring up the SIP, in the textbox.GotFocus event - user types in some letters, the list is filtered - if user clicks away, the SIP disappears (textbox.lostfocus), but the textbox still has the focus, I mean the cursor remains in the textbox - when user wants to type some other letters for filtering, it clicks in the textbox, but GotFocus does not fire how can I make the texbox to loose the focus?

    Read the article

  • c# reading integer fields from database

    - by arnoldino
    what is wrong with this code? try { if (cmd == null) getConnection(); cmd.CommandText = "Select id from HMonthInventary where machine_id=37"; SQLiteDataReader reader = cmd.ExecuteReader(); if (reader.HasRows==true) { reader.Read(); string s = reader[0].ToString(); // return first element reader.Close(); return s; } reader.Close(); return null; } catch (Exception e) { MessageBox.Show("Caught exception: " + e.Message+"|"+cmd.CommandText); return null; } I checked the sql statement, it turns the right value. why can't I read it? the returnvalue is "".

    Read the article

1