Example url with query strings

This preview shows page 10 - 12 out of 72 pages.

Example URL with query strings: Calling getQueryVariable("id") - would return "1". Calling getQueryVariable("image") - would return "awesome.jpg". Question 3. 3. (TCO 4) Explain the purpose of a dataset and describe how to create a dataset called dsEmployee in Visual Studio 2012. Assume you have the following function in the clsDataLayer class. Write the SQL command to select all rows from the tblEmployee table, and write the code to fill the dataset.
// Write the code here to select all rows from the tblEmployee table
// Write the code here to populate the dataset ________________________________________________________ return DS; } (Points : 15)
On the Project menu, click Add New Item. The Add New Item dialog box appears. In the Templates box of the Add New Item dialog box, click DataSet. Name the Dataset dsEmployee, and then click Add. Visual Studio will add a file called dsEmployee.xsd to the project and open it in the Dataset Designer. public static dsEmployee GetEmployee(string Database) { dsEmployee DS; OleDbConnection sqlConn; OleDbDataAdapter sqlDA; sqlConn = new OleDbConnection("PROVIDER=Microsoft.ACE.OLEDB.12.0;" + "Data Source=" + Database); // code to select all rows from the tblEmployee table sqlDA = new OleDbDataAdapter("select * from tblEmployee", sqlConn); DS = new dsEmployee(); // code to populate the dataset sqlDA.Fill(DS.tblEmployee); // displaying the dataset contents to the user return DS;

  • Left Quote Icon

    Student Picture

  • Left Quote Icon

    Student Picture

  • Left Quote Icon

    Student Picture