Store results to DB and Store Date/time

Mar 10, 2009 at 10:55 PM
Has anyone successfully stored results to a SQL DB file?
Also, how about storing the date/time of the survey as it was taken?

I am not versed in cs, only some VB. If anyone has done and would be willing to share, it would be greatly appreciated!


Feb 5, 2013 at 12:08 PM
I expect this answer comes a bit late for the original poster but for reference...

We're using this control to save survey results to SQL Server after customising it to add the necessary hooks - the files and some notes can be found as Patch 13791 in the Source Code area.

We are automatically date-stamping the rows as we add them to the database using a datetime column with a GETDATE() default value. This is a convention followed by most tables in our application's database.

Also we are recording the date of completion within the set of questions and answers as follows.

In the survey specification XML file, add a "hidden" question:
<Question id="QuestionnaireCompleted" type="hidden"></Question>
In the codebehind file (*.aspx.vb) , where "ws" is a reference to the WebSurvey control on the page:
Private Sub ws_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles ws.Load
        Dim hwqtimestamp As HiddenWebQuestion = ws.Questions("QuestionnaireCompleted")
        hwqtimestamp.SetAnswer(DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"))
    End Sub
  • Carol