hOW TO INSERT DATA FROM ASP.NET TEXTBOX TO TWO DIFFERENT TABLE ON SINGLE BUTTON CLICK EVENT ?

Posted by user559800 on Stack Overflow See other posts from Stack Overflow or by user559800
Published on 2011-01-05T06:42:05Z Indexed on 2011/01/05 6:54 UTC
Read the original article Hit count: 229

Filed under:
|

I M USING THAT CODE TO INSERT INTO SINGLE TABLE !

HOW TO USE THIS CODE TO INSERT THE TEXTBOX TEXT TO MULTIPLE TABLES OF SAME COLUMN ON SINGLE BUTTON CLICK EVENT IN VB.NET ?

Imports System.Data.SqlClient
Protected Sub ImageButton1_Click(ByVal sender As Object, ByVal e As System.Web.UI.ImageClickEventArgs) Handles ImageButton1.Click
        Dim con As New SqlConnection
        Dim cmd As New SqlCommand

        con.ConnectionString = "Data Source=.\SQLEXPRESS;AttachDbFilename=|DataDirectory|\ASPNETDB.MDF;Integrated Security=True;User Instance=True"
        con.Open()
        cmd.Connection = con
        cmd.CommandText = "INSERT INTO a1_ticket (seat_remain) VALUES('" & Trim(Label1.Text) & "')"
            cmd.ExecuteNonQuery()


        con.Close()

    End Sub

© Stack Overflow or respective owner

Related posts about ASP.NET

Related posts about vb.net