Inserting data into ACCESS using a Web Form


Joined
May 16, 2008
Messages
1
Reaction score
0
When I run the web app in the browser and click on the submit button nothing happs. One would at least think I would get at least one error.

I doing a class project that is due this thursday and what I am doing is building a prototype web mail app for my system analysis class. So I was trying to input Student ID, FirstName, LastName, and Last 4 of SSN using Textboxes. The fields I'm using in Access are the same as above.

HTML:
<
asp:AccessDataSource ID="AccessDataSource1" runat="server" DataFile="~/App_Data/Email.mdb" 
InsertCommand="INSERT INTO [UserCredentials]([student ID], [FirstName], [LastName], [last 4])VALUES(?,?,?,?)"> 

<InsertParameters> 
<asp:ControlParameter ControlID="StudentIDTextBox" Name="student_ID" PropertyName="Text" Type="Int32" /> 
<asp:ControlParameter ControlID="FirstNameTextBox" Name="FirstName" PropertyName="Text" type="String" /> 
<asp:ControlParameter ControlID="LastNameTextBox" Name="LastName" PropertyName="Text" Type="String" /> 
<asp:ControlParameter ControlID="Last4SSNTextBox" Name="Last_4" PropertyName="Text" Type="Int32" /> 
</InsertParameters> 


</asp:AccessDataSource> 
<br />


I also place this code in my button.click event

Private Sub CreateButton_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles CreateButton.Click
AccessDataSource1.Insert()
End Sub
 
Ad

Advertisements


Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top