Take the above
Before using Dataprovider, you need to configure the following nodes in Web.config to add between <configSections></configSections>:
<IsLine.Data.Configuration>
<DataBaseConnection>
<DBType>IsLine.Data.DataTypeEnum.DataBaseType.SqlServer</DBType>
<Server>Server IP</Server>
<UserID>sa</UserID>
<PwdType>Cryptography.Decrypting</PwdType> // or <PwdType>Cryptography.StrengthDecrypting</PwdType> or <PwdType>Cryptography.None</PwdType>
<Pwd>111111</Pwd>
<DataBase>UML</DataBase> //SqlServer only
</DataBaseConnection>
</IsLine.Data.Configuration>
Where databaseconnection indicates the type of the database, Pwdtype indicates the password encryption policy, Isline provider a built-in 3 policy to choose from, as shown in the configuration file. The example above is for SQL Server, and the following is the Oralce node configuration method:
<IsLine.Data.Configuration>
<DataBaseConnection>
<DBType>IsLine.Data.Configuration.OracleConnectString</DBType>
<Server>TNS别名</Server>
<UserID>sa</UserID>
<PwdType>Cryptography.Decrypting</PwdType> // or <PwdType>Cryptography.StrengthDecrypting</PwdType> or <PwdType>Cryptography.None</PwdType>
<Pwd>111111</Pwd>
<OtherPlus>Provider=MSDAORA.1; Persist Security Info=False;</OtherPlus> //Oracle Only
</DataBaseConnection>
</IsLine.Data.Configuration>
Or you can use the following simple configuration method to remove the problem of node configuration:
Sql server:
<add key= "IsLine.Data.Configuration.SqlServerConnectString" value= "Data source=server IP; User; Password=111111;integrated Security=no; Enlist=false; pooling=true; "/>
ORACLE:
<add key= "IsLine.Data.Configuration.OracleConnectString" value= "Data Source=tns alias; User; Password=111111;integrated Security=no; Enlist=false; pooling=true; "/>
After the node is configured, use the following method call, the call time for connection-oriented and connectionless two ways, connection-oriented operations (such as return dataset/reader/adapter, etc.) must be instantiated before use, must be invoked after use. The Dispost () method frees the resource, Dispost () is a Dataprovider overridden method that, once invoked, releases all resources, including connection, Command, DataReader, and so on, and calls directly on the connectionless operation. If you use DataReader, adapter, and so on for connection-oriented operations, simply execute SQL statements for connectionless operations, such as accessing a database for simple execution by using SQL statements:
Oracleprovider.executenonquery ();
Or
Sqlprovider.executenonquery ();