public void UpdateSalesCallFactView()
        {
            // read ini sql
            string validCallSql = "";
            if (_dbManager.SalesppIniPath != null && _dbManager.SalesppIniPath != string.Empty)
            {
                IniFile iniFile = new IniFile(_dbManager.SalesppIniPath);
                validCallSql = iniFile.IniReadValue("FieldInformer", "VALIDCALL");
            }

            // run sproc
            SqlConnection conn = _dbManager.GetDataSourceConnection();
            conn.Open();
            SqlCommand cmd = conn.CreateCommand();
            try
            {
                cmd.CommandText = "EXEC spp.proc_create_V_OLAP_SALESCALL_FACT '" + validCallSql.Replace("'", "''") + "'";
                cmd.ExecuteNonQuery();
            }
            catch (Exception exc)
            {
                // ignore error cause otherwise default view will be created inside sproc
                exc = null;
            }
            finally
            {
                conn.Close();
                cmd.Dispose();
            }
        }
 /// <summary>
 /// 读取
 /// </summary>
 /// <returns></returns>
 public static string ReadFile(string key)
 {
     IniFile ini = new IniFile(path);
     return ini.IniReadValue("setting", key);
 }
Example #3
0
 public static string GetValue(string section, string key)
 {
     IniFile ini = new IniFile(Application.StartupPath + "\\config.cfg");
     return ini.IniReadValue(section, key);
 }