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一鍵發(fā)布到遠程騰訊云IIS服務器的詳細步驟
這篇文章主要介紹了VS2022?.NET5一鍵發(fā)布到遠程騰訊云IIS服務器,首先需要添加服務器相關功能,文中通過圖文并茂的形式給大家介紹的非常詳細,對大家的學習或工作具有一定的參考借鑒價值,需要的朋友可以參考下2022-04-04

