Welcome to the new platform of Programmers Heaven! We apologize for the inconvenience caused, if you visited us from a broken link of the previous version. The main reason to move to a new platform is to provide more effective and collaborative experience to you all. Please feel free to experience the new platform and use it's exciting features. Contact us for any issue that you need to get clarified. We are more than happy to help you.
Visual Web Developer 2010 how to save textbox to SQL VB.net
I am new to Visual Web Developer Express. Something so simple not working ....
I connected to the SQL database
Created a webpage and simply added
a gridview (works)
When trying the app the Submit button appears to work but no data is sent to the SQL Database Obviously I have missed something in the Vb code behind the page. ?? Any help or thoughts appreciated. I have tried multiple searches and it should work!
Protected Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
Dim SqlDataSource1 As New SqlDataSource()
Dim FailCode As New Table
Dim FailCodeDesc As New Table
Dim SqlDataSource As String = "Data Source=[my server name] ;Initial Catalog=[my database name] ;Integrated Security=True"
SqlDataSource1.InsertCommandType = SqlDataSourceCommandType.Text
SqlDataSource1.InsertCommand = "INSERT INTO ReachoutFailure (FailCode, FailDesc) Values (@FailCode, @FailDesc
Dim rowsAffected As Integer = 0
rowsAffected = SqlDataSource1.Insert()
Catch ex As Exception
SqlDataSource1 = Nothing
If rowsAffected <> 1 Then