I have one textbox called txtName.text. I need users to put in their name, click the submit button, and have it save to my SQL Server 2012 Database. I have been trying for a long time and have made no real progress, if you could help it would be excellent. I can include one of my attempts but I doubt it would be much help - I get like 20 errors each time.
Imports System.Data.SqlClient Imports System.Data Partial Class _Default Inherits System.Web.UI.Pag Protected Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click Dim con As SqlConnection Dim commandsql As SqlCommand Dim citestedate As SqlDataReader Dim ra As Integer con = New SqlConnection("Server=HTZC91C7005H;Database=FredDB;Trusted_Connection=True;") con.Open() commandsql = New SqlCommand("insert into dbo.Fred_Test([Name]) values (' " & TextBox1.Text & "')", con) commandsql.ExecuteNonQuery() MessageBox.Show("New Row Inserted" & ra) con.Close() End Sub