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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T08:50:44+00:00 2026-06-03T08:50:44+00:00

It is a relevent question with this previous one. Bacasically I have two forms,

  • 0

It is a relevent question with this previous one.

Bacasically I have two forms, I want to jump to the second form from the first form.
The code for the first form.

public partial class Main : Form
{
    public Main()
    {
        InitializeComponent();
    }

    private void button1_Click(object sender, EventArgs e)
    {
        Edit_Metric Edit_Metric = new Edit_Metric();
        Edit_Metric.Show();
    }

}

The second form:

public partial class Edit_Metric : Form
{
    BindingSource bsource = new BindingSource();
    DataSet ds = new DataSet();
    private SqlDataAdapter da;
    public Edit_Metric()
    {
        InitializeComponent();
    }
    private string connString = ConfigurationManager.ConnectionStrings["QISConnectionString"].ConnectionString;

    private void Edit_Metric_Load(object sender, EventArgs e)
    {
        dgv.EditMode = DataGridViewEditMode.EditOnKeystroke;
        DataGridViewButtonColumn EditColumn = new DataGridViewButtonColumn();
        EditColumn.Text = "Edit";
        EditColumn.Name = "Edit";
        EditColumn.DataPropertyName = "Edit";
        EditColumn.DisplayIndex = 0;
        EditColumn.UseColumnTextForButtonValue = true;
        DataGridViewButtonColumn DelColumn = new DataGridViewButtonColumn();
        DelColumn.Text = "Delete";
        DelColumn.Name = "Delete";
        DelColumn.DataPropertyName = "Delete";
        DelColumn.DisplayIndex = 1;
        DelColumn.UseColumnTextForButtonValue = true;
        dgv.Columns.Add(EditColumn);
        dgv.Columns.Add(DelColumn);

        using (SqlConnection conn = new SqlConnection("connString"))
        {
            conn.Open();
            // data query, display data in a datagridview.
        }

My question is: when the code reached

         using (SqlConnection conn = new SqlConnection("connString"))

The next step code went to the first form immediately at

        Edit_Metric.Show();

It never goto the code in the second form

         conn.Open();

Thanks

  • 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-03T08:50:45+00:00Added an answer on June 3, 2026 at 8:50 am

    If it is not a typo, your are trying to open a connection using the string “connString” instead of the var connString from the above “QISConnectionString”

    I’m sure that you want to write

    using (SqlConnection conn = new SqlConnection(connString)) 
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I don't know if this is a dumb question but I have this two
This is a separate problem lingering from a previous question I asked here on
This one is related to my previous question on the performance of Arrays and
I asked this question earlier: mod_rewrite: match only if no previous rules have matched?
I have a similar question to my previous one ( Drupal 7 views filter
This is a followup to my previous question. Parsing file names from a character
This question is to piggy back off of a previous one I asked yesterday
HI, O.K, not technically a programming question but it's still relevent for this forum
EDIT: woah ... somehow i replaced this question with another one i was asking,
This is my second question about this topic, the original question can be found

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.