| | |
I need to trace or view that the stored proc is saving the data.
Please support our VB.NET advertiser: Intel Parallel Studio Home
![]() |
•
•
Join Date: Sep 2005
Posts: 14
Reputation:
Solved Threads: 0
I have a stored procedure and it is not saving the values in the table. How can I view that the stored procedure is saving the values.
Private Sub DoSave()
Dim ConnectionString As String = System.Configuration.ConfigurationSettings.AppSettings("FinSolMainDBConn")
Dim connfinsol As New System.Data.SqlClient.SqlConnection(ConnectionString)
Dim strsql As String
Dim adapter As New SqlDataAdapter
Dim transaction As SqlTransaction
Dim myCommand As New SqlCommand("stp_UpdTransOverride ", connfinsol)
myCommand.CommandType = CommandType.StoredProcedure
'Add Parameters
' 1 Policy Number
myCommand.Parameters.Add("@Policy_Nbr", SqlDbType.VarChar, 7).Value = txtPolicyNumber.Text
' 2 Original Tranaction Override
myCommand.Parameters.Add("@Trans_CodeOrig", SqlDbType.VarChar, 6).Value = cmbOriginalTransCode.Text
' 3 Transaction Effective Date
myCommand.Parameters.Add("@Trans_Eff_Date", SqlDbType.DateTime, 8).Value = dteEffDt.Value
' 4 Override Action
myCommand.Parameters.Add("@Override_Code", SqlDbType.VarChar, 2).Value = cmbOverrideAction.Text
' 5 Override New/Renewal
myCommand.Parameters.Add("@NR_CodeOvr", SqlDbType.VarChar, 1).Value = cmbOverrideNR.Text
' 6 Override Transaction Code
myCommand.Parameters.Add("@Trans_CodeOvr", SqlDbType.VarChar, 6).Value = cmbOverrideTransactionCode.Text
' 7 Modified UID
myCommand.Parameters.Add("@ModifiedUID", SqlDbType.NVarChar, 48).Value = txtUserId.Text
' 8 Plan Year
myCommand.Parameters.Add("@Plan_Year", SqlDbType.Int, 4).Value = txtPlanYear.Text
'Open Connection
Try
'Open Connection
connfinsol.Open()
myCommand.ExecuteNonQuery()
MsgBox("Data Saved Successfully !", MsgBoxStyle.Information, Me.Text)
Catch ex As Exception
MsgBox(ex.Message, MsgBoxStyle.Critical, Me.Text)
Finally
If myCommand.Connection.State = ConnectionState.Open Then
myCommand.Connection.Close()
End If
End Try
End Sub
Any help would be kindly appreciated!
M
Private Sub DoSave()
Dim ConnectionString As String = System.Configuration.ConfigurationSettings.AppSettings("FinSolMainDBConn")
Dim connfinsol As New System.Data.SqlClient.SqlConnection(ConnectionString)
Dim strsql As String
Dim adapter As New SqlDataAdapter
Dim transaction As SqlTransaction
Dim myCommand As New SqlCommand("stp_UpdTransOverride ", connfinsol)
myCommand.CommandType = CommandType.StoredProcedure
'Add Parameters
' 1 Policy Number
myCommand.Parameters.Add("@Policy_Nbr", SqlDbType.VarChar, 7).Value = txtPolicyNumber.Text
' 2 Original Tranaction Override
myCommand.Parameters.Add("@Trans_CodeOrig", SqlDbType.VarChar, 6).Value = cmbOriginalTransCode.Text
' 3 Transaction Effective Date
myCommand.Parameters.Add("@Trans_Eff_Date", SqlDbType.DateTime, 8).Value = dteEffDt.Value
' 4 Override Action
myCommand.Parameters.Add("@Override_Code", SqlDbType.VarChar, 2).Value = cmbOverrideAction.Text
' 5 Override New/Renewal
myCommand.Parameters.Add("@NR_CodeOvr", SqlDbType.VarChar, 1).Value = cmbOverrideNR.Text
' 6 Override Transaction Code
myCommand.Parameters.Add("@Trans_CodeOvr", SqlDbType.VarChar, 6).Value = cmbOverrideTransactionCode.Text
' 7 Modified UID
myCommand.Parameters.Add("@ModifiedUID", SqlDbType.NVarChar, 48).Value = txtUserId.Text
' 8 Plan Year
myCommand.Parameters.Add("@Plan_Year", SqlDbType.Int, 4).Value = txtPlanYear.Text
'Open Connection
Try
'Open Connection
connfinsol.Open()
myCommand.ExecuteNonQuery()
MsgBox("Data Saved Successfully !", MsgBoxStyle.Information, Me.Text)
Catch ex As Exception
MsgBox(ex.Message, MsgBoxStyle.Critical, Me.Text)
Finally
If myCommand.Connection.State = ConnectionState.Open Then
myCommand.Connection.Close()
End If
End Try
End Sub
Any help would be kindly appreciated!
M
If you are using SQL server 2000,Try debugging using the Query analyzer.
Check this website,
http://www.15seconds.com/issue/050106.htm
Also check your Datatype,Make sure you are sending the same datatype to update the database.
Check your code,
I assume Policy Number is an Integer in your Database but you are sending a string.
Check this website,
http://www.15seconds.com/issue/050106.htm
Also check your Datatype,Make sure you are sending the same datatype to update the database.
Check your code,
I assume Policy Number is an Integer in your Database but you are sending a string.
Save White Tiger
![]() |
Similar Threads
- How to view Mail attachments (JSP)
- memory management in wndows 2000 (Windows NT / 2000 / XP)
- Saving Game Data - Plaintext vs. XML (Game Development)
- ASP.net/Stored Proc & Login Verification (ASP.NET)
- Transfer from *regular* "phpbb 2.0.11" to "phpbb XTREME 1.7" possible? (Growing an Online Community)
- Help Reading Info in Text File Into an Array (C++)
- Any download limit with a MAC ?!? (OS X)
Other Threads in the VB.NET Forum
- Previous Thread: how to get value from an access querry in a variabe?
- Next Thread: Help Me "error in file request cancelled by user"
| Thread Tools | Search this Thread |
.net .net2005 30minutes 2005 2008 access account arithmetic array basic binary bing button buttons center check code combobox component connectionstring crystalreport data database databasesearch datagrid datagridview date design dissertation dissertations dissertationthesis dropdownlist excel fade file-dialog folder ftp generatetags google hardcopy image images input insert intel internet login mobile monitor ms net networking objects opacity output passingparameters peertopeervideostreaming picturebox picturebox1 port problem problemwithinstallation project reports" save savedialog searchbox searchvb.net select serial shutdown soap string survey tcp temperature text textbox timer toolbox trim update updown user usercontrol vb vb.net vb.netcode vb.netformclosing()eventpictureboxmessagebox vb2008 vbnet view visual visualbasic visualbasic.net visualstudio visualstudio2008 web winforms wpf





