ASP.net , C#, and VB.net , and Java, and SQL

coding and testing

博客园 首页 新随笔 联系 订阅 管理

Microsoft User control asp:DetailsView Co-operation with asp:SqlDataSource

 

1. asp:dataSource have many way to filter database

 First solution is :    

              <...

                 FilterExpression=" textname = '{0}' ">
                <FilterParameters>
                    <asp:ControlParameter ControlId="textname " PropertyName="SelectedValue"/>
                </FilterParameters> when the anto dropdownlist refresh which selectedvalue will be working on.

 

  Second solution is :

            <.....

                 OnSelecting="dataResources_Selecting">
                <SelectParameters>
                    <asp:ControlParameter ControlID="txt" Name="text" PropertyName="Text"
                        DefaultValue="%" />
                    <asp:QueryStringParameter Name="txt1" QueryStringField="txt1" />
                </SelectParameters>

              protected void dataResources_Selecting(object sender, SqlDataSourceSelectingEventArgs e)
             {      ......     }

third solution strainghtaway

                 

2. asp:DetailsView with asp:sqldatasource have

DetailsView1.DefaultMode = DetailsViewMode.Insert; / Update

SqlDataSource1.InsertParameters

SqlDataSource1.Insert()

 

 

posted on 2010-06-02 18:04  mr liao  阅读(224)  评论(0编辑  收藏  举报