I clicked on Data and then Add New Data Source (first I tried show data sources and it said I had none).

I clicked on the Database Icon and clicked on Next at the bottom of the screen.


Here I clicked on New Connection and I am going to select the database. I selected a version of the donor database that is actually stored somewhere else and then did a test connection.  It connected.


Note that it now has the link that I browsed to get as the database file name. I clicked on OK.


This shows the connection – I clicked on Next at the bottom of the screen.


I responded Yes to this question.


I see the name that is saving as and click on Next.

 



I can now see the tables in the database (note that I clicked on the + next to tables to get this list).

I am going to select the Donor2000 by putting a check in the box next to it.


Again, I clicked on the + next to Donor 2000 under the donorDataSet to see the list of fields.


I dragged DIdno from the list under donor DataSet to the form and it put up the bar and the fields as shown.


I have dragged over some other fields and played with alignment.


I have now executed and I see the form.  I can move through using the bar.

 



Now I am going to the Solution Explorer window to make some modifications to the query.


Now I am going to click on the donorDataSet.xsd which is the dataset schema file.


This shows the information on the donorDataSet.xsd including its properties. Note the query named Fill that is used to fill the dataset when you run and the form is loaded.

 



I right clicked on the title bar above the query and now I am going to select Configure.


Note that the select now comes up.  I am selecting the fields I dragged over to the form from the Donor2000 table:

SELECT DIdno, DName, DStAdr, DCity, DState, DZip, DYrFirst, DContact FROM Donor2000

Since I know SQL, I can go in and change this so I put a where clause in or whatever I need to do.

I can also use the Query Builder to accomplish this.

 


I added Where Dcontact = “Ann Smith” to the SELECT statement.

SELECT DIdno, DName, DStAdr, DCity, DState, DZip, DYrFirst, DContact FROM Donor2000 Where DContact = "Ann Smith"

I then clicked on Finish and tested and it worked, I am only seeing records where the Dcontact = “Ann Smith”.


I now decided to go into the Query Builder.  Note the change I made is there (even though it is enclosed in parenthesis). 

 



Also note that the filter has the condition I put into the WHERE clause.  I am now going to add another condition.


 I added the condition > 1990 which did not reduce the number of records. When I made it greater than 1994 it did. 

I tested by using the Execute Query.

 


I am now using two conditions in an OR relationship and you can see the results.

I have now set it so you have to have the DyrFirst > 1994 and either the contact is David Costa or Ann Smith.


I could have written this in a better way. I am going to get out of the query builder and go back and make the changes to the SELECT.

 

 



Again notice the set of parenthesis that got added.