C# 导入Excel文件并插入RavenDB
我想上传一个excel文件并将每条记录存储到RavenDb中 代码类似于C# 导入Excel文件并插入RavenDB,c#,asp.net-mvc,file-upload,ravendb,C#,Asp.net Mvc,File Upload,Ravendb,我想上传一个excel文件并将每条记录存储到RavenDb中 代码类似于 string excelConnectionString = @"Provider=Microsoft.ACE.OLEDB.12.0;Data Source=" + path1 + ";Extended Properties=Excel 12.0;Persist Security Info=False"; OleDbConnection excelConnection =
string excelConnectionString = @"Provider=Microsoft.ACE.OLEDB.12.0;Data Source=" + path1 + ";Extended Properties=Excel 12.0;Persist Security Info=False";
OleDbConnection excelConnection = new OleDbConnection(excelConnectionString);
OleDbCommand cmd = new OleDbCommand("Select * from [Sheet1$]", excelConnection);
excelConnection.Open();
OleDbDataReader dReader;
dReader = cmd.ExecuteReader();
我不知道在executereader之后我需要做什么,任何人都可以向我展示解决方案???你有使用RavenDB的经验吗 以下是一些要点:
var documentStore = new EmbeddableDocumentStore{ DataDirectory = "Data" };
session.Store(entity); session.SaveChanges();