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 907131
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T16:30:09+00:00 2026-05-15T16:30:09+00:00

I am inserting values in to Database from a Webform using ADO.NET, C#. DB

  • 0

I am inserting values in to Database from a Webform using ADO.NET, C#. DB I am using is Oracle Database. Values are not being inserted and the program gets struck at the cmd.ExecuteNonquery()

Here is my Code below, Please let me know If I am doing any mistake.. I am using some Static Methods will that be any problem ?..

public Boolean AddDivCo(Int32 UserNo,String ID, String Role, String DivName )
{
    Boolean ret = false;


    OracleCommand cmd = new OracleCommand();
    OracleConnection conn = new OracleConnection();
    int i = 0;

    try
    {
        conn.ConnectionString = ConfigurationManager.ConnectionStrings["Conn_RIS"].ConnectionString;
        conn.Open();

        cmd.Connection = conn;
        String mySQL = "INSERT INTO R4CAD_ADMIN (AdminUserNo, AdminID, AdminRole, AdminDivName)VALUES(:AdminUserNo,:AdminID,:AdminRole,:DivName)";

        OracleParameter p1 = new OracleParameter("AdminUserNo", OracleType.Number);
        p1.Value = UserNo;
        cmd.Parameters.Add(p1);

        OracleParameter p2 = new OracleParameter("AdminID", OracleType.VarChar);
        p2.Value = ID;
        cmd.Parameters.Add(p2);

        OracleParameter p3 = new OracleParameter("AdminRole", OracleType.VarChar);
        p3.Value = Role;
        cmd.Parameters.Add(p3);

        OracleParameter p4 = new OracleParameter("DivName", OracleType.VarChar);
        p4.Value = DivName;
        cmd.Parameters.Add(p4);

        cmd.CommandText = mySQL;

        i = cmd.ExecuteNonQuery();

        if (i != 0)
        {
            ret = true;
        }
        else
        {
            ret = false;
        }
    }
    catch (Exception err)
    {
        Console.WriteLine(err.Message.ToString());
    }
    finally
    {
        cmd.Dispose();
        //cmd = null;
        //conn = null;
        conn.Close();
    }
    return ret;
}
  • 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-15T16:30:10+00:00Added an answer on May 15, 2026 at 4:30 pm

    Is there a primary key defined on this table? If so, then my guess is that you have another session that already has inserted a record with this key, but has not yet terminated the transaction with a commit or rollback. I don’t see a commit as part of your code – I assume you’re doing that somewhere else?

    Execute your code above once more, and while it’s hung run the following query from another session:

    SELECT
          (SELECT username FROM v$session WHERE sid=a.sid) blocker,
           a.sid,
          ' is blocking ',
           (SELECT username FROM v$session WHERE sid=b.sid) blockee,
               b.sid
      FROM v$lock a JOIN v$lock b ON (a.id1 = b.id1 AND a.id2 = b.id2)
     WHERE a.block = 1
       AND b.request > 0;
    

    This should tell you if you’re being blocked by another session and what the SID is of that session.

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

Sidebar

Ask A Question

Stats

  • Questions 507k
  • Answers 507k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer Use a PendingIntent, whose Intent has bundled extras. This is… May 16, 2026 at 4:07 pm
  • Editorial Team
    Editorial Team added an answer Here's how the code looks in my application (simplified for… May 16, 2026 at 4:07 pm
  • Editorial Team
    Editorial Team added an answer To controllers, you can configure Routes to rescan the directory… May 16, 2026 at 4:07 pm

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

Related Questions

I have a program which fetches records from database (using Hibernate) and fills them
We are inserting values into a SQL Server 2005 database column of type NUMERIC(19,5)
I have a question about inserting values into an input field from my MYSQL
Background: I'm in the process of creating a web service using ASP.NET 2.0. This
Ok, so I need to populate a MS Access database table with results from
I'm using the following regex to strip out non-printing control characters from user input
I am using Enterprise block and not able to figure this out. I am
Am using following .net code to add objects to cache: public static void Add<T>(string
I have a PHP form that is inserting information into a database. It all
I need to localize an asp.net webapp with lots of pages. So far what

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.