How can i do that?
two file
one is update data to database

first step
i will define two sesion to write the operating table and operating columns in server.
two step
tell the customer where and how many columns they can update.

列显示名称1:真实列名1#列显示名称1:真实列名1#列显示名称1:真实列名1

//get the data from excle
string strConn="Provider=Microsoft.Jet.OleDb.4.0;Data Source=d:\\收支表.XLS;Extended Properties=\"Excel 8.0;\"";
OleDbConnection conn=new OleDbConnection(strConn);
conn.Open();
OleDbDataAdapter da=new OleDbDataAdapter("select * from [Sheet1$]",conn);
DataSet ds=new DataSet();
//import data to a dataset
da.Fill(ds,“tablename“);

//define sql Dataadapter
define a dataadapter
SqlDataAdapter adapter = new SqlDataAdapter();
adapter.SelectCommand = new SqlCommand(query, conn);
adapter.Update(ds,“tablename“)




another is import data to database

相关文章:

  • 2021-06-24
  • 2021-11-17
  • 2021-11-06
  • 2021-11-08
  • 2022-12-23
  • 2021-09-29
  • 2021-10-08
  • 2022-12-23
猜你喜欢
  • 2021-07-22
  • 2022-12-23
  • 2021-07-31
  • 2022-12-23
  • 2021-10-27
  • 2022-12-23
  • 2022-02-11
相关资源
相似解决方案