<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0">
  <channel>
    <title>'Visual Web Developer 2010 how to save textbox to SQL VB.net' Thread RSS Feed</title>
    <link>http://www.programmersheaven.com/</link>
    <description>Contains the latest posts from the thread 'Visual Web Developer 2010 how to save textbox to SQL VB.net' posted on the 'VB.NET' forum at Programmer's Heaven.</description>
    <language>en</language>
    <copyright>Copyright 2013 Programmers Heaven</copyright>
    <pubDate>Sat, 18 May 2013 14:54:33 -0700</pubDate>
    <lastBuildDate>Sat, 18 May 2013 14:54:33 -0700</lastBuildDate>
    <generator>Argotic Syndication Framework 2007.3.0.1, http://www.codeplex.com/Argotic</generator>
    <docs>http://www.rssboard.org/rss-specification</docs>
    <ttl>360</ttl>
    <image>
      <url>http://www.programmersheaven.com/images/ph.gif</url>
      <title>Programmers Heaven</title>
      <link>http://www.programmersheaven.com/</link>
      <width>88</width>
      <height>31</height>
    </image>
    <item>
      <title>Visual Web Developer 2010 how to save textbox to SQL VB.net</title>
      <link>http://www.programmersheaven.com/mb/VBNET/429521/429521/visual-web-developer-2010-how-to-save-textbox-to-sql-vbnet/</link>
      <description>I am new to Visual Web Developer Express. Something so simple not working ....&lt;br /&gt;
I connected to the SQL database&lt;br /&gt;
Created a webpage and simply added&lt;br /&gt;
2 textbox(s)&lt;br /&gt;
a gridview (works)&lt;br /&gt;
Submit button &lt;br /&gt;
&lt;br /&gt;
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! &lt;br /&gt;
&lt;br /&gt;
Protected Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click&lt;br /&gt;
&lt;br /&gt;
Dim SqlDataSource1 As New SqlDataSource()&lt;br /&gt;
Dim FailCode As New Table&lt;br /&gt;
Dim FailCodeDesc As New Table&lt;br /&gt;
Dim SqlDataSource As String = "Data Source=[my server name] ;Initial Catalog=[my database name] ;Integrated Security=True"&lt;br /&gt;
&lt;br /&gt;
SqlDataSource1.InsertCommandType = SqlDataSourceCommandType.Text&lt;br /&gt;
SqlDataSource1.InsertCommand = "INSERT INTO ReachoutFailure (FailCode, FailDesc) Values (@FailCode, @FailDesc)"&lt;br /&gt;
SqlDataSource1.InsertParameters.Add("FailCode", TextBox1.Text)&lt;br /&gt;
SqlDataSource1.InsertParameters.Add("FailDesc", TextBox2.Text)&lt;br /&gt;
&lt;br /&gt;
Dim rowsAffected As Integer = 0&lt;br /&gt;
Try&lt;br /&gt;
rowsAffected = SqlDataSource1.Insert()&lt;br /&gt;
Catch ex As Exception&lt;br /&gt;
Server.Transfer("AdminFailCode.aspx")&lt;br /&gt;
Finally&lt;br /&gt;
SqlDataSource1 = Nothing&lt;br /&gt;
End Try&lt;br /&gt;
If rowsAffected &amp;lt;&amp;gt; 1 Then&lt;br /&gt;
Server.Transfer("AdminFailCode.aspx")&lt;br /&gt;
Else&lt;br /&gt;
Server.Transfer("AdminFailCode.aspx")&lt;br /&gt;
&lt;br /&gt;
End If&lt;br /&gt;
End Sub&lt;br /&gt;
&lt;br /&gt;</description>
      <guid isPermaLink="true">http://www.programmersheaven.com/mb/VBNET/429521/429521/visual-web-developer-2010-how-to-save-textbox-to-sql-vbnet/</guid>
      <pubDate>Sat, 15 Sep 2012 11:51:53 -0700</pubDate>
      <category>VB.NET</category>
    </item>
  </channel>
</rss>