FINALS | Database Programming | Event-Driven Programming

0.0(0)
studied byStudied by 0 people
0.0(0)
full-widthCall Kai
learnLearn
examPractice Test
spaced repetitionSpaced Repetition
heart puzzleMatch
flashcardsFlashcards
GameKnowt Play
Card Sorting

1/105

encourage image

There's no tags or description

Looks like no tags are added yet.

Study Analytics
Name
Mastery
Learn
Test
Matching
Spaced

No study sessions yet.

106 Terms

1
New cards

ADO.NET

Its library is a rich framework that retrieves and updates information in various relational databases, which include Microsoft SQL Server, Microsoft Access, Oracle, and XML.

2
New cards

ADO.NET

It relies on the .NET Framework's various classes to process requests and transition between a database system and the user

3
New cards

Active Data Objects

ADO stands for what?

4
New cards

Data Provider

It is used for connecting in the database, recovering results, updating data, and executing commands.

5
New cards

Data Provider

Each database system that ADO.NET supports has a _____ ________ that implements mechanisms for connecting to a database, executing queries, and updating data.

6
New cards

System.Data.SqlClient

What is the namespace for; Data Provider for SQL Server

7
New cards

System.Data.OleDb

What is the namespace for; Data Provider for OLE DB

8
New cards

System.Data.Odbc

What is the namespace for; Data Provider for ODBC

9
New cards

System.Data.OracleClient

What is the namespace for; Data Provider for Oracle

10
New cards

System.Data.EntityClient

What is the namespace for; EntityClient Provider

11
New cards

DataSet

It characterizes a local copy of related data tables.

12
New cards

DataSet

It is composed of one or more DataTable objects that are manipulated and updated as per the requirements of the users or client.

13
New cards

XML (Extensible Markup Language)

The data from this language can also work with DataSet.

14
New cards

DataTable

It manages the data for any entity. It contains zero or more rows of data, and each value shown in the ____ _______ is identified by the DataColumn. It also consists of primary key, foreign key, constraint, and relation information of different tables.

15
New cards

DataColumn

It includes a data type declaration based on the kind of data saved.

16
New cards

DataRelation

It is used to link two (2) DataTable classes inside the DataSet class.

17
New cards

DataColumnMapping

It is used to map a table name from the database to a DataTable within a DataSet.

18
New cards

DataView

It is used to customize the view of the table or desired view of the rows in a DataTable.

19
New cards

Data Provider, Dataset

ADO.NET has two (2) components that are commonly used: HINT: DP DS

20
New cards

Command

It can run SQL commands and perform a stored procedure—accessing and manipulating data. Data management statements and SQL queries are wrapped in the _________ object.

21
New cards

Connection

From the data source, it allows users to connect and disconnect. Communications with the external data sources happen through the ___________ object.

22
New cards

DataAdapters

It transfers DataSet's between the data source and the caller.

23
New cards

DataAdapters

It also acts as a connection between the data source and DataSet, where ____________ contain a connection and set of Command objects that help in fetching and updating data.

24
New cards

DataReaders

It is a read-only access to data using a server-side cursor.

25
New cards

DataReaders

The _______________ object is gained by invoking the ExecuteReader method of the Command object. It requires closing the connection when using the ___________ object.

26
New cards

Command, Connection, DataAdapters, DataReaders

Data Provider contains the following objects that define the function to be used in a database management system (DBMS): HINT: Com Con DA DR

27
New cards

SqlCommand, OleDbCommand, and ODBCCommand

Database Classes: Used as wrappers for SQL statements or stored procedure calls

28
New cards

SqlCommandBuilder, OleDbCommandBuilder, and ODBCCommandBuilder

Database Classes: Generate SQL commands for updating database tables Automatically generate SQL commands from a SELECT statement

29
New cards

SqlConnection, OleDbConnection, and ODBCConnection

Database Classes: Used to connect to the database

30
New cards

SqlDataAdapter, OleDbDataAdapter, and ODBCDataAdapter

Database Classes: Handle interaction between DataSet and data source Help in executing different SQL commands to populate a DataSet and update the data source

31
New cards

SqlDataReader, OleDbDataReader, and ODBCDataReader

Database Classes: Used as a forward-only, read-only access to data using a cursor

32
New cards

SqlParameter, OleDbParameter, and ODBCParameter

Database Classes: Define a parameter to a stored procedure

33
New cards

SqlTransaction, OleDbTransaction, and ODBCTransaction

Database Classes: Represent transactions to be made in data source

34
New cards

System.Data

It includes all generic data access classes.

35
New cards

System.Data.Common

It includes classes that are shared or overridden by individual data providers.

36
New cards

System.Data.EntityClient

It includes Entity Framework classes.

37
New cards

System.Data.Linq.SqlClient

It includes LINQ to SQL provider classes.

38
New cards

System.Data.Odbc

It includes ODBC provider classes.

39
New cards

System.Data.OleDb

It includes OLE DB provider classes.

40
New cards

System.Data.ProviderBase

It includes new base classes and connection factory classes.

41
New cards

System.Data.Sql

It includes new generic interfaces and classes for SQL Server data access.

42
New cards

System.Data.SqlClient

It includes SQL Server provider classes.

43
New cards

System.Data.SqlTypes

It includes SQL Server data types.

44
New cards

Server Explorer

It is a server management console that is used for logging in to servers, opening data connections, and accessing databases.

45
New cards

Data Connections

It contains all the connections to the server and local databases.

46
New cards

tables, view, stored procedures, and functions

The data connection node displays the list of _______, _____, _________ ______________, and __________. It can also be used to connect to a SQL Server Database.

47
New cards

SQL Server Object Explorer

It is used to design, connect to the available database, browse the schema, and create a query on its object.

48
New cards

Data Connections, SQL Server Object Explorer

To connect or create a database using Visual Studio for C#, use any of the two (2) windows below: HINT: DC SQLSOE

49
New cards

SQL Server Management Studio (SSMS)

To have an SQL Server with an integrated environment for managing any SQL infrastructure, use ____ __________ _____________ ______. It can deploy, monitor, and upgrade the data-tier components used by applications. It can also build queries and scripts.

50
New cards

.mdf

To create a local database, right-click the project file in the Solution Explorer, click Add New Item, and choose Service-Based Database. The file will be saved as ___ file

51
New cards

Master Database File or MDF

This file is known as the main database file which contains data and schema

52
New cards

.ldf

The ___ file under .mdf file contains logs for each transaction of the database. This allows SQL database to be recoverable in the case of data loss.

53
New cards

Log Database Files or LDF

This file contains logs for each transaction of the database.

54
New cards

Step 1

Steps to access data from the database: Create a connection to the specified server.

55
New cards

Step 2

Steps to access data from the database: Open a connection using the SqlConnection object.

56
New cards

Step 3

Steps to access data from the database: Create a command using the SqlCommand object.

57
New cards

Step 4

Steps to access data from the database: Use and create a DataReader or DataAdapter object.

58
New cards

Step 5

Steps to access data from the database: Call the Close() method to close the connection and release the resource

59
New cards

Connection

Step 1: Create a ____________ to the specified server.

60
New cards

SqlConnection

Step 2: Open a connection using the _____________ object.

61
New cards

SqlCommand

Step 3: Create a command using the _____________ object.

62
New cards

DataReader or DataAdapter

Step 4: Use and create a _____________ or ______________ object.

63
New cards

Close()

Step 5: Call the _______ method to close the connection and release the resources.

64
New cards

SqlConnection

This class is used to open a connection using the Open() method. The connection can be closed by calling the Close() method.

65
New cards

ConnectionString

a property that is used to read or assign the _________ ______ to be used by the SqlConnection class

66
New cards

DataSource

a read-only property that returns the name of the SQL Server instance

67
New cards

Database

a read-only property that returns the name of the database

68
New cards

State

a read-only property that returns the current state of the connection.

69
New cards

ConnectionString, DataSource, Database, State

SqlConnection Properties: HINT: CS DS D S

70
New cards

Server

This attribute is used to specify the computer name to which you want to connect.

71
New cards

SqlConnection conn = new SqlConnection("Server=computer_name;");

Basically, the computer name where the desired database is installed is specified in the following format:

72
New cards

SqlConnection conn = new SqlConnection("Server=(local);");

If the application is created on the same machine where the database is installed, the computer name can be specified as local:

73
New cards

SqlConnection conn = new SqlConnection("Data Source=(local);");

The attribute for specifying the computer name is Server, Data Source, Address, or Addr. For example, the preceding statement can also be written as shown below:

74
New cards

Database / Initial Catalog

The attribute is used to specify the database to access the specified server. The Database keyword can also be substituted for Initial Catalog.

75
New cards

Database / Initial Catalog

This attribute is optional. In other words, it can be ignored when you want to connect to a specific computer but not to any database.

76
New cards

SqlConnection conn = new SqlConnection("Server=(local); Initial Catalog=CSharpSampleDatabase;");

For example, the following statement establishes a connection with CSharpSampleDatabase on the local computer:

77
New cards

Trusted_Connection / Integrated Security

This attribute implements the secure connection with the database. The values true, false, yes, no, or SSPI can be specified for this attribute. After setting the security attribute to false or no, provide the login credentials.

78
New cards

Security Support Provider Interface

SSPI stands for what?

79
New cards

SqlConnection conn = new SqlConnection("Server=(local); Initial Catalog=CSharpSampleDatabase; Integrated Security=no");

While establishing a trusted connection or the connection that doesn't need to be verified, a value of true or SSPI (Security Support Provider Interface) can be assigned for this attribute as shown below:

80
New cards

Username

To specify the username used in a connection after assigning false or no to the Integrated Security attribute, use the User ID attribute and assign a valid username to it.

81
New cards

SqlConnection conn =new SqlConnection("Server=(local); Initial Catalog=CSharpSampleDatabase; Integrated Security=no; User ID = David");

To specify the username used in a connection after assigning false or no to the Integrated Security attribute, use the User ID attribute and assign a valid username to it. Here is an example:

82
New cards

Password/Pwd

When establishing a secure connection to a database, in addition to a valid username, a password is needed.

83
New cards

SqlConnection conn = new SqlConnection("Server=(local); Initial Catalog=CSharpSampleDatabase; Integrated Security=no; User ID=David; PWD=gold2019");

Password or PWD (not case sensitive) can be used, as shown in the following example:

84
New cards

Server, Database/Initial Catalog, Trusted_Connection/Integrated Security, User, Password

SqlConnection Attributes: HINT: S D/IC T_C/IS U P

85
New cards

SqlCommand

This class is used to perform desired processing on the database. It allows executing any direct T-SQL or stored procedure on the server.

86
New cards

ExecuteNonQuery

This method executes the command but does not return output.

87
New cards

ExecuteReader

This method executes the command and returns a DataReader object based on the SQL statement.

88
New cards

SqlDataReader

This object is forward-only and read-only cursor that can be iterated through to fetch the rows in it.

89
New cards

ExecuteRow

It executes the command and returns the SqlRecord object that contains a single returned row.

90
New cards

ExecuteScalar

It executes the command and returns the first column of the first row in the result set.

91
New cards

ExecureNonQuery, ExecuteReader, SQL Reader ExecuteRow, ExecuteScalar

Methods of the Command object: HINT: ENQ ER SQLDR ER ES

92
New cards

Connection

It gets or sets the SqlConnection class that can be used by the Command object.

93
New cards

CommandText

It gets or sets the stored procedure or the T-SQL statement.

94
New cards

CommandType

It indicates the way the CommandText property should be interpreted.

95
New cards

SqlParameterCollection

It refers to a collection of parameters that is connected with SqlCommand.

96
New cards

Add()

This method adds the specified SqlParameter object to the SqlParameterCollection and contains two (2) arguments: string paramaterName and SqlDbType.

97
New cards

string paramaterName and SqlDbType

The Add() method contains two (2) arguments:

98
New cards

SqlDbType

It specifies the SQL Server data type of a field and property.

99
New cards

public SqlParameter Add(string parameterName, SqlDbtype sqlDbType);

Add() method Syntax:

100
New cards

sqlCommand.Parameters.Add("@FirstName", SqlDbType);

Add() method Sample Code: