Ddata bindings (Bindingcontext)...Please Help!

A

al

Greetings,

Thank you for your kind attensition...

I have an app, one MDI form,frmMDI and one childe frmData. I did
databinding,using frmMDI bindingcontext property, to a table in the
dataset (dsEmployees). I use frmData to enter and search data. I use
dsEmployees to to get records from the same table,once to get full
table records (200) from db and the other is to get filtered data (30
rcd) based on user's search criteria (ID), each in separate, same
button, press event. I do clear and refill the dataset each time the
button is pressed. My question is, when frmData is first started,
user enters ID to search for and then press the button to get filtered
records , then presses the same button again to get all records. I
use textbox.text.lenght property to take the proper action (if
txtID.text.length>0 and txtname.text.lenght=0 then this is search, if
more than one textbox.text.length >0 this is to get all records). I
would like to know what event/property of dataset, or may be the
Bindingcontext of frmMDI or frmData I can use to take the proper
action, that is, to get all records or do search again??????

This is what I was able to come up with.(I'm looking for more
profesional way)


if frmData.txtID.text.length = 0 and frmData.txtName.text.length = 0

' get all records

Elseif frmData.txtID.text.length > 0 and frmData.txtName.text.length
= 0 then

'get only filtered data, search.

if frmData.txtID.text.length > 0 and frmData.txtName.text.length > 0

' get all records

Else

'refresh form


MTIA,
Grawsha
 
M

Miha Markic

Hi al,

Why don't you put your if stataments into button_click event and act
accordingly?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top