Groups | Blog | Home
all groups > dotnet windows forms databinding > october 2005 >

dotnet windows forms databinding : Conditional queries


John
10/1/2005 4:24:08 AM
Hi

I have created a simple data entry form by dragging a table onto a form and
letting vs2005 generate all bindings etc. All
works fine. Now I need to be able to view records selectively ie sometimes I
need to view/edit only 'Current' accounts and other times I need to
view/edit only 'Prospect' accounts. How do I implement this selective
behaviour from this point?

Thanks

Regards

Nick Malik [Microsoft]
10/1/2005 1:22:04 PM
I have not played with automatic data binding in VS Whidbey (sorry). I'm
going to guess.

It is quite likely that the bindings included a data adapter. In the data
adapter, you will see a command object assigned for the QueryCommand. That
command object contains the SQL for returning all rows (something like
"Select au_id, au_lname, au_fname from Authors"). If you want to return
fewer rows, you can either modify this statement with a Where clause or you
can create another command object that uses a SQL statement that has the
Where clause.

--
--- Nick Malik [Microsoft]
MCSD, CFPS, Certified Scrummaster
http://blogs.msdn.com/nickmalik

Disclaimer: Opinions expressed in this forum are my own, and not
representative of my employer.
I do not answer questions on behalf of my employer. I'm just a
programmer helping programmers.
--
[quoted text, click to view]

AddThis Social Bookmark Button