|
dev
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
How bind textbox to parameter for insert (2005)I've created the datasource as the following: <asp:SqlDataSource ID="dsrcUsers" runat="server" ConnectionString="<%$ ConnectionStrings:MyMainDatabase %>" SelectCommand="SELECT * FROM [MyUsers]" InsertCommand="INSERT INTO [MyUsers] ([UserId], [FirstName], [LastName], [MyPhone]) VALUES (@UserId, @FirstName, @LastName, @MyPhone)"> <InsertParameters> <asp:Parameter Name="UserId" Type="Object" /> <asp:Parameter Name="FirstName" Type="String" /> <asp:Parameter Name="LastName" Type="String" /> <asp:Parameter Name="MyPhone" Type="String" /> </InsertParameters> </asp:SqlDataSource> Question: Is there an easy way to make the .insert command AUTOMATICALLY pull from the corresponding textboxes? Or do I have to create a new parameter object in code and set the .text property to be the param values? |
|||||||||||||||||||||||