Dim Conn_web As SqlConnection
Conn_web = MyFormz.connec.ConnWeb2(dbName)
Conn_web.Open()
Dim sqlcmd_Insert As New SqlCommand(sql_Insert1 + sql_Insert2, Conn_web)
Try
sqlcmd_Insert.ExecuteNonQuery()
MsgBox("The New Record has been saved.")
Catch ex As Exception
MsgBox(ex.Message)
End Try
Sub Insert_New_Converts_Followups(ByVal strFollowup_No As String, ByVal strFollowup_Date As String, ByVal strFollowup_By As String, ByVal strFollowup_Response As String)
Dim sql_Insert1 As String = "INSERT INTO New_Converts_Followups(VisitorID, Followup_No, Followup_Date, Followup_By, Followup_Response )"
Dim sql_Insert2 As String = "VALUES ('" & Me.txtNew_ConvertsID.Text & "', '" & strFollowup_No & "', '" & strFollowup_Date & "', '" & strFollowup_By & "', '" & strFollowup_Response & "')"
MyFormz.cl_Class.Insert_str2_B(sql_Insert1, sql_Insert2, txtDBname.Text)
End Sub
I used to use this code to do my inserts however i have recently been introduced 2 stored procedures and i came up with this code to insert using the stored procedure but now i am suck when it comes to trying to retrieve the data using the stored procedure
Dim parm1 As New SqlClient.SqlParameter("@Category_ID", "")
Dim parm2 As New SqlClient.SqlParameter("@Category", "Value1")
Dim parm3 As New SqlClient.SqlParameter("@Area_Name", "Value2")
Dim cmd As New SqlClient.SqlCommand
cmd.CommandText = "dbo.udp_tblArea_ups"
cmd.CommandType = CommandType.StoredProcedure
cmd.Parameters.AddRange(New SqlClient.SqlParameter() {parm1, parm2, parm3})
Dim cn As New SqlClient.SqlConnection("Data Source=******;Initial Catalog=******;User ID=*****;Password=*****")
cn.Open()
cmd.Connection = cn
cmd.ExecuteNonQuery()
cn.Close()