I am facing the error at "GetConnectionInfo"
Private string GetConnectionInfo(string ConName)
{
string PKey;
PKey = GetKeyInfo();
System.Data.OleDb.OleDbDataReader rs;
System.Data.OleDb.OleDbConnection oCon = new System.Data.OleDb.OleDbConnection();
System.Data.OleDb.OleDbCommand oComm = new System.Data.OleDb.OleDbCommand();
string sSql;
string ConfConnection;
try
{
ConfConnection = Dts.Connections("Config").ConnectionString.ToString();
oCon.ConnectionString = ConfConnection;
oCon.Open();
sSql = "SELECT [CNCTN_NM],[USER_ID],[PSWRD_TXT],[DATA_SRC_NM],[CATLG_NM],[PRVDR_NM], [INTEGRATED_SECURITY] FROM [TDW_ETL_CONNECTSTRING] WHERE [CNCTN_NM] = '" + ConName + "'";
oComm.CommandText = sSql;
oComm.Connection = oCon;
oComm.CommandTimeout = 600;
rs = oComm.ExecuteReader();
string CNCTN_NM;
string USER_ID;
string PSWRD_TXT;
string dUSER_ID;
string dPSWRD_TXT;
string DATA_SRC_NM;
string CATLG_NM;
string PRVDR_NM;
bool INTEGRATED_SECURITY;
while (rs.Read())
{
// Get The Data from the table
CNCTN_NM = System.Convert.ToString(rs.GetValue(0));
if (rs.IsDBNull(1) == false)
USER_ID = System.Convert.ToString(rs.GetValue(1));
if (rs.IsDBNull(2) == false)
PSWRD_TXT = System.Convert.ToString(rs.GetValue(2));
DATA_SRC_NM = System.Convert.ToString(rs.GetValue(3));
CATLG_NM = System.Convert.ToString(rs.GetValue(4));
PRVDR_NM = System.Convert.ToString(rs.GetValue(5));
INTEGRATED_SECURITY = System.Convert.ToBoolean(rs.GetBoolean(6));
// Decrypt the userid and password
if (INTEGRATED_SECURITY == false)
{
dUSER_ID = DecryptTripleDES(USER_ID, PKey);
dPSWRD_TXT = DecryptTripleDES(PSWRD_TXT, PKey);
}
}
Here i am getting the error ====>
GetConnectionInfo = GenerateConnectionString(PRVDR_NM, dUSER_ID, dPSWRD_TXT, INTEGRATED_SECURITY, DATA_SRC_NM, CATLG_NM);
}
finally
{
if (!rs.IsClosed)
rs.Close();
oComm.Dispose();
oCon.Dispose();
}
}
You are trying to assign a value to a method. That is not possible.
I think what you want to achive could be something like:
string connectionInfo = GetConnectionInfo(GenerateConnectionString(PRVDR_NM, dUSER_ID, dPSWRD_TXT, INTEGRATED_SECURITY, DATA_SRC_NM, CATLG_NM));
Related
I want to update a cell of the row in gridview. But I am getting error as
ORA-01036: illegal variable name/number
at cmd.ExecuteNonQuery()
Here is my code below:-
protected void SaveChanges(object sender, EventArgs e)
{
myConn.Open();
string excelData = Grid1ExcelData.Value;
string excelDeletedIds = Grid1ExcelDeletedIds.Value;
string[] rowSeparator = new string[] { "|*row*|" };
string[] cellSeparator = new string[] { "|*cell*|" };
string[] dataRows = excelData.Split(rowSeparator, StringSplitOptions.None);
for (int i = 0; i < dataRows.Length; i++)
{
string[] dataCells = dataRows[i].Split(cellSeparator, StringSplitOptions.None);
string mkey = dataCells[0];
string shipName = dataCells[1];
string shipCity = dataCells[2];
string shipAddress = dataCells[3];
string shipCountry = dataCells[4];
string orderDate = dataCells[5];
bool sent = dataCells[6] == "yes";
string insertUpdateQuery = "";
if (!string.IsNullOrEmpty(mkey))
{
insertUpdateQuery = "UPDATE B_Order_new SET ShipName = #ShipName, ShipCity = #ShipCity, ShipAddress = #ShipAddress, ShipCountry = #ShipCountry, OrderDate = #OrderDate, Sent = #Sent WHERE MKEY = #MKEY";
}
else
{
insertUpdateQuery = "INSERT INTO B_Order_new (ShipName, ShipCity, ShipAddress, ShipCountry, OrderDate, Sent) " +
"VALUES(#ShipName, #ShipCity, #ShipAddress, #ShipCountry, #OrderDate, #Sent)";
}
OracleCommand cmd = new OracleCommand(insertUpdateQuery, myConn);
var orderedOn = DateTime.ParseExact(orderDate, "dd/MM/yyyy", null);
cmd.Parameters.Add("#ShipName", OracleType.VarChar).Value = shipName;
cmd.Parameters.Add("#ShipCity", OracleType.VarChar).Value = shipCity;
cmd.Parameters.Add("#ShipAddress", OracleType.VarChar).Value = shipAddress;
cmd.Parameters.Add("#ShipCountry", OracleType.VarChar).Value = shipCountry;
cmd.Parameters.Add("#OrderDate", OracleType.DateTime).Value = orderedOn;
cmd.Parameters.Add("#Sent", OracleType.Char).Value = true;
if (!string.IsNullOrEmpty(mkey))
{
cmd.Parameters.Add("#MKEY", OracleType.Number).Value = mkey;
}
cmd.ExecuteNonQuery();
if (insertUpdateQuery != "")
{
Page.ClientScript.RegisterStartupScript(typeof(Page), "CloseScript", "alert('Data Updated succesfully');", true);
}
}
if (!string.IsNullOrEmpty(excelDeletedIds))
{
OracleCommand deleteComm = new OracleCommand("DELETE FROM Orders WHERE OrderID IN (" + excelDeletedIds + ")", myConn);
deleteComm.ExecuteNonQuery();
}
myConn.Close();
Grid1.DataBind();
}
The problem is that you are using the wrong bind variable syntax (looks like you're using SQL Server parameter binding syntax). Oracle's ADO.NET provider expects you to use a : prefix rather than a #.
So try something like this instead:
insertUpdateQuery = "UPDATE B_Order_new SET ShipName = :ShipName, ShipCity = :ShipCity, ...
And then when setting the values, you don't need to prefix it:
cmd.Parameters.Add("ShipName", OracleType.VarChar).Value = shipName;
cmd.Parameters.Add("ShipCity", OracleType.VarChar).Value = shipCity;
...
EDIT
Also, if you are binding the parameters by name, make sure you set the OracleCommand.BindByName property to true. Otherwise, the binding will be done positionally.
I am using ASP.Net C# with SQL Server 2012
My C# Code :
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Configuration;
using System.Data;
using System.Data.SqlClient;
public partial class autorefresh_create_emi : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
SqlConnection con = new SqlConnection(ConfigurationManager.ConnectionStrings["paconn"].ToString());
con.Open();
SqlCommand com1 = new SqlCommand("select max(f_casenum) from c_detail", con);
string check_max = com1.ExecuteScalar().ToString();
if (check_max == "0")
{
}
else
{
string st_id = "";
Int64 st = 0;
string max_id = "";
Int64 en = 0;
SqlCommand com2 = new SqlCommand("select top 1(f_casenum) from c_emi where f_casenum not in (select top 1 (f_casenum) from c_detail order by f_casenum) order by f_casenum", con);
com2.CommandTimeout = 0;
st_id = com2.ExecuteScalar().ToString();
st_id = st_id.Substring(2);
st = Convert.ToInt64(st_id);
max_id = check_max;
max_id = max_id.Substring(2);
en = Convert.ToInt64(max_id);
for (Int64 i = st; i <= en; i++)
{
string f_casenum = "PA" + i;
string c_status = "";
string f_tenure = "";
SqlCommand com3 = new SqlCommand("select * from c_detail where f_casenum=#f_casenum", con);
com3.CommandTimeout = 0;
com3.Parameters.AddWithValue("#f_casenum", f_casenum);
SqlDataReader reader3 = com3.ExecuteReader();
if (reader3.Read())
{
f_tenure = reader3["f_tenure"].ToString().Trim();
c_status = reader3["c_status"].ToString();
}
reader3.Close();
if (c_status == "Full Paid")
{
}
else
{
string row_check = "";
SqlCommand com4 = new SqlCommand("select count(f_invoice) from c_emi where f_casenum=#f_casenum", con);
com4.CommandTimeout = 0;
com4.Parameters.AddWithValue("#f_casenum", f_casenum);
row_check = com4.ExecuteScalar().ToString().Trim();
if (f_tenure.Equals(row_check))
{
}
else
{
string st_id_invoice = "";
Int64 st_invoice = 0;
string max_id_invoice = "";
Int64 en_invoice = 0;
SqlCommand com5 = new SqlCommand("select min(f_invoice) from c_emi where f_casenum=#f_casenum", con);
com5.CommandTimeout = 0;
com5.Parameters.AddWithValue("#f_casenum", f_casenum);
st_id_invoice = com5.ExecuteScalar().ToString();
st_id_invoice = st_id_invoice.Substring(3);
st_invoice = Convert.ToInt64(st_id_invoice);
SqlCommand com6 = new SqlCommand("select max(f_invoice) from c_emi where f_casenum=#f_casenum", con);
com6.CommandTimeout = 0;
com6.Parameters.AddWithValue("#f_casenum", f_casenum);
max_id_invoice = com6.ExecuteScalar().ToString();
max_id_invoice = max_id_invoice.Substring(3);
en_invoice = Convert.ToInt64(max_id_invoice);
for (Int64 j = st_invoice; j <= en_invoice; j++)
{
string invoice_date = "";
string f_emi_due = "";
string f_total_emi = "";
string f_emi = "";
string f_b_curr = "";
string f_invoice = "PAI" + j;
string f_casenum1 = "";
SqlCommand com7 = new SqlCommand("select * from c_emi where f_invoice=#f_invoice", con);
com7.CommandTimeout = 0;
com7.Parameters.AddWithValue("#f_invoice", f_invoice);
SqlDataReader reader7 = com7.ExecuteReader();
if (reader7.Read())
{
f_casenum1 = reader7["f_casenum"].ToString();
f_emi = reader7["f_emi"].ToString();
f_emi_due = reader7["f_emi_due"].ToString();
f_total_emi = reader7["f_total_emi"].ToString();
f_b_curr = reader7["f_b_curr"].ToString();
invoice_date = reader7["invoice_date"].ToString();
}
reader7.Close();
if (f_casenum == f_casenum1)
{
DateTime currr = DateTime.Now;
DateTime INDIAN_ZONE = TimeZoneInfo.ConvertTimeBySystemTimeZoneId(currr, "India Standard Time");
DateTime curr = INDIAN_ZONE;
string curr_invoicedate = curr.ToShortDateString();
DateTime check_invoicedate = Convert.ToDateTime(invoice_date);
check_invoicedate = check_invoicedate.AddDays(30);
check_invoicedate = Convert.ToDateTime(check_invoicedate);
string exit_date = check_invoicedate.ToShortDateString();
string f_emi_duedate = check_invoicedate.AddDays(10).ToShortDateString();
string invoice_date1 = check_invoicedate.ToShortDateString();
SqlCommand com8 = new SqlCommand("select f_casenum from c_emi where f_casenum=#f_casenum and CONVERT(date,invoice_date,101)=#invoice_date", con);
com8.CommandTimeout = 0;
com8.Parameters.AddWithValue("#f_casenum", f_casenum);
com8.Parameters.AddWithValue("#invoice_date", exit_date);
string check_exitdate = "";
SqlDataReader reader8 = com8.ExecuteReader();
if (reader8.Read())
{
check_exitdate = reader8["f_casenum"].ToString();
}
else
{
}
if (check_exitdate != "")
{
}
else
{
if (curr >= check_invoicedate)
{
string value = "0";
string owner = "";
string i_status = "Unlock";
SqlCommand com9 = new SqlCommand("select MAX(f_invoice) from c_emi", con);
com9.CommandTimeout = 0;
string maxid1 = com9.ExecuteScalar().ToString();
string id1 = maxid1;
Int64 code = 100000000001;
string c = "PAI";
if (id1.Substring(0, 1) != "P")
{
id1 = code.ToString();
id1 = c + id1.ToString();
}
else
{
id1 = id1.Substring(3);
Int64 a = Convert.ToInt64(id1);
a = a + 1;
id1 = c + a.ToString();
}
id1 = id1.ToString();
SqlCommand com11 = new SqlCommand("insert into c_emi values(#f_casenum,#f_b_amt,#f_emi,#f_emi_duedate,#f_invoice,#invoice_date,#f_overdue_amt,#f_emi_paid,#f_emi_due,#f_total_emi,#f_b_curr,#i_status,#owner,#convi_charges,#paidemi_date)", con);
com11.CommandTimeout = 0;
SqlParameter obj1 = new SqlParameter("#f_casenum", DbType.StringFixedLength);
obj1.Value = f_casenum;
com11.Parameters.Add(obj1);
SqlParameter obj2 = new SqlParameter("#f_overdue_amt", DbType.StringFixedLength);
obj2.Value = value;
com11.Parameters.Add(obj2);
SqlParameter obj3 = new SqlParameter("#f_emi_paid", DbType.StringFixedLength);
obj3.Value = value;
com11.Parameters.Add(obj3);
SqlParameter obj4 = new SqlParameter("#f_emi_due", DbType.StringFixedLength);
obj4.Value = value;
com11.Parameters.Add(obj4);
SqlParameter obj5 = new SqlParameter("#f_total_emi", DbType.StringFixedLength);
obj5.Value = f_emi;
com11.Parameters.Add(obj5);
SqlParameter obj6 = new SqlParameter("#f_emi", DbType.StringFixedLength);
obj6.Value = f_emi;
com11.Parameters.Add(obj6);
SqlParameter obj7 = new SqlParameter("#f_emi_duedate", DbType.StringFixedLength);
obj7.Value = f_emi_duedate;
com11.Parameters.Add(obj7);
SqlParameter obj8 = new SqlParameter("#f_invoice", DbType.StringFixedLength);
obj8.Value = id1;
com11.Parameters.Add(obj8);
SqlParameter obj9 = new SqlParameter("#invoice_date", DbType.StringFixedLength);
obj9.Value = invoice_date1;
com11.Parameters.Add(obj9);
SqlParameter obj10 = new SqlParameter("#f_b_amt", DbType.StringFixedLength);
obj10.Value = f_b_curr;
com11.Parameters.Add(obj10);
SqlParameter obj11 = new SqlParameter("#f_b_curr", DbType.StringFixedLength);
obj11.Value = f_b_curr;
com11.Parameters.Add(obj11);
SqlParameter obj12 = new SqlParameter("#i_status", DbType.StringFixedLength);
obj12.Value = i_status;
com11.Parameters.Add(obj12);
SqlParameter obj13 = new SqlParameter("#owner", DbType.StringFixedLength);
obj13.Value = owner;
com11.Parameters.Add(obj13);
SqlParameter obj14 = new SqlParameter("#convi_charges", DbType.StringFixedLength);
obj14.Value = value;
com11.Parameters.Add(obj14);
SqlParameter obj15 = new SqlParameter("#paidemi_date", DbType.StringFixedLength);
obj15.Value = owner;
com11.Parameters.Add(obj15);
com11.ExecuteNonQuery();
}
else
{
}
}
}
else
{
}
}
}
}
}
}
con.Close();
}
}
I have large database and my query is inserted many number of record on table when i run the web page
I recieve the following Error :
System.Data.SqlClient.SqlException: A transport-level error has
occurred when receiving results from the server. (provider: Session
Provider, error: 19 - Physical connection is not usable)
on the following Code
Line 111: com7.Parameters.AddWithValue("#f_invoice", f_invoice);
Line 112:
Line 113: SqlDataReader reader7 = com7.ExecuteReader();
Line 114: if (reader7.Read())
Line 115: {
My ErrorLog file says :
2015-01-13 11:27:23.96 Logon Error: 18456, Severity: 14, State:
8.
2015-01-13 11:27:23.96 Logon Login failed for user 'sa'.
Reason: Password did not match that for the login provided. [CLIENT:
108.171.243.19]
So what's the issue..??
Although everything is correct, but data selection process is very slow in my Application, while retriving data from access .mdb file. Is there any idea that data can be accessed fast. Is there any mechanism??
This below code Runs when Button Clicked .
public class GetData {
OleDbConnection con = new OleDbConnection(DatabseConnection.ConnectionStringAccessDatabase);
public string lblPolicyNumber, lblInsuredName, lblIssuedDatePolicy, lblStatusPolicy,
lblModalPremium, lblDueDate, lblNextDueDate, lblAgentCode,
lblMode, lblType1, lblAmount1, lblDate1, lblPremAmt1,
lblDueDate1, lbPaidDate1, lblPremAmt2, lblDueDate2,
lblPaidDate2, lblPremAmt3, lbDueDate3, lblPadiDate3,
lblOwnersName, lblOwnersCode, lblAddress1, lblAddress2,
lblPlan, lblCoverageAmt, lblSex, lblBirthDate, lblAge,
lblAutomaticPrmloan, lblAPLCount, lblLoanType, lblLoanPrincipleamt,
lblLoanDate, lblRatedNotRated, lblUnderWritingApproved , LateFee,
TotalAmountDue, AmountInDeposit, NetPayableAmount, Overdueprem,
CurrentPremiumDue, lblPMFlastUpdated = null;
public void getData(string policyNumber)
{
try
{
con.Open();
}
catch { MessageBox.Show("Please Download the File From the Server, Or Contact IT Department"); }
OleDbCommand cmd = con.CreateCommand();
cmd.CommandText = "(Select capolnum, cainame, iss_dte, castatus, mod_prm, due_dte1, nxt_due, agent_code, cabmode, casustyp1, casusamt1, casusdate1, chbldpm1, pd_dte1, chbldpm2, due_dte2, pd_dte2, chbldpm3, due_dte3, pd_dte3 , caoname, ocode, Addr1, addr2, plan, cbcovamt, cbsex, birth_dte, cbissage, apl, as400_cl_aplcnt, as400_cl_lntype, as400_cl_lnprinc, apl_date, cstype, approved FROM agy_pmf where capolnum ='" + policyNumber + "' )";
OleDbDataReader dr = cmd.ExecuteReader();
while (dr.Read())
{
SetData.lblPolicyNumber = lblPolicyNumber = dr.GetValue(0).ToString();
SetData.lblInsuredName = lblInsuredName = dr.GetValue(1).ToString();
lblIssuedDatePolicy = dr.GetValue(2).ToString();
lblStatusPolicy = dr.GetValue(3).ToString();
lblModalPremium = dr.GetValue(4).ToString();
lblDueDate = dr.GetValue(6).ToString();
lblNextDueDate = dr.GetValue(6).ToString();
lblAgentCode = dr.GetValue(7).ToString();
SetData.lblMode = lblMode = dr.GetValue(8).ToString();
lblType1 = dr.GetValue(9).ToString();
lblAmount1 = dr.GetValue(10).ToString();
lblDate1 = dr.GetValue(11).ToString();
lblPremAmt1 = dr.GetValue(12).ToString();
lblDueDate1 = dr.GetValue(5).ToString();
lbPaidDate1 = dr.GetValue(13).ToString();
lblPremAmt2 = dr.GetValue(14).ToString();
lblDueDate2 = dr.GetValue(15).ToString();
lblPaidDate2 = dr.GetValue(16).ToString();
lblPremAmt3 = dr.GetValue(17).ToString();
lbDueDate3 = dr.GetValue(18).ToString();
lblPadiDate3 = dr.GetValue(19).ToString();
lblOwnersName = dr.GetValue(20).ToString();
lblOwnersCode = dr.GetValue(21).ToString();
lblAddress1 = dr.GetValue(22).ToString();
lblAddress2 = dr.GetValue(23).ToString();
lblPlan = dr.GetValue(24).ToString();
lblCoverageAmt = dr.GetValue(25).ToString();
lblSex = dr.GetValue(26).ToString();
lblBirthDate = dr.GetValue(27).ToString();
lblAge = dr.GetValue(28).ToString();
lblAutomaticPrmloan = dr.GetValue(29).ToString();
lblAPLCount = dr.GetValue(30).ToString();
lblLoanType = dr.GetValue(31).ToString();
lblLoanPrincipleamt = dr.GetValue(32).ToString();
lblLoanDate = dr.GetValue(33).ToString();
lblRatedNotRated = dr.GetValue(34).ToString();
lblUnderWritingApproved = dr.GetValue(35).ToString();
con.Close();
}
}}
Basically I am getting a saved hash (converted to base64) from an access database and comparing it (after converting it back) with another and should return true if they match, but for some reason it returns false. There is data in the database. I think the problem occurs when the hash is converted back from base64. Can anyone see what I am doing wrong?
private static bool MatchSHA(byte[] p1, byte[] p2)
{
bool result = false;
if (p1 != null && p2 != null)
{
if (p1.Length == p2.Length)
{
result = true;
for (int i = 0; i < p1.Length; i++)
{
if (p1[i] != p2[i])
{
result = false;
break;
}
}
}
}
return result;
}
private static byte[] GetSHA(string userID, string password)
{
SHA256CryptoServiceProvider sha = new SHA256CryptoServiceProvider();
return sha.ComputeHash(System.Text.Encoding.ASCII.GetBytes(userID + password));
}
public void RunTest()
{
string userId = "test";
string password = "Password";
string enteredPassword = "Password";
var hashedPassword = GetSHA(userId, password);
string encodedPassword = Convert.ToBase64String(hashedPassword);
try
{
string connString = (#"Provider=Microsoft.ACE.OLEDB.12.0; Data Source=|DataDirectory|Password.accdb");
OleDbConnection conn = new OleDbConnection(connString);
conn.Open();
OleDbCommand cmd = conn.CreateCommand();
cmd.CommandText = #"SELECT * FROM [Users] WHERE [UserId] = #UserId";
cmd.Parameters.AddWithValue("#UserId", userId);
OleDbDataReader dbReader = cmd.ExecuteReader();
while (dbReader.Read())
{
var compareHash = Convert.FromBase64String(dbReader["Password"].ToString());
errorLabel.Text = "Hash from DB: " + dbReader["Password"].ToString();
if (MatchSHA(compareHash, GetSHA(userId, enteredPassword)))
{
loginLabel.Text = "EnteredPassword. True";
}
else
{
loginLabel.Text = "EnteredPassword. False";
}
}
conn.Close();
}
catch (OleDbException obe)
{
errorLabel.Text = obe.ToString();
}
}
try
{
int val4 = Convert.ToInt32(tbGrupa.Text);
string MyConString = "Data Source=**;User ID=******;Password=*****";
OracleConnection conexiune = new OracleConnection(MyConString);
OracleCommand comanda = new OracleCommand();
comanda.Connection = conexiune;
conexiune.Open();
comanda.Transaction = conexiune.BeginTransaction();
int id_stud = Convert.ToInt16(tbCodStud.Text);
string nume = tbNume.Text;
string prenume = tbPrenume.Text;
string initiala_tatalui = tbInitiala.Text;
string email = tbEmail.Text;
string facultate = tbFac.Text;
int grupa = Convert.ToInt16(tbGrupa.Text);
string serie = tbSeria.Text;
string forma_de_inv = tbFormaInvatamant.Text;
DateTime data_acceptare_coordonare = dateTimePicker1.Value;
DateTime data_sustinere_licenta = dateTimePicker2.Value;
string sustinere = tbSustinereLicenta.Text;
string parola_acces = tbParola.Text;
try
{
comanda.Parameters.AddWithValue("id_stud", id_stud);
comanda.Parameters.AddWithValue("nume", nume);
comanda.Parameters.AddWithValue("prenume", prenume);
comanda.Parameters.AddWithValue("initiala_tatalui", initiala_tatalui);
comanda.Parameters.AddWithValue("facultate", facultate);
comanda.Parameters.AddWithValue("email", email);
comanda.Parameters.AddWithValue("seria", serie);
comanda.Parameters.AddWithValue("grupa", grupa);
comanda.Parameters.AddWithValue("forma_de_inv", forma_de_inv);
comanda.Parameters.AddWithValue("data_acceptare_coordonare", data_acceptare_coordonare);
comanda.Parameters.AddWithValue("data_sustinere_licenta", data_sustinere_licenta);
comanda.Parameters.AddWithValue("sustinere_licenta", sustinere);
comanda.Parameters.AddWithValue("parola_acces", parola_acces);
comanda.Transaction.Commit();
MessageBox.Show("Studentul " + tbNume.Text + " " + tbPrenume.Text + " a fost adăugat în baza de date!");
}
catch (Exception er)
{
comanda.Transaction.Rollback();
MessageBox.Show("ER1.1:" + er.Message);
MessageBox.Show("ER1.2:" + er.StackTrace);
}
finally
{
conexiune.Close();
}
}
catch (Exception ex)
{
MessageBox.Show("ER2.1:"+ex.Message);
MessageBox.Show("ER2.2:"+ex.StackTrace);
}
There doesn't seem to be an insert statement. I think this is what the problem is. You would need some thing like:
using (OracleConnection connection = new OracleConnection(connectionString))
{
OracleCommand command = new OracleCommand(myExecuteQuery, connection);
command.Connection.Open();
command.ExecuteNonQuery();
}
There's a commit statement, what what are you going to commit if there's no insert statement prior to that?