int CId = 0; private void button1_Click(object sender, EventArgs e) { try { if (textBox1.Text == "" || textBox2.Text == "" || comboBox1.SelectedIndex == -1 || textBox3.Text == "")what error is found is this code

Muhammad Adeel 20 Reputation points
2023-12-17T08:11:33.3833333+00:00

I have an error of (object reference not set to an instance of an object).

Windows for business | Windows Client for IT Pros | User experience | Other
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Anonymous
    2023-12-18T07:02:02.9666667+00:00

    Hi,

    The error message means one of the objects you are using is null. You need to make sure the objects are instantiated before you use them.

    Best Regards,

    Ian Xue


    If the Answer is helpful, please click "Accept Answer" and upvote it.

    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.