public void countMinor() { var ExcelPath2 = Application.StartupPath + "\\DB\\" + ConfigurationManager.AppSettings["ExcelDBPrize"]; DataSet ds = new DataSet(); OleDbConnection cn = null; OleDbDataAdapter cmd2 = null; cn = new OleDbConnection("provider=Microsoft.ACE.OLEDB.12.0;data source= " + ExcelPath2 + ";Extended Properties='Excel 12.0 XML;HDR=Yes;IMEX=1;'; "); cn.Open(); cmd2 = new OleDbDataAdapter("SELECT COUNT(Status) AS STAT FROM [Sheet1$] WHERE Status = 0", cn); cmd2.Fill(ds); //lblMinor.Text = cmd2.ToString(); cn.Close(); //lblprizeno.Text = ds.Tables[0].Rows[randomprize][0].ToString(); }
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)