gpt4 book ai didi

c# - XML解析错误

转载 作者:太空宇宙 更新时间:2023-11-03 16:20:56 25 4
gpt4 key购买 nike

尝试在 C# 中的 Web 应用程序中实现下载功能时出现 XML 解析错误。相同的代码在另一个网络表单中工作。

SqlConnection cn = new SqlConnection();

cn.ConnectionString =ConfigurationManager.ConnectionStrings["cn"].ConnectionString.ToString();
cn.Open();

String abc = null;

SqlCommand cm = new SqlCommand("select User_ID from Mgmt where S_Name='" + DropDownList1.Text + "'", cn);

SqlDataReader dr = cm.ExecuteReader();

if (dr.Read())
{
abc = dr.GetString(0).ToString();
}

dr.Close();
cm.Dispose();

String ab = null;

SqlCommand cmd = new SqlCommand("select Result from Result where Clg_ID='" + abc + "'and Student_ID='" + TextBox1.Text + "'", cn);
SqlDataAdapter drr = new SqlDataAdapter(cmd);

DataSet ds = new DataSet();

drr.Fill(ds);

ab = ds.Tables[0].Rows[0][0].ToString();

Response.ContentType = "application/pdf";
Response.AppendHeader("Content-Disposition", "attachment; filename='"+ab+"'");
Response.TransmitFile(Server.MapPath("~/Result/"+ab));
Response.End();

cn.Close();

最佳答案

经过大量努力,我为自己的问题找到了可能的答案。这不是一个准确的答案。我刚换了我的电脑,然后这个错误就没有了,回到我以前的电脑时,错误也得到了解决。我仍然不知道导致错误的原因以及如何解决它。

关于c# - XML解析错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/13910234/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com