0% found this document useful (0 votes)
5 views2 pages

Labweek 6

The document outlines three tasks focused on using disconnected mode with a Students table in a console application. Task 1 involves retrieving and displaying data using SqlDataAdapter and DataSet, Task 2 focuses on modifying data in memory and updating the database, and Task 3 covers inserting new records into the DataSet and pushing changes to the database. Each task emphasizes the benefits of manipulating data without maintaining an open connection.

Uploaded by

legovu03
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
5 views2 pages

Labweek 6

The document outlines three tasks focused on using disconnected mode with a Students table in a console application. Task 1 involves retrieving and displaying data using SqlDataAdapter and DataSet, Task 2 focuses on modifying data in memory and updating the database, and Task 3 covers inserting new records into the DataSet and pushing changes to the database. Each task emphasizes the benefits of manipulating data without maintaining an open connection.

Uploaded by

legovu03
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 2

Task 1: Exploring Disconnected Mode - Basic Retrieval

Task: Create a console application that retrieves data from a Students table
using a DataSet or DataTable via SqlDataAdapter. Display the fetched data.

Steps:

 Establish a connection using SqlConnection.

 Use SqlDataAdapter to fill a DataSet or DataTable.

 Display the data from the DataSet after the connection is closed.

Learning Outcome: The group will observe how the data is fetched, stored
in memory, and manipulated without needing the connection to stay open.

Task 2: Disconnected Mode - Modifying Data

Task: Create an application that retrieves data from a Students table into a
DataSet, modifies one of the rows, and then updates the changes back to the
database using SqlDataAdapter and SqlCommandBuilder.

Steps:

 Use SqlDataAdapter to fill a DataSet.

 Modify a row in the DataSet (e.g., update a student’s age).

 Use SqlDataAdapter.Update() to push the changes back to the


database.

Learning Outcome: The group will experience how disconnected mode


allows data manipulation in memory before re-establishing the connection to
apply changes.

Task 3: Disconnected Mode - inserting Data

Task: Create a simple console application that connects to a database,


retrieves data into a DataSet, and inserts a new record into the DataSet.
Then, update the database using SqlDataAdapter.

Steps:

 Use SqlDataAdapter to fill a DataSet from the Students table.

 Add a new row in the DataSet (e.g., a new student record).


 Use SqlCommandBuilder and SqlDataAdapter.Update() to push the new
row to the database.

Learning Outcome: This group will understand how disconnected mode


works when inserting a single record into the database.

You might also like