首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 网站开发 > asp.net >

使用vs2005将一个dataview绊定数据源,删除出错,提示必须声明变量?解决思路

2012-01-14 
使用vs2005将一个dataview绊定数据源,删除出错,提示必须声明变量?formid form1 action method p

使用vs2005将一个dataview绊定数据源,删除出错,提示必须声明变量?
<form   id= "form1 "   action= " "   method= "post "   runat= "server ">
        <asp:GridView   ID= "GridView1 "   runat= "server "   AllowPaging= "True "   AllowSorting= "True "
                BackColor= "White "   BorderColor= "#CC9966 "   BorderStyle= "None "   BorderWidth= "1px "
                CellPadding= "4 "   DataSourceID= "SqlDataSource1 "   AutoGenerateColumns= "False "   DataKeyNames= "id ">
                <FooterStyle   BackColor= "#FFFFCC "   ForeColor= "#330099 "   />
                <Columns>
                        <asp:CommandField   ShowDeleteButton= "True "   />
                        <asp:BoundField   DataField= "id "   HeaderText= "id "   InsertVisible= "False "   ReadOnly= "True "
                                SortExpression= "id "   />
                        <asp:BoundField   DataField= "Province "   HeaderText= "Province "   SortExpression= "Province "   />
                        <asp:BoundField   DataField= "LearningCenter "   HeaderText= "LearningCenter "   SortExpression= "LearningCenter "   />
                        <asp:BoundField   DataField= "Xxiao "   HeaderText= "Xxiao "   SortExpression= "Xxiao "   />
                        <asp:BoundField   DataField= "Pci "   HeaderText= "Pci "   SortExpression= "Pci "   />
                        <asp:BoundField   DataField= "Cci "   HeaderText= "Cci "   SortExpression= "Cci "   />
                        <asp:BoundField   DataField= "ZHye "   HeaderText= "ZHye "   SortExpression= "ZHye "   />
                        <asp:BoundField   DataField= "Name "   HeaderText= "Name "   SortExpression= "Name "   />
                        <asp:BoundField   DataField= "Sex "   HeaderText= "Sex "   SortExpression= "Sex "   />
                        <asp:BoundField   DataField= "Certificate "   HeaderText= "Certificate "   SortExpression= "Certificate "   />
                        <asp:BoundField   DataField= "CertificateNO "   HeaderText= "CertificateNO "   SortExpression= "CertificateNO "   />


                        <asp:BoundField   DataField= "MobilePhone "   HeaderText= "MobilePhone "   SortExpression= "MobilePhone "   />
                        <asp:BoundField   DataField= "HomePhone "   HeaderText= "HomePhone "   SortExpression= "HomePhone "   />
                        <asp:BoundField   DataField= "PostCode "   HeaderText= "PostCode "   SortExpression= "PostCode "   />
                        <asp:BoundField   DataField= "PostAddress "   HeaderText= "PostAddress "   SortExpression= "PostAddress "   />
                        <asp:BoundField   DataField= "TimeAt "   HeaderText= "TimeAt "   SortExpression= "TimeAt "   />
                </Columns>
                <RowStyle   BackColor= "White "   ForeColor= "#330099 "   />
                <SelectedRowStyle   BackColor= "#FFCC66 "   Font-Bold= "True "   ForeColor= "#663399 "   />
                <PagerStyle   BackColor= "#FFFFCC "   ForeColor= "#330099 "   HorizontalAlign= "Center "   />
                <HeaderStyle   BackColor= "#990000 "   Font-Bold= "True "   ForeColor= "#FFFFCC "   />
        </asp:GridView>
       
        <asp:SqlDataSource   ID= "SqlDataSource1 "   runat= "server "   ConnectionString= " <%$   ConnectionStrings:bbsConnectionString   %> "
                DeleteCommand= "DELETE   FROM   open_baoming   where   id=@id "   SelectCommand= "SELECT   *     FROM   open_baoming ">
        </asp:SqlDataSource>

</form>

[解决办法]
帮顶先

热点排行