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

  • Home
  • SEARCH
  • 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 1110673
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 17, 20262026-05-17T02:25:50+00:00 2026-05-17T02:25:50+00:00

I have the following SQLCommand which should do an Update. The issue is, that

  • 0

I have the following SQLCommand which should do an Update. The issue is, that I get no errors but it still do not update the database?

        SqlConnection sqlconn2 = new SqlConnection(this.connectionString);
        sqlconn2.Open();

        string strCmd = "UPDATE dbo.mydata SET WEB_OBEZ1 = @OBEZ1, WEB_OBEZ2 = @OBEZ2, WEB_OBEZ3 = @OBEZ3 WHERE O_KURZ = @OKURZ";

        using (SqlCommand cmd2 = new SqlCommand(strCmd, sqlconn2))
        {
            cmd2.Parameters.Add("@OBEZ1", SqlDbType.NVarChar);
            cmd2.Parameters.Add("@OBEZ2", SqlDbType.NVarChar);
            cmd2.Parameters.Add("@OBEZ3", SqlDbType.NVarChar);
            cmd2.Parameters.Add("@OKURZ", SqlDbType.NVarChar);


            foreach (DataRow dr in dt.Rows)
            {
                // Felder holen
                string okuerzel = dr["O_KURZ"].ToString();
                string bezeichnung = dr["O_BEZ"].ToString();


                    string[] lines = CreateNewOrgBez(bezeichnung);

                    cmd2.Parameters["@OBEZ1"].Value = lines[0];
                    cmd2.Parameters["@OBEZ2"].Value = lines[1];
                    cmd2.Parameters["@OBEZ3"].Value = lines[2];
                    cmd2.Parameters["@OKURZ"].Value = okuerzel;
                    cmd2.ExecuteNonQuery();

            }
        }
        sqlconn2.Close();
  • 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-17T02:25:51+00:00Added an answer on May 17, 2026 at 2:25 am

    using transactions? then perhapse a commit is missing?

    hth

    Mario

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

Sidebar

Related Questions

I have the following code: Using cmd As SqlCommand = Connection.CreateCommand cmd.CommandText = UPDATE
I have the following C# code (not mine) which pulls an image out of
I have the following SQL command that I need to save as a csv
I have following div in a page (I can not modify). <div id=:0.control>Click me</div>
I have following script that executes all the .reg files in the current directory.
I have a form which goes to the following login script when it is
I have a working controller for another stored procedure in the database, but I
Hi all i have written the following transaction to insert data but when i
I have a list box on my WinForms application which populates with the following
I have the following sql command with an Inner join: SqlCommand cmd = new

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.