0

Whenever I run the form and complete the procedure then I need to go back to sql database and click on execute. I want to avoid everytime going back and executing each entry because if I don't execute everytime then the further other [b]form data [/b]will not be[b] retrieved[/b] properly as the [b]previous form[/b] will [b]not be updated[/b]. I hope ur understanding ...
I have written the query in the [b]form code[/b] itself.
I have used [b]trigger[/b] once but that was on the Database side itself.
so,this time I am not understanding what to do!!
So what is the solution to make the database execute automatically once the code is being executed i.e. the details are sent to database?

2
Contributors
1
Reply
3
Views
5 Years
Discussion Span
Last Post by Begginnerdev
0

Something like this:

  Dim conStr As String = "Data Source=myServerAddress;Initial Catalog=myDataBase;Integrated Security=SSPI;"

    Dim con As New SqlConnection(conStr)
    Dim cmd As SqlCommand

    Try
        Dim myValue As String = "This is a test."

        con.Open()

        Dim sqls As String = "INSERT INTO table (column) VALUES ('" & myValue & "')"
        cmd = New SqlCommand(sqls, con)
        cmd.ExecuteNonQuery()

    Catch ex As Exception
        MsgBox(ex.Message)
    End Try
This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.