How to operate Excel with OWC in Asp.Net
Editor to share with you how Asp.Net uses OWC to operate Excel, I believe most people do not know much about it, so share this article for your reference, I hope you can learn a lot after reading this article, let's go to know it!
The code is as follows:
String connstr = System.Configuration.ConfigurationManager.ConnectionStrings ["DqpiHrConnectionString"] .ToString ()
SqlConnection conn = new SqlConnection (connstr)
SqlDataAdapter sda = new SqlDataAdapter (sql1.Text, conn)
DataSet ds = new DataSet ()
Conn.Open ()
Sda.Fill (ds)
Conn.Close ()
OWC10.SpreadsheetClass xlsheet
Xlsheet= new OWC10.SpreadsheetClass ()
DataRow dr
Int I = 0
For (int ii=0;ii