DataSet ds = new DataSet();
string filePath = FileUpload1.PostedFile.FileName.ToString();
try
{
if (filePath == " ")
{
Response.Write("<script language='javascript'>alert('文件路径不能为空!')</script>");
}
else
{
ds.ReadXml(filePath);
gvPersonList.DataSource = ds.Tables[0];
gvPersonList.DataBind();
}
}
catch(Exception)
{
Response.Write("<script language='javascript'>alert('导入不正确!')</script>");
}
网站标题:xml文件读取后绑定到gridview
标题网址:https://www.cdcxhl.com/article28/ggodjp.html
成都网站建设公司_创新互联,为您提供App设计、用户体验、商城网站、微信小程序、全网营销推广、关键词优化
广告
声明:本网站发布的内容(图片、视频和文字)以用户投稿、用户转载内容为主,如果涉及侵权请尽快告知,我们将会在第一时间删除。文章观点不代表本网站立场,如需处理请联系客服。电话:028-86922220;邮箱:631063699@qq.com。内容未经允许不得转载,或转载时需注明来源:
创新互联