| 网站首页 | 业界新闻 | 小组 | 威客 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛
欢迎加入我们,一同切磋技术
用户名:   
 
密 码:  
共有 2832 人关注过本帖
标题:错误 1 “ASP.sqldatasource_aspx”并不包含“SqlDataSource1_Selecting”的 ...
只看楼主 加入收藏
tottibuffon
Rank: 2
等 级:论坛游民
帖 子:105
专家分:20
注 册:2009-6-5
结帖率:83.87%
收藏
 问题点数:0 回复次数:4 
错误 1 “ASP.sqldatasource_aspx”并不包含“SqlDataSource1_Selecting”的定义 E:\点NET\DataSourc
如题
搜索更多相关主题的帖子: DataSourc NET Selecting aspx 定义 
2010-10-14 12:16
tottibuffon
Rank: 2
等 级:论坛游民
帖 子:105
专家分:20
注 册:2009-6-5
收藏
得分:0 
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="SqlDataSource.aspx.cs" Inherits="Default2" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.

<html xmlns="http://www. >
<head runat="server">
    <title>无标题页</title>
</head>
<body>
    <form id="form1" runat="server">
    <div>
        <asp:SqlDataSource ID="SqlDataSource1" runat="server"
        ConnectionString="<%$ ConnectionStrings:StudentDBConnectionString %>"
            DeleteCommand="DELETE FROM [studentinfo] WHERE [st_id] = @st_id" InsertCommand="INSERT INTO [studentinfo] ([st_id], [st_name], [st_sex], [st_brithdat], [st_city]) VALUES (@st_id, @st_name, @st_sex, @st_brithdat, @st_city)"
            OnSelecting="SqlDataSource1_Selecting" SelectCommand="SELECT * FROM [studentinfo] ORDER BY [st_id]"
            UpdateCommand="UPDATE [studentinfo] SET [st_name] = @st_name, [st_sex] = @st_sex, [st_brithdat] = @st_brithdat, [st_city] = @st_city WHERE [st_id] = @st_id">
            <DeleteParameters>
                <asp:Parameter Name="st_id" Type="String" />
            </DeleteParameters>
            <UpdateParameters>
                <asp:Parameter Name="st_name" Type="String" />
                <asp:Parameter Name="st_sex" Type="String" />
                <asp:Parameter Name="st_brithdat" Type="DateTime" />
                <asp:Parameter Name="st_city" Type="String" />
                <asp:Parameter Name="st_id" Type="String" />
            </UpdateParameters>
            <InsertParameters>
                <asp:Parameter Name="st_id" Type="String" />
                <asp:Parameter Name="st_name" Type="String" />
                <asp:Parameter Name="st_sex" Type="String" />
                <asp:Parameter Name="st_brithdat" Type="DateTime" />
                <asp:Parameter Name="st_city" Type="String" />
            </InsertParameters>
        </asp:SqlDataSource>
   
    </div>
        <asp:GridView ID="GridView1" runat="server" AllowPaging="True" AllowSorting="True"
            AutoGenerateColumns="False" DataKeyNames="st_id" DataSourceID="SqlDataSource1" CellPadding="4" ForeColor="#333333" GridLines="None">
            <Columns>
                <asp:CommandField ShowDeleteButton="True" ShowEditButton="True" />
                <asp:BoundField DataField="st_id" HeaderText="st_id" ReadOnly="True" SortExpression="st_id" />
                <asp:BoundField DataField="st_name" HeaderText="st_name" SortExpression="st_name" />
                <asp:BoundField DataField="st_sex" HeaderText="st_sex" SortExpression="st_sex" />
                <asp:BoundField DataField="st_brithdat" HeaderText="st_brithdat" SortExpression="st_brithdat" />
                <asp:BoundField DataField="st_city" HeaderText="st_city" SortExpression="st_city" />
            </Columns>
            <FooterStyle BackColor="#990000" Font-Bold="True" ForeColor="White" />
            <RowStyle BackColor="#FFFBD6" ForeColor="#333333" />
            <PagerStyle BackColor="#FFCC66" ForeColor="#333333" HorizontalAlign="Center" />
            <SelectedRowStyle BackColor="#FFCC66" Font-Bold="True" ForeColor="Navy" />
            <HeaderStyle BackColor="#990000" Font-Bold="True" ForeColor="White" />
            <AlternatingRowStyle BackColor="White" />
        </asp:GridView>
    </form>
</body>
</html>
   
2010-10-14 12:18
foktime
Rank: 11Rank: 11Rank: 11Rank: 11
来 自:奥斯维辛
等 级:贵宾
威 望:35
帖 子:795
专家分:2742
注 册:2009-9-4
收藏
得分:0 
OnSelecting事件 后台页没定义SqlDataSource1_Selecting
2010-10-14 14:49
筱晓绾
Rank: 10Rank: 10Rank: 10
来 自:湖南
等 级:贵宾
威 望:12
帖 子:512
专家分:1736
注 册:2010-9-1
收藏
得分:0 
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="SqlDataSource.aspx.cs" Inherits="Default2" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.

<html xmlns="http://www. >
<head runat="server">
    <title>无标题页</title>
</head>
<body>
    <form id="form1" runat="server">
    <div>
        <asp:SqlDataSource ID="SqlDataSource1" runat="server"
        ConnectionString="<%$ ConnectionStrings:StudentDBConnectionString %>"
            DeleteCommand="DELETE FROM [studentinfo] WHERE [st_id] = @st_id" InsertCommand="INSERT INTO [studentinfo] ([st_id], [st_name], [st_sex], [st_brithdat], [st_city]) VALUES (@st_id, @st_name, @st_sex, @st_brithdat, @st_city)"
            OnSelecting="SqlDataSource1_Selecting" SelectCommand="SELECT * FROM [studentinfo] ORDER BY [st_id]"
            UpdateCommand="UPDATE [studentinfo] SET [st_name] = @st_name, [st_sex] = @st_sex, [st_brithdat] = @st_brithdat, [st_city] = @st_city WHERE [st_id] = @st_id">
            <DeleteParameters>
                <asp:Parameter Name="st_id" Type="String" />
            </DeleteParameters>
            <UpdateParameters>
                <asp:Parameter Name="st_name" Type="String" />
                <asp:Parameter Name="st_sex" Type="String" />
                <asp:Parameter Name="st_brithdat" Type="DateTime" />
                <asp:Parameter Name="st_city" Type="String" />
                <asp:Parameter Name="st_id" Type="String" />
            </UpdateParameters>
            <InsertParameters>
                <asp:Parameter Name="st_id" Type="String" />
                <asp:Parameter Name="st_name" Type="String" />
                <asp:Parameter Name="st_sex" Type="String" />
                <asp:Parameter Name="st_brithdat" Type="DateTime" />
                <asp:Parameter Name="st_city" Type="String" />
            </InsertParameters>
        </asp:SqlDataSource>
   
    </div>
        <asp:GridView ID="GridView1" runat="server" AllowPaging="True" AllowSorting="True"
            AutoGenerateColumns="False" DataKeyNames="st_id" DataSourceID="SqlDataSource1" CellPadding="4" ForeColor="#333333" GridLines="None">
            <Columns>
                <asp:CommandField ShowDeleteButton="True" ShowEditButton="True" />
                <asp:BoundField DataField="st_id" HeaderText="st_id" ReadOnly="True" SortExpression="st_id" />
                <asp:BoundField DataField="st_name" HeaderText="st_name" SortExpression="st_name" />
                <asp:BoundField DataField="st_sex" HeaderText="st_sex" SortExpression="st_sex" />
                <asp:BoundField DataField="st_brithdat" HeaderText="st_brithdat" SortExpression="st_brithdat" />
                <asp:BoundField DataField="st_city" HeaderText="st_city" SortExpression="st_city" />
            </Columns>
            <FooterStyle BackColor="#990000" Font-Bold="True" ForeColor="White" />
            <RowStyle BackColor="#FFFBD6" ForeColor="#333333" />
            <PagerStyle BackColor="#FFCC66" ForeColor="#333333" HorizontalAlign="Center" />
            <SelectedRowStyle BackColor="#FFCC66" Font-Bold="True" ForeColor="Navy" />
            <HeaderStyle BackColor="#990000" Font-Bold="True" ForeColor="White" />
            <AlternatingRowStyle BackColor="White" />
        </asp:GridView>
    </form>
</body>
</html>
后台代码中没有SqlDataSource1_Selecting,鉴定完毕!
2010-10-14 16:10
dong3580
Rank: 2
等 级:论坛游民
威 望:1
帖 子:22
专家分:21
注 册:2010-3-5
收藏
得分:0 
没有定义SqlDataSource1_Selecting吧?
2010-10-14 22:31
快速回复:错误 1 “ASP.sqldatasource_aspx”并不包含“SqlDataSource1_Selecti ...
数据加载中...
 
   



关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.017970 second(s), 9 queries.
Copyright©2004-2024, BCCN.NET, All Rights Reserved