2
Answers

Report Viewer

Arnold Petrona

Arnold Petrona

16y
4.5k
1

I'm searching more information about Report Viewer.

I have a datagirdview with data that is manully added and I want to save those info and transfer it to the Report Info.

Is log file a way to do it? Or i need to do it on another way

Plse advise

Answers (2)
0
Narasimha Reddy Chennupalli

Narasimha Reddy Chennupalli

NA 1.4k 330.8k 9y
Hi Kamal,
Create one Interface to access for different databases. The below steps help you to maintain universal DAL.
Steps:
1. Create Interface with the name IDataAccess

Public Interface IDataAccess
{
void DbConnection();
DataTable GetAllData();
bool InsertData();
bool UpdateData();
bool DeleteData();
}

2. Implement the interface for Sql database access with the class name DataAcessSql.cs and implement all the methods of IDataAccess interface

Public class DataAccessSql:IDataAccess
{
Public void DbConnection()
{
// write the code for Sql connection
}
Public DataTable GetAllData()
{
// write the code to get data from Sql database.
}
Public bool InsertData()
{
// write the code for inserting data into Sql database.
}
Public bool UpdateData()
{
// write the code for updating data into Sql database.

}
Public bool DeleteData()
{
// write the code for deleting data from Sql database.

}
}

3. Implement the interface for Oracle database access with the class name DataAcessOracle.cs and implement all the methods of IDataAccess interface

Public class DataAccessOracle:IDataAccess
{
Public void DbConnection()
{
// write the code for Oracle database connection
}
Public DataTable GetAllData()
{
// write the code to get data from Oracle database.
}
Public bool InsertData()
{
// write the code for inserting data into Oracle database.
}
Public bool UpdateData()
{
// write the code for updating data into Oracle database.

}
Public bool DeleteData()
{
// write the code for deleting data from Oracle database.

}
}

In this way we can maintain universal DA. We cannot get any conflicts by using different databases.

I hope this will help you to matain universal DAL, let me know if you have any queries on this.
Next Recommended Forum