我们专注攀枝花网站设计 攀枝花网站制作 攀枝花网站建设
成都网站建设公司服务热线:400-028-6601

网站建设知识

十年网站开发经验 + 多家企业客户 + 靠谱的建站团队

量身定制 + 运营维护+专业推广+无忧售后,网站问题一站解决

FormView的插入模板中的DropDownList控件参数

<%@ Page Language="VB" AutoEventWireup="false" CodeFile="Default.aspx.vb" Inherits="_Default" %>

建网站原本是网站策划师、网络程序员、网页设计师等,应用各种网络程序开发技术和网页设计技术配合操作的协同工作。创新互联专业提供网站制作、成都做网站,网页设计,网站制作(企业站、自适应网站建设、电商门户网站)等服务,从网站深度策划、搜索引擎友好度优化到用户体验的提升,我们力求做到极致!




   


   


   

   

控件SqlDataSource与FormViw应用之在插入模板添加控件DropDwonList并保存记录实例


                    SelectCommand="SELECT [CompanyID], [Company] FROM [tblCompany]">
       

                    DataKeyNames="CompanyID" DataSourceID="SqlDataSource1">
           
               
                                    InsertVisible="False" ReadOnly="True" SortExpression="CompanyID" />
                                    SortExpression="Company" />
           

       

                    ConnectionString="<%$ ConnectionStrings:HRM_DATAConnectionString %>"
            InsertCommand="INSERT INTO tblDepart(Depart, CompanyID) VALUES (@Depart,@CompanyID)"
            SelectCommand="SELECT tblDepart.DepartID, tblDepart.Depart, tblCompany.Company, tblDepart.CompanyID FROM tblDepart INNER JOIN tblCompany ON tblDepart.CompanyID = tblCompany.CompanyID WHERE (tblCompany.CompanyID = @Companyid)">
           
               
               
           

           
                                    PropertyName="SelectedValue" />
           

       

                    BackColor="White" BorderColor="#CC9966" BorderStyle="None" BorderWidth="1px"
            CellPadding="4" DataKeyNames="DepartID" DataSourceID="SqlDataSource2"
            GridLines="Both" Height="125px" Width="566px">
           
                DepartID:
               
               

                Depart:
               
               

                Company:
               
               

                                    CommandName="Update" Text="更新" />
                                     CausesValidation="False" CommandName="Cancel" Text="取消" />
           

           
           
           
           
                Depart:
               
               

                Company:
                                    DataSourceID="SqlDataSource1" DataTextField="Company"
                    DataValueField="CompanyID" SelectedValue='<%# Bind("CompanyID") %>'>
               

               

                                    CommandName="Insert" Text="插入" />
                                     CausesValidation="False" CommandName="Cancel" Text="取消" />
           

           
                DepartID:
               
               

                Depart:
               
               

                Company:
               
               

               

               

                New
           
           
           
       
       

       


   


   



文章题目:FormView的插入模板中的DropDownList控件参数
标题URL:http://shouzuofang.com/article/peoedj.html

其他资讯