First, write the connection string.
You can write it in web. config.
[Html]
<ConnectionStrings>
<Add name = "oracleson" connectionString = "Data Source = dingsenorcl; Persist Security Info = True; User ID = ds; Password = ds; Unicode = True" providerName = "System. data. oracleClient "/>
</ConnectionStrings>
<ConnectionStrings>
<Add name = "oracleson" connectionString = "Data Source = dingsenorcl; Persist Security Info = True; User ID = ds; Password = ds; Unicode = True" providerName = "System. data. oracleClient "/>
</ConnectionStrings>
And then the back-end call
[Html]
String orclcon = ConfigurationManager. ConnectionStrings ["oracleson"]. ConnectionString;
String orclcon = ConfigurationManager. ConnectionStrings ["oracleson"]. ConnectionString;
Create a database connection object
[Html]
OracleConnection conn = new OracleConnection (orclcon)
OracleConnection conn = new OracleConnection (orclcon)
Create an OracleCommand object to operate the database
[Html]
OracleCommand cmd = conn. CreateCommand ()
OracleCommand cmd = conn. CreateCommand () Open the connection
[Html] view plaincopyprint? Conn. Open ();
Conn. Open ();
[Html]
Cmd. CommandText = "insert into T_12 (AAAA) values (: )";
Cmd. Parameters. AddWithValue (": a", TextBox1.Text); // Replace the parameter with the oracle database: sqlserver database is @
Cmd. ExecuteNonQuery ();
Cmd. CommandText = "insert into T_12 (AAAA) values (: )";
Cmd. Parameters. AddWithValue (": a", TextBox1.Text); // Replace the parameter with the oracle database: sqlserver database is @
Cmd. ExecuteNonQuery ();