C# 到数据库的XML连接(ASP.NET)

C# 到数据库的XML连接(ASP.NET),c#,asp.net,xml,database,C#,Asp.net,Xml,Database,我正在尝试将XML文件连接到数据库,但我认为这无法识别XML文件,因为我不断收到错误: System.ArgumentNullException:'值不能为null。参数名称:表' 我正在使用ASP.NET的网站。其思想是,当我试图按下按钮进行更改时,数据库应该将XML文件内容存储到名为fileNAME的数据库表中。 aspx的代码为: <div id="pageBody"> <!--

我正在尝试将XML文件连接到数据库,但我认为这无法识别XML文件,因为我不断收到错误: System.ArgumentNullException:'值不能为null。参数名称:表' 我正在使用ASP.NET的网站。其思想是,当我试图按下按钮进行更改时,数据库应该将XML文件内容存储到名为fileNAME的数据库表中。 aspx的代码为:

                <div id="pageBody">
                    <!--  lower part of webpage-->
                    <form id="fileChangeForm" runat="server">
                        <div class="container">
                            <asp:textbox id="fileChangeTextbox" placeholder="Enter new news file for the newest news" runat="server"/>
                            
                            <asp:Button runat="server" id="fileChangeButton" Text="Make changes!" OnClick="fileChangeButton_Click" CssClass="cancelbtn"/>
                            <asp:SqlDataSource ID="SqlDataSource1" runat="server" ConnectionString="<%$ ConnectionStrings:ConnectionString %>" SelectCommand="SELECT * FROM [fileNAME]"></asp:SqlDataSource>
                            <br />
                            <br />
                            <asp:Button runat="server" id="logOut" Text="Bye bye... log me out" OnClick="logOut_Click" CssClass="cancelbtn"/>
                        </div>
                    </form>
                </div>
XML文件是:

<?xml version="1.0" encoding="UTF-8"?>
<News>
    <NewsPiece>
        <Title>SpaceX's Next Starship Prototype Taking Shape</Title>
        <Content>Construction of the test craft is proceeding apace, as two new photos posted on Twitter today (Sept. 17) by company founder and CEO Elon Musk reveal.</Content>
    </NewsPiece>
    <NewsPiece>
        <Title>NASA's Juno Mission Cheks Out Eclipse on Jupiter</Title>
        <Content>All is well on our largest neighbor; NASA's Juno spacecraft just managed to spot the shadow of Jupiter's moon, Io, passing over its marbled clouds.</Content>
    </NewsPiece>
    <NewsPiece>
        <Title>Europe Wants Ideas for Cave-Spelumking Moon Robots</Title>
        <Content>As NASA makes a big push to land humans on the moon's surface by 2024, the European Space Agency (ESA) wants to learn more about the lunar caves that lie beneath.</Content>
    </NewsPiece>
</News>

SpaceX的下一个星际飞船原型成形
该公司创始人兼首席执行官埃隆·马斯克(Elon Musk)今天(9月17日)在推特上发布的两张新照片显示,试验飞船的建造正在快速进行。
美国宇航局朱诺号任务在木星上发现日食
我们最大的邻居一切顺利;美国宇航局的朱诺号宇宙飞船刚刚成功地发现了木星卫星木卫一的影子,木卫一正穿过它的大理石云。
欧洲想要洞穴探月机器人的想法
随着美国宇航局大力推动人类在2024年前登上月球表面,欧洲航天局(ESA)希望更多地了解月球下面的洞穴。
有谁知道到数据库的XML连接有什么问题吗


提前谢谢大家。

在这里发布问题之前,请先进行一些基本调试。
SelectCommand=“SELECT*FROM[fileNAME]
SqlDataSource中的fileNAME参数是什么?@kshkarin fileNAME是我在数据库中创建的表。所以从[fileNAME]中选择*我想选择表中的所有列。哪一行代码抛出了
ArgumentNullException
?请在报告错误时提供清楚的详细信息。@ADyson我刚刚添加了一条注释以显示错误的来源。它位于aspx.cs代码“sb.WriteToServer(dtfile)”中
<?xml version="1.0" encoding="UTF-8"?>
<News>
    <NewsPiece>
        <Title>SpaceX's Next Starship Prototype Taking Shape</Title>
        <Content>Construction of the test craft is proceeding apace, as two new photos posted on Twitter today (Sept. 17) by company founder and CEO Elon Musk reveal.</Content>
    </NewsPiece>
    <NewsPiece>
        <Title>NASA's Juno Mission Cheks Out Eclipse on Jupiter</Title>
        <Content>All is well on our largest neighbor; NASA's Juno spacecraft just managed to spot the shadow of Jupiter's moon, Io, passing over its marbled clouds.</Content>
    </NewsPiece>
    <NewsPiece>
        <Title>Europe Wants Ideas for Cave-Spelumking Moon Robots</Title>
        <Content>As NASA makes a big push to land humans on the moon's surface by 2024, the European Space Agency (ESA) wants to learn more about the lunar caves that lie beneath.</Content>
    </NewsPiece>
</News>