<asp:TextBox ID="txtUserId" runat="server"></asp:TextBox>
<asp:TextBox ID="txtUserName" runat="server"></asp:TextBox>
<asp:TextBox ID="txtPassword" runat="server"></asp:TextBox>
<asp:TextBox ID="txtGender" runat="server"></asp:TextBox>
<asp:DropDownList ID="ddlUserStateList" runat="server"
DataSourceID="sdsUserStateList" DataTextField="UserStateName"
DataValueField="UserStateId">
</asp:DropDownList>
<asp:DropDownList ID="ddlRoleList" runat="server"
DataSourceID="sdsRoleList" DataTextField="RoleName"
DataValueField="RoleId">
</asp:DropDownList>
<asp:DropDownList ID="ddlDepartList" runat="server"
DataSourceID="sdsDepartList" DataTextField="DepartName"
DataValueField="DepartId">
</asp:DropDownList>
<asp:Button Text="提交" runat="server" ID="btnSubmit" />
<asp:SqlDataSource ID="SqlDataSource1" runat="server"
ConnectionString="<%$ ConnectionStrings:MyOfficeConnectionString %>"
InsertCommand="INSERT INTO [UserInfo] ([UserId], [UserName], [Password], [DepartId], [Gender], [RoleId], [UserStateId]) VALUES (@UserId, @UserName, @Password, @DepartId, @Gender, @RoleId, @UserStateId)"
<InsertParameters>
<asp:FormParameter Name="UserId" FormField="txtUserId" />
<asp:FormParameter Name="UserName" FormField="txtUserName" />
<asp:FormParameter Name="Password" FormField="txtPassword" />
<asp:FormParameter Name="Gender" FormField="txtGender" />
<asp:FormParameter Name="DepartId" FormField="???" />
<asp:FormParameter Name="RoleId" FormField="???" />
<asp:FormParameter Name="UserStateId" FormField="???" />
</InsertParameters>
</asp:SqlDataSource>
请问:问号处该怎么写?
这个东西没有使用过,觉得这样使用那个系统规模大了得话那个维护量(更换数据库)那就是非常麻烦的事情。
不过看这个如果使用 DropDownList的id 不行的话,就后台写值