Hello all,
I've been running into the above exception and can't seem to get past it. In thread796-1043354 a similar issue came up but I'm still crapping out...
Here's my code:
Private Sub btnSubmit_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnSubmit.Click
'Declare the data access layer
Dim dataAccess As New DAL_PICUQuestionnaire.DBAccess
dataAccess.AddRecord('a bunch of drop down lists and textboxes... this is where the exception occurs)
End Sub
The DAL_PICUQuestionnaire class is as follows:
Imports System.Web.UI.WebControls
Imports System.Data
Imports System.Data.SqlClient
Imports System.Web.Security
Public Class DBAccess
'Declare the connection to the database
Protected con As New SqlConnection(System.Configuration.ConfigurationSettings.AppSettings("connection"))
Public Sub AddRecord('info from the ddl and text boxes put in here)
'Open data connection
con.Open()
'The following falls within a Try... Catch structure to handle any errors that might arise.
Try
'Declare the SQL Server command then identify it as a stored procedure type
Dim cmdAddRecord As New SqlCommand("PICU_AddRecord", con)
cmdAddRecord.CommandType = CommandType.StoredProcedure
' yadda yadda yadda
End Sub
End Class
So... any ideas about what I'm doing wrong? Thanks in advance for any help!
snejsnej
I've been running into the above exception and can't seem to get past it. In thread796-1043354 a similar issue came up but I'm still crapping out...
Here's my code:
Private Sub btnSubmit_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnSubmit.Click
'Declare the data access layer
Dim dataAccess As New DAL_PICUQuestionnaire.DBAccess
dataAccess.AddRecord('a bunch of drop down lists and textboxes... this is where the exception occurs)
End Sub
The DAL_PICUQuestionnaire class is as follows:
Imports System.Web.UI.WebControls
Imports System.Data
Imports System.Data.SqlClient
Imports System.Web.Security
Public Class DBAccess
'Declare the connection to the database
Protected con As New SqlConnection(System.Configuration.ConfigurationSettings.AppSettings("connection"))
Public Sub AddRecord('info from the ddl and text boxes put in here)
'Open data connection
con.Open()
'The following falls within a Try... Catch structure to handle any errors that might arise.
Try
'Declare the SQL Server command then identify it as a stored procedure type
Dim cmdAddRecord As New SqlCommand("PICU_AddRecord", con)
cmdAddRecord.CommandType = CommandType.StoredProcedure
' yadda yadda yadda
End Sub
End Class
So... any ideas about what I'm doing wrong? Thanks in advance for any help!
snejsnej