I recently used the ado.net Data model to connect to Oracle. I have been directly using OleDbConnection in the System. Data namespace to directly execute SQL statements.
(Http://blog.csdn.net/yysyangyangyangshan/article/details/6999304) generally write SQL statements directly, and then call the corresponding execution method can be, return data to save with dataTable. However, in. net framework4.0, for example, OracleCommand will prompt that it is out of date, so use ADO.net. The following describes how to connect to Oracle using the ADO. NET object data model. However, here Oracle must have ODA. NET, or else it cannot be connected successfully.
1. Create a project in the project.
2. Select the ADO. NET object data model.
3. Select by image. If you want to customize the model, select null.
4. Here is the new database connection, because this is the connection I have selected last time, so I am prompted for a connection. If you want to modify it, click New connection. The object connection name is Entity by default, it can also be modified as needed.
5. Click Create connection and select change to change different databases.
6. Select a database.
7. Enter the database name, user name, and password as required.
8. after entering the information, click test connection. If the message "connection successful" is displayed, the connection is OK.
9. Click 'Next' and select the model you want to generate.
10. The page loads the object.