error while adding values into database
i m getting error while adding values into the database,
Know the answer? Post it — somebody with the same question will find it here.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.
vidhyaPosted Jul 30, 2013, 6:03 AM
vidhyaPosted Jul 30, 2013, 5:51 AM
Posted Jul 30, 2013, 5:30 AM
Iftikar HussainPosted Jul 30, 2013, 5:29 AM
Regards,
Iftikar
vidhyaPosted Jul 30, 2013, 5:28 AM
Is this dispalying correctly according to the query
Posted Jul 30, 2013, 5:20 AM
Iftikar HussainPosted Jul 30, 2013, 5:17 AM
Regards,
Iftikar
vidhyaPosted Jul 30, 2013, 5:15 AM
vidhyaPosted Jul 30, 2013, 5:14 AM
I get error:
Cannot find the object "dbo.TestQuestion_TestQuestionShort" because it does not exist or you do not have permissions.
Posted Jul 30, 2013, 5:10 AM
Posted Jul 30, 2013, 5:09 AM
Please let me know, if you not clear.
vidhyaPosted Jul 30, 2013, 5:08 AM
I cant inherit testquestionblank. i can inherit testquestion.
inheritance is missing in the datamodel for testquestionshort. How can i inherit it.
Posted Jul 30, 2013, 5:07 AM
vidhyaPosted Jul 30, 2013, 5:04 AM
You did not understand what i am telling.
Same code work for testquestionblank. but not working testquestionshort .
If u observe clearly means u can identify the sql query format is same but name changed in short instead of blank. but i get different diagram in datamodel why?
Iftikar HussainPosted Jul 30, 2013, 5:01 AM
Regards,
Iftikar
Posted Jul 30, 2013, 4:57 AM
If you want to try, just inherit TestQuestionBlank from TestQuestionShort otherwise create a new one.
vidhyaPosted Jul 30, 2013, 4:54 AM
i replied before itself.
if i changed datamodel like testquestionblank, error will be resolved.
Posted Jul 30, 2013, 4:42 AM
TestQuestionBlank is inherited from TestQuestion that why the model has --> TestQuestion in the diagram. Because of the inheritance, the image or the model looks different but should be able to access all the properties from TestQuestion to TestQuestionBlank.
Properties Section:
All the properties of TestQuestion will be inherited to TestQuestionBlank. Parent class is TestQuestion and Child class TestQuestionBlank.
If you add properties to TestQuestionBlank that will not be available to TestQuestion.
Navigation Properties:
Navigation properties is used to navigate to parent collection by using navigation properites.
If you look at TestQuestionShort it has the navigation properties for TestQuestion. Based on the TestQuestionId you should be able to fetch all the TestQuestion.
Please let me know, if you're not clear.
Iftikar HussainPosted Jul 30, 2013, 4:34 AM
I need to display the TestQuestionShort data model like TestQuestionBlank
what exactly you want
Regards,
Iftikar
vidhyaPosted Jul 30, 2013, 4:28 AM
Iftikar HussainPosted Jul 30, 2013, 4:18 AM
Regards,
Iftikar
vidhyaPosted Jul 30, 2013, 3:27 AM
Iftikar HussainPosted Jul 30, 2013, 2:48 AM
Regards,
Iftikar
vidhyaPosted Jul 30, 2013, 2:20 AM
If i get the solution for this problem, i can resolve the error.
vidhyaPosted Jul 30, 2013, 1:32 AM
Iftikar HussainPosted Jul 30, 2013, 12:59 AM
Regards,
Iftikar
vidhyaPosted Jul 30, 2013, 12:54 AM
{
}
It Represents a view model for a Short answer question.
Iftikar HussainPosted Jul 30, 2013, 12:48 AM
Regards,
Iftikar
vidhyaPosted Jul 30, 2013, 12:39 AM
I created the table TestQuestionShort from TestQuestionBlank by changingshort instead of blank. thats it, but i get different diagram in datamodel.
vidhyaPosted Jul 30, 2013, 12:08 AM
I have already posted the code. please refer the above or specify the line.
If i use this also
TestQuestion foo = new TestQuestion { TestId = Guid.NewGuid() };
I am getting the error.
Object reference not set to an instance of an object.
vidhyaPosted Jul 29, 2013, 11:31 PM
Iftikar HussainPosted Jul 29, 2013, 8:30 AM
Regards,
Iftikar
Posted Jul 29, 2013, 8:13 AM
vidhyaPosted Jul 29, 2013, 7:55 AM
Posted Jul 29, 2013, 7:39 AM
Posted Jul 29, 2013, 7:38 AM
Iftikar HussainPosted Jul 29, 2013, 7:37 AM
TestQuestion foo = new TestQuestion { TestId = Guid.NewGuid() };
Regards,
Iftikar
vidhyaPosted Jul 29, 2013, 7:34 AM
vidhyaPosted Jul 29, 2013, 7:33 AM
"Object reference not set to an instance of an object."
Line 450: TestQuestionShortAnswer v = new TestQuestionShortAnswer { TestQuestionId = foo.TestQuestionId, TestQuestionShortAnswerId = Guid.NewGuid(), Answer = x.Answer }; Line 451: Line 452: _testQuestionshorterRepo.AddShortAnswer(v);vidhyaPosted Jul 29, 2013, 7:27 AM
Iftikar HussainPosted Jul 29, 2013, 7:26 AM
Try like this
Regards,
Iftikar
Posted Jul 29, 2013, 7:25 AM
vidhyaPosted Jul 29, 2013, 7:19 AM
Is this correct r i need to change any?
Posted Jul 29, 2013, 7:05 AM
Please check it out once.
TestQuestionShort foo = new TestQuestionShort { TestQuestionId = Guid.NewGuid() };
_testQuestionRepo.AddQuestion(foo);
vidhyaPosted Jul 29, 2013, 6:58 AM
vidhyaPosted Jul 29, 2013, 6:55 AM
public void AddQuestion(TestQuestion testToSave)
SERVICE
Posted Jul 29, 2013, 6:49 AM