Tuesday, May 09, 2006 11:21 AM
I am currently debugging my web app and get the error below.
A first chance exception of type 'System.Data.SqlClient.SqlException' occurred in system.data.dll
The problem is I am getting after the connection to the DB is set . It is trusted and looking at the correct sql Server.
on executing the funtion earlier on in the app with different stored Procs the DT is populated.
Private Sub RunSQL_DT(ByVal sqlCommand As String, ByVal sqlParameters As Hashtable, ByRef myDT As DataTable, ByVal myType As CommandType)
Dim myConn As New SqlConnection(_connectionString)
Dim mySqlCommand As New SqlCommand
Dim mySqlParam As SqlParameter
Dim param As DictionaryEntry
Dim sqlParam As SqlParameter
Dim myDA As SqlDataAdapter
mySqlCommand.CommandText = sqlCommand
mySqlCommand.CommandType = myType
mySqlCommand.Connection = myConn
If Not sqlParameters Is Nothing Then
For Each param In sqlParameters
mySqlCommand.Parameters.Add(param.Key, IIf(param.Value Is Nothing, System.DBNull.Value, param.Value))
If myDT Is Nothing Then myDT = New DataTable("Data")
myDA = New SqlDataAdapter(mySqlCommand)
it bombs here
TryThrow New Exception(ex.Message) End Try For Each sqlParam In mySqlCommand.Parameters
Catch ex As Exception
sqlParameters(sqlParam.ParameterName) = sqlParam.ValueNext End Sub
i then get the floowing error in the browser
at SQLLibrary.sqlInterface.RunSQL_DT(String sqlCommand, Hashtable sqlParameters, DataTable& myDT, CommandType myType) in C:\ESS Source\SQLLibrary\sqlinterface.vb:line 49 at SQLLibrary.sqlInterface.ExecuteSP(String sqlCommand, Hashtable sqlParameters, DataTable& myDT) in C:\ESS Source\SQLLibrary\sqlinterface.vb:line 96 at UNICampaign.WebForm1.SaveProcess() in C:\ESS Source\UNICampaign\Stage1.aspx.vb:line 328
Invalid object name 'dbo.sysmergearticles'.FATAL ERROR:
at System.Threading.Thread.AbortInternal() at System.Threading.Thread.Abort(Object stateInfo) at System.Web.HttpResponse.End() at UNICampaign.WebForm1.SaveProcess() in C:\ESS Source\UNICampaign\Stage1.aspx.vb:line 336 at UNICampaign.WebForm1.cmdEngaged_Click(Object sender, EventArgs e) in C:\ESS Source\UNICampaign\Stage1.aspx.vb:line 186
Thread was being aborted.
Does any one have a clue as to why this is happening?
Tuesday, May 09, 2006 12:58 PM
Just thought that I would let you know that this error occurred due to triggers(that returned an error being present on the database.
These were setup by a previous developer of the company that believed setting up replication as a great method of source safe coding.
If you remove the triggers this then rids the error and allows your application to function