none
BindingSource Filter with textbox.

    Question

  • Hi All! I have a question... How can I do filter the BindingSource and the TableAdapter under c# 2005 with textbox? My database is mdb. Please help me! Thank's!

    Tuesday, November 21, 2006 9:19 AM

Answers

  • This one may help. Make a new SQL Auery in your dataset. You can use DataSetDesigner wizar to make it. Then call this Query everytime when the user press a key on the textBox(to do this use OnTextChanged event).

    Ex:
    this.TblAdapter.SelectIDQuery(this.DbDataSet , "%" + textBox1.Text + "%");

    And your query must like this:

    SELECT *
    FROM [Table]
    Where id LIKE ?

    If u use dataGridView control , it may have "Filter" option but i'm not sure.

    Tuesday, November 21, 2006 5:19 PM
  • Dear MasterG! Thank you the reply. It's will maybe the key. I will test it at tomorrow. Thank you, and if i have any problem, i will write.
    Tuesday, November 21, 2006 9:29 PM

All replies

  • Hello,

    Can you be more specific?

     

    Tuesday, November 21, 2006 10:27 AM
  • HI! I have a little program. It use mdb. I would like to search in the table, or tables with textbox. The term is in the textbox, and I would like to upload the tableadapter or binding source with the hit's. (If possible to speak/write in hungarian please tell me. :) ) Thank's Imre
    Tuesday, November 21, 2006 10:40 AM
  • Szia Imre,

    Unfortunatelly I don't speak hungarian very well. (still learning it ;) ). I think what you need is this:

                  txbox.DataBindings.Add(new Binding("Text", table, "PropertyName"));

                  BindingContext[table].Position = line;

    Hope this will help you.

    Regards,

    Tuesday, November 21, 2006 1:09 PM
  • Szia Mónika! What I want: I have a table (for example personal table). I would like to upload the adapter (whit the all of the hits). The filter is the textbox. It's like query (in sql).
    Tuesday, November 21, 2006 3:15 PM
  • This one may help. Make a new SQL Auery in your dataset. You can use DataSetDesigner wizar to make it. Then call this Query everytime when the user press a key on the textBox(to do this use OnTextChanged event).

    Ex:
    this.TblAdapter.SelectIDQuery(this.DbDataSet , "%" + textBox1.Text + "%");

    And your query must like this:

    SELECT *
    FROM [Table]
    Where id LIKE ?

    If u use dataGridView control , it may have "Filter" option but i'm not sure.

    Tuesday, November 21, 2006 5:19 PM
  • Szia Mónika!

    Can you send an e-mail to my address? It's craigdeejay@freemail.hu. I have several question. Thank you the reply and wait to your mail! Imre

    Tuesday, November 21, 2006 9:25 PM
  • Dear MasterG! Thank you the reply. It's will maybe the key. I will test it at tomorrow. Thank you, and if i have any problem, i will write.
    Tuesday, November 21, 2006 9:29 PM
  • Sorry , but u said me? i couldn't understand these words:

    Szia Mónika!

    Imre

    ???? İf u said to me , it's pleasure to help.

    Wednesday, November 22, 2006 8:25 AM
  • Excause me! I said this: "Dear MasterG! Thank you the reply. It's will maybe the key. I will test it at tomorrow. Thank you, and if i have any problem, i will write. "

    Wednesday, November 22, 2006 8:57 AM
  • Szia Imre,

    Were you asking for my email address? Or for MasterG's ?

     

    Thursday, November 23, 2006 9:45 AM
  • Szia! I have a several question about jobs and the c#, but it's not belong in the topic.
    Thursday, November 23, 2006 11:34 AM