Excel.Application excel = new Excel.Application ();
excel.Application.Workbooks.Add ( true );
string ConnString= "workstation id=WEIXIONG;packet size=4096;integrated security=SSPI;data source=WEIXIONG;persist security info=False;initial catalog=web ";
SqlConnection cn=new SqlConnection(ConnString);
cn.Open();
string s= "select * from ImageStore ";
SqlCommand cmd=new SqlCommand(s,cn);
SqlDataReader dr=cmd.ExecuteReader();
Excel.Application xlApp=new Excel.ApplicationClass();
if(xlApp==null)
{
MessageBox.Show( "Excel錯誤 ");
return;
}
xlApp.Application.Workbooks.Add(true)