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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 20, 20262026-05-20T08:39:21+00:00 2026-05-20T08:39:21+00:00

Additional information: Object reference not set to an instance of an object. I have

  • 0

Additional information: Object reference not set to an instance of an object.

I have this code

DotTeachDataSet ds;
DotTeachDataSetTableAdapters.QuestionsTableAdapter ta;

private void button1_Click(object sender, RoutedEventArgs e)
{                                         
    ta.CreateQuestion(discussionQuestion.Text, webPage.Text, choiceA.Text, choiceB.Text, choiceC.Text, choiceD.Text, hint.Text, rightAnswerCbox.Uid);
    ta.Fill(ds.Questions);
}

That Im using to try to get the values from text boxes in a xaml and send them to a data base but I keep getting the error:

An unhandled exception of type
‘System.NullReferenceException’
occurred in DotTeach.exe

Additional information: Object
reference not set to an instance of an
object.

and visual studio highlights the line

ta.CreateQuestion(discussionQuestion.Text, webPage.Text, choiceA.Text, choiceB.Text, choiceC.Text, choiceD.Text, hint.Text, rightAnswerCbox.Uid);

Does anyone have any ideas what i could try?

I got rid of the error message but it’s still not doing what I need it to do. I’m trying to get it to add data to a database when the button is clicked. Heres the function I’m using thats not working

private void button1_Click(object sender, RoutedEventArgs e)
    {
        DotTeach.DotTeachDataSet dotTeachDataSet = ((DotTeach.DotTeachDataSet)(this.FindResource("dotTeachDataSet")));
        DotTeach.DotTeachDataSetTableAdapters.QuestionsTableAdapter dotTeachDataSetQuestionsTableAdapter = new DotTeach.DotTeachDataSetTableAdapters.QuestionsTableAdapter();


        //ADD THE QUESTION TO THE DATA BASE
        dotTeachDataSetQuestionsTableAdapter.CreateQuestion(discussionQuestion.Text, webPage.Text, choiceA.Text, choiceB.Text, choiceC.Text, choiceD.Text, hint.Text, rightAnswer.Text);
    }

I’m not even sure what else to try.

  • 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-20T08:39:22+00:00Added an answer on May 20, 2026 at 8:39 am

    Well, to get a NullReferenceException, one of the following is null:

    • ta
    • discussionQuestion
    • webPage
    • choiceA
    • choiceB
    • choiceC
    • choiceD
    • hint
    • rightAnswerCbox

    My guess would be ta, but you should be able to find that out either with logging or in the debugger. What’s meant to be assigning a non-null value to ta?

    Is this always failing (in which case it’ll be easy to diagnose) or only sometimes?

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

Sidebar

Related Questions

I have this object: foreach(range(1,$oc->num_users) as $num) { $user = 'user' . $num; $$user
I need to display additional information, like a tooltip, but it's a lot of
how do I pass additional information to the service method returning the collection of
Given a credit card number and no additional information, what is the best way
I'm storing some additional per-user information using the AUTH_PROFILE_MODULE . We can access the
Is there some additional configuration needed before I can set thread priorities in a
I have a question regarding the two additional columns (timeCreated, timeLastUpdated) for each record
I've got the following situation, Private Sub MyButton_Click(sender as Object, args as EventArgs) Handles
Summary: How do I configure my facebook application to request additional information from the
When speaking about attribute lists I mean a generic list which stores additional information

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.