We value your feedback.
Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!
Protected Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click Dim Var1 As String = TXTDB1.Text Dim Var2 As String = TXTDB2.Text Dim Var3 As String = TXTDB3.Text Dim Var4 As String = TXTDB5.Text Dim Var5 As String = TXTDB4.Text Dim sqlConnection3 As New System.Data.SqlClient.SqlConnection("Data Source=RHINO-ET\BLACKRHINO;Initial Catalog=BlackRhino;Integrated Security=True") Dim cmd As New System.Data.SqlClient.SqlCommand cmd.CommandType = System.Data.CommandType.Text ' cmd.CommandText = "INSERT Region (RegionID, RegionDescription) VALUES (5, 'NorthWestern')" cmd.CommandText = "INSERT INTO Picture(Asset, Description, Location, Asset_Img, IMG_Location) VALUES('Var1', 'Var2', 'Var3', 'Var4', 'Var5')" cmd.Connection = sqlConnection3 Try sqlConnection3.Open() cmd.ExecuteNonQuery() lblMessage.Text = "Record inserted successfully" Catch ex As Exception lblMessage.Text = "Unable to insert record" Finally sqlConnection3.Close() End Try TXTDB1.Text = " " TXTDB2.Text = " " TXTDB3.Text = " " TXTDB4.Text = " " TXTDB5.Text = " " End Sub
Add your voice to the tech community where 5M+ people just like you are talking about what matters.
Join the community of 500,000 technology professionals and ask your questions.