linq 查询 Linq 高级查询实例代码
[code]
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Text.RegularExpressions;
using System.IO;
using System.Text;
using System.Data;
namespace SJLERP
{
public partial class WebForm1 : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
Dictionary<string, string> cityAndNum =
Regex.Matches(City.data, @"[^\r].*?\r")
.Cast<Match>()
.Select(c => Regex.Replace(c.Value, @"\s", ""))
.Aggregate(new Dictionary<string, string>(), (reval, item) =>
{
if (Regex.IsMatch(item, @"[\u4e00-\u9fa5]+\d+"))
{
string word = Regex.Match(item, @"[\u4e00-\u9fa5]+").Value;
string num = Regex.Match(item, @"\d+").Value;
reval.Add(word, num);
}
return reval;
});
ADOHelper.ExecuteCommand("create table KaixuanTest ( city varchar(max),num varchar(max) ) ");
cityAndNum.ToList().ForEach(c =>
{
string sql = string.Format(" insert KaixuanTest select '{0}','{1}'",c.Key,c.Value);
ADOHelper.ExecuteCommand(sql);
});
}
}
}
相关文章
如何在ASP.NET Core应用程序运行Vue并且部署在IIS上详解
这篇文章主要给大家介绍了关于如何运行Vue在ASP.NET Core应用程序并且部署在IIS上的相关资料,文中通过图文介绍的非常详细,对大家的学习或者工作具有一定的参考学习价值,需要的朋友们下面随着小编来一起学习学习吧。2017-10-10
利用ASP.NET MVC和Bootstrap快速搭建个人博客之文章打赏功能(六)
这篇文章主要介绍了利用ASP.NET MVC和Bootstrap快速搭建个人博客之文章打赏功能(六) 的相关资料,非常不错,具有参考借鉴价值,需要的朋友可以参考下2016-07-07
VS2022 .NET5一键发布到远程腾讯云IIS服务器的详细步骤
这篇文章主要介绍了VS2022 .NET5一键发布到远程腾讯云IIS服务器,首先需要添加服务器相关功能,文中通过图文并茂的形式给大家介绍的非常详细,对大家的学习或工作具有一定的参考借鉴价值,需要的朋友可以参考下2022-04-04


最新评论