G
Guest
Greetings all,
Here's my situation:
Background: I have an application for that has company data and survey response data.
The survey questions, answers and responses are being stored in the database.
The answers can be either free form text or an answer stored in a table.
The Database schema:
Company |
-----------------------------------------------
CompanyID | Name | Address | email |
-----------------------------------------------
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
SurveyQuestions
-----------------------------------------------
QuestionID | Description
-----------------------------------------------
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
SurveyAnswers
----------------------------------------------------
AnswerID | Description | QuestionID (FK)
----------------------------------------------------
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
SurveyResponses
------------------------------------------------------------------------------
ResponseID | CompanyID (FK) | QuestionID (FK) | AnswerID (FK)
------------------------------------------------------------------------------
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
SurveyResponseText
------------------------------------------------------------------------------
ResponseTextID | ResponseID (FK) | ResponseText
------------------------------------------------------------------------------
My problem is with inserting...
I have a custom dataset object to hold the the company and survey response data, that consists of 3 datatables (company, surveyresponse, surveyresponsetext) with datarelations set up for the 3.
Question is how do I perform the insert with a stored procedure (sql 2000)? Can I simple call a Update() on the SqlDataAdpater? or Fill()?
the company datatable has a single datarow, response tables have multiple datarows.
sample data:
______________________________________________________
Companyid | Name | Address | eMai
----------------------------------------------------------------------------
2 | my enterprise | 1 test street | (e-mail address removed)
----------------------------------------------------------------------------
______________________________________________________
ResponseID | QuestionID | AnswerID | CompanyI
----------------------------------------------------------------------------
1 | 1 | 2 |
----------------------------------------------------------------------------
______________________________________________________
ResponseTextID | ResponseText | ResponseI
-----------------------------------------------------------------------------
1 | We sell lots of stuff. |
-----------------------------------------------------------------------------
Any help is greatly apprecitated.
Thanks,
Justin
Here's my situation:
Background: I have an application for that has company data and survey response data.
The survey questions, answers and responses are being stored in the database.
The answers can be either free form text or an answer stored in a table.
The Database schema:
Company |
-----------------------------------------------
CompanyID | Name | Address | email |
-----------------------------------------------
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
SurveyQuestions
-----------------------------------------------
QuestionID | Description
-----------------------------------------------
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
SurveyAnswers
----------------------------------------------------
AnswerID | Description | QuestionID (FK)
----------------------------------------------------
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
SurveyResponses
------------------------------------------------------------------------------
ResponseID | CompanyID (FK) | QuestionID (FK) | AnswerID (FK)
------------------------------------------------------------------------------
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
SurveyResponseText
------------------------------------------------------------------------------
ResponseTextID | ResponseID (FK) | ResponseText
------------------------------------------------------------------------------
My problem is with inserting...
I have a custom dataset object to hold the the company and survey response data, that consists of 3 datatables (company, surveyresponse, surveyresponsetext) with datarelations set up for the 3.
Question is how do I perform the insert with a stored procedure (sql 2000)? Can I simple call a Update() on the SqlDataAdpater? or Fill()?
the company datatable has a single datarow, response tables have multiple datarows.
sample data:
______________________________________________________
Companyid | Name | Address | eMai
----------------------------------------------------------------------------
2 | my enterprise | 1 test street | (e-mail address removed)
----------------------------------------------------------------------------
______________________________________________________
ResponseID | QuestionID | AnswerID | CompanyI
----------------------------------------------------------------------------
1 | 1 | 2 |
----------------------------------------------------------------------------
______________________________________________________
ResponseTextID | ResponseText | ResponseI
-----------------------------------------------------------------------------
1 | We sell lots of stuff. |
-----------------------------------------------------------------------------
Any help is greatly apprecitated.
Thanks,
Justin