Data Components In Visual Studio .NET - Part Two

Managing and Viewing Data

 
The Server Explorer not only lets you add server and database connections, it also lets you manage and view data. You can add, update and delete data from a database.
 
The server Explorer also provides options to create new databases and objects including tables, views, stored procedures and so on. The Server Explorer manages database objects in a tree structure. Each database is a tree node of the server. As you expand the Puran database node, you can see its children listed as tables, stored procedures, and views (See figure below)

Data Components in Visual Studio .NET
Figure: The Server Explorer with database tables
 
If you expand this connection by double-clicking on it, you'll notice it shows tables, views and stored procedures. You can further expand these to see them in more detail.
 
Besides showing a list of database objects such as tables, views, stored procedures, and functions the server Explorer also lets you view, add, edit, and delete data from a data source. Below Figure shows the Student table of the Puran database in the Server Explorer. In figure, you see the data in a grid. You can edit this data at any time. For example, to delete a row or a collection of rows select the rows and hit Delete, or right-click on the selected rows and hit the delete option. The right- click option of the grid also provides you options to move to the grid's first, next, previous, and last records.
 
Data Components in Visual Studio .NET
Figure: The Student table in the server Explorer
 
You can also right-click on a table and choose Show Table Data from table to retrieve data of that table, as shown in figure below.

Data Components in Visual Studio .NET
Figure: Retrieving data from a table in the server Explorer
 

Conclusion

 
Hope this article would have helped you in understanding managing and viewing data through Server Explorer. See my other articles on the website on ADO.NET.