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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T23:52:53+00:00 2026-06-08T23:52:53+00:00

I have a class that inserts a TextBox value and a FileUpload image into

  • 0

I have a class that inserts a TextBox value and a FileUpload image into the SQL Server. I’m executing all the class in the Wizard1_FinishButtonClick event. I have 4 steps in Wizard. All the classes are getting executed and inserted other than InsertCert() class.
I executed same codes in a simple .aspx page and the values are inserting into the DB.

Where ‘m I going wrong? Following is the class and Wizard1_FinishButtonClick.

public void Insertcert()
        {
            String KKStech = @"Data Source=USER-PC\SQLEXPRESS;Initial Catalog=KKSTech;Integrated Security=True";
            SqlConnection conn = new SqlConnection(KKStech);
            String insertstring2 = @"insert into Cert(CertName, CertLogo)
                                       values(@CertName, @CertLogo)";
            SqlCommand cmd = new SqlCommand(insertstring2, conn);
            cmd.CommandText = insertstring2;
            cmd.CommandType = CommandType.Text;
            try
            {
                if (FileUpload1.HasFile)
                {
                    byte[] productImage = FileUpload1.FileBytes;
                    conn.Open();
                    cmd.Parameters.AddWithValue("@CertName", TextBox18.Text);
                    cmd.Parameters.Add("@CertLogo", SqlDbType.VarBinary).Value = productImage;
                    cmd.ExecuteNonQuery();

                }

            }

            catch (Exception ex)
            {
                throw ex;
            }

            finally
            {
                conn.Close();
            }

        }

This is the final class where all the classes are inserted.

 protected void Wizard1_FinishButtonClick(object sender, WizardNavigationEventArgs e)
        {

            InsertInfo();
            Insertcert();
            Insertaddress();
            Insertskills();

        }
  • 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-06-08T23:52:55+00:00Added an answer on June 8, 2026 at 11:52 pm

    Put the cursor on the “if (FileUpload1.HasFile)” line and hit F9; this will put a breakpoint on that line (you’ll see a red circle in the left hand margin). Now debug your program (F5). When the breakpoint is hit, hover the mouse over the “HasFile” and you should see a tool tip which gives the value. If the value is false, this explains why the insert is not happening.

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

Sidebar

Related Questions

I have some jquery that takes the value of a textbox, inserts it into
I have a class that inserts information into a MySQL database. I have the
I have a class that executes SQL statements (updates, inserts, and deletes) that are
I have class that represents users. Users are divided into two groups with different
I have a simple Java app that inserts records into a table A, linking
I have inserted xml into SQL Server 2005 through rich text field successfully, now
I have a problem with inserting a TextBox value into a SqlServer table. I
Say I have the following code that inserts users into MS Dynamics in a
I have a method that gets the value from text boxes and inserts them
I have one thread that inserts into the queueStream (not shown here) and FlowController

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.