Hi,
I need to access the contents from a drop down list on an .aspx page in a 'helper class' that I'm using for communicating with a SQL 2000 DB.
Here's the code from that class:
Code:
Imports System.Data.SqlClient
Public Class DataAccess
Dim nurseConnection As New SqlConnection(ConfigurationSettings.AppSettings("ConnectionString"))
Public Function QuestionsDataSet() As DataSet
Try
Dim strSqlStatement As String = "SELECT Question FROM Questions WHERE ModuleID='" & & "'"
Dim cmdQuestions As New SqlCommand(strSqlStatement, nurseConnection)
cmdQuestions.CommandType = CommandType.Text
Dim dsAQ As New DataSet
Dim daAQ As New SqlDataAdapter(cmdQuestions)
'Fill the DataSet using the DataAdapter
daAQ.Fill(dsAQ)
Return dsAQ
Catch ex As Exception
ex.ToString()
End Try
End Function
End Class
So, I'd like to insert the value of the DDL between the two ampersands in the SQL statement so that it can be dynamically changed.
Thanks in advance for any help!
Jens