In Connected oriented Model, for each and every operation to the database like insert/update/delete, the client Application or front end will be performing an operation on the central database directly.
In this architecture, the programmer or a developer needs to open SQL connection before performing the operation like inserting the record, updating the record or deleting the record from the database table, once the operations to a database are done then the programmer needs to close SQL connection explicitly.
Objects to be used in Connected Oriented Model
Using system.data.sqlclient ;In this architecture, the programmer or a developer needs to open SQL connection before performing the operation like inserting the record, updating the record or deleting the record from the database table, once the operations to a database are done then the programmer needs to close SQL connection explicitly.
Objects to be used in Connected Oriented Model
- Sqlconnection object.
- Sqlcommand Object.
- SqlDataReader object.
- Including data provider into namespace .
- we have to use SQLconnection object by initializing and using the connection string parameter
Sqlconnection connection=new sqlconnection(conneString);
- Here a developer needs to open the connection explicitly to perform certain operation to a centralized database .
- we need to use command object by initializing SQL query/SQL command with the connection object reference name.
- we need to create datareader object.
- Once the data reader fetches the record from the centralized database, we will bind this data from dataReader object to the client Application.
GridView1.DataSource=dr;
- After the execution is completed, the programmer needs to close the connection explicitly.
connection.Close();
No comments:
Post a Comment