Jump to content

add to access database


nemo

Recommended Posts

I'm tying to add to access database but I'm always getting an error. but if I changes the variavles in the VALUES by constants it worked fineAny help is appriciatedhere is the code <script runat="server"> Private Sub Insertguest(ByVal Source As Object, ByVal e As EventArgs) SqlDataSource1.Insert() End Sub ' Insertguest</Script><html xmlns="http://www.w3.org/1999/xhtml" ><head id="Head1" runat="server"> <title>Untitled Page</title> </head><body> <asp:SqlDataSource id="SqlDataSource1" runat="server" ProviderName="System.Data.Odbc" DataSourceMode="DataSet" ConnectionString="dsn=eventdb;" SelectCommand="SELECT GuestLastName, GuestFirstName, Guestsufix FROM guest" Insertcommand="INSERT INTO guest (GuestLastName,GuestFirstName,Guestsufix) VALUES (@lstName,@firstname,@suff)"> <insertparameters> <asp:formparameter name="lstName" FormField="SPLastname" Type="String" /> <asp:formparameter name="firstname" formfield="SPFirstName" Type="String" Size="22" /> <asp:formparameter name="suff" formfield="SPSuffix" Type="String" Size="22" /> </insertparameters> </asp:SqlDataSource> <p><asp:Button ID="spsubmit" runat="server" Style="z-index: 106; left: 35px; position: absolute; top: 421px" Text="Sumit" onclick="InsertGuest" />

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...