|
I am trying to insert a record into a database, and am having a lot of trouble getting the data from the text boxes I created to bind to the Parameters. Anyone have any idea how I can get the text property of a text box to match up with a parameter so I can assign it to a field? Thus far all that happens is I add a blank record and the strings in the text boxes are completely ignored...
Below is the code I have so far:
< Script runat="server">
Private Sub InsertBorrower(ByVal Source As Object, ByVal e As EventArgs)
'Dim Social_Security_Number As Parameter
'Social)Security_Number =
'Social_Security_Number.DefaultValue = txtSocial.Text
SqlDataSource1.Insert()
End Sub
</Script>
<asp:SqlDataSource ID="SqlDataSource1" runat="server" ConnectionString="<%$ ConnectionStrings:DatabaseConnectionString1 %>"
DeleteCommand="DELETE FROM [Borrower] WHERE [Social Security Number] = @Social_Security_Number"
InsertCommand="INSERT INTO [Borrower] ([First Name], [Last Name], [Middle Name], [Social Security Number], [Current Address], [Co/Main Borrower], [Current Street Address], [Current City], [Current State], [Current Zip], [Income]) VALUES (@First_Name, @Last_Name, @Middle_Name, @Social_Security_Number, @Current_Address, @column1, @Current_Street_Address, @Current_City, @Current_State, @Current_Zip, @Income)"
ProviderName="<%$ ConnectionStrings:DatabaseConnectionString1.ProviderName %>"
SelectCommand="SELECT [First Name] AS First_Name, [Last Name] AS Last_Name, [Middle Name] AS Middle_Name, [Social Security Number] AS Social_Security_Number, [Current Address] AS Current_Address, [Co/Main Borrower] AS column1, [Current Street Address] AS Current_Street_Address, [Current City] AS Current_City, [Current State] AS Current_State, [Current Zip] AS Current_Zip, [Income] FROM [Borrower]"
UpdateCommand="UPDATE [Borrower] SET [First Name] = @First_Name, [Last Name] = @Last_Name, [Middle Name] = @Middle_Name, [Current Address] = @Current_Address, [Co/Main Borrower] = @column1, [Current Street Address] = @Current_Street_Address, [Current City] = @Current_City, [Current State] = @Current_State, [Current Zip] = @Current_Zip, [Income] = @Income WHERE [Social Security Number] = @Social_Security_Number">
<InsertParameters>
<asp:Parameter Name="First_Name" Type="String" />
<asp:Parameter Name="Last_Name" Type="String" />
<asp:Parameter Name="Middle_Name" Type="String" />
<asp:Parameter Name="Social_Security_Number" Type="Int16" DefaultValue= txtSocial.text />
<asp:Parameter Name="Current_Address" Type="String" />
<asp:Parameter Name="column1" Type="String" />
<asp:Parameter Name="Current_Street_Address" Type="String" />
<asp:Paramet
|