Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 5976571
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T21:14:53+00:00 2026-05-22T21:14:53+00:00

i have cut and paste buttons while cutting i have one sql operation and

  • 0

i have cut and paste buttons while cutting i have one sql operation and while pasting one sql operation . how to use transation statement for this .

protected void btnCut_Click(object sender, EventArgs e)
{
        hidCutnode.Value = TreeView2.SelectedNode.Value;
        string sqlQuery = "update CUSTOMIZEDTREE set parentid='" + 0 + "' where nodeid='" + hidCutnode.Value + "'";
        string connectionString = "Data Source=(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP)(HOST=10.69.200.62)(PORT=1521)))(CONNECT_DATA=(SID=orcl)));User Id=apex_demo;Password=apex_demo;";
        OracleConnection con = new OracleConnection(connectionString);
        con.Open();
        tran = con.BeginTransaction();
        OracleCommand cmd = new OracleCommand(sqlQuery, con);
        cmd.Transaction = tran;
        cmd.ExecuteNonQuery();
        con.Close();
}

protected void btnPaste_Click(object sender, EventArgs e)
{
        hidPastenode.Value = TreeView2.SelectedNode.Value;
        try
        {
            string sqlQuery = "update CUSTOMIZEDTREE set parentid='" + hidPastenode.Value + "' where nodeid='" + hidCutnode.Value + "'";
            string connectionString = "Data Source=(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP)(HOST=10.69.200.62)(PORT=1521)))(CONNECT_DATA=(SID=orcl)));User Id=apex_demo;Password=apex_demo;";
            OracleConnection con = new OracleConnection(connectionString);
            con.Open();
            OracleCommand cmd = new OracleCommand(sqlQuery, con);
            tran = con.BeginTransaction();
           // cmd.Connection = con;
            cmd.Transaction = tran;
            cmd.ExecuteNonQuery();
            tran.Commit();

            con.Close();
            PopulateCustomTree();
        }
        catch (Exception ex)
        {
            tran.Rollback();
            ex.ToString();
        }
}
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-22T21:14:53+00:00Added an answer on May 22, 2026 at 9:14 pm

    Pass transaction object as function parameter to the second method and dont commit in method1. Use BeginTransaction in first method only.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have cut and paste this example from http://devguru.org/Technologies/xmldom/quickref/node_selectSingleNode.html and I can't get it
I want to paste something I have cut from my desktop into a file
I have some buttons in an UIView. My problem is, that they get cut
I am using this Cut & Paste Triple Combo script. . This does not
It seems like people who would never dare cut and paste code have no
I use symfony 1.4.11. And I have next: $this->widgetSchema['en']['content'] = new sfWidgetFormTextareaTinyMCE(array( 'width' =>
I have a cut and paste of George Michael's DVD track listing from Amazon
I have various HTML strings to cut to 100 characters (of the stripped content,
Cut a short story even shorter, Have a asp.net page with MaintainScrollPositionOnPostback=true in the
I have a toolbar developed under older versions of Windows that is largely cut

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.