예제 #1
0
        internal void InsertLanguageData(Workspace workspace, ResourceType resourceType)
        {
            fxLanguages languages = new fxLanguages();
            fxLanguage  language  = languages.Choose();

            AstoriaTestLog.TraceInfo("Language Data: " + language.GetType().Name);

            // do them one at a time so that if one fails, we know which
            using (SqlConnection sqlConn = new SqlConnection(this.MachineConnectionString))
            {
                sqlConn.Open();
                for (int i = 0; i < 5; i++)
                {
                    using (SqlCommand sqlCmd = sqlConn.CreateCommand())
                    {
                        sqlCmd.CommandTimeout = 0;
                        sqlCmd.CommandText    = GetInsertString(workspace, resourceType, language, TestUtil.Random);
                        try
                        {
                            sqlCmd.ExecuteNonQuery();
                        }
                        catch (SqlException error)
                        {
                            AstoriaTestLog.WriteLineIgnore("Error while executing: " + sqlCmd.CommandText);
                            throw;
                        }
                    }
                }
            }
        }
예제 #2
0
        internal void InsertLanguageData(Workspace workspace, ResourceType resourceType)
        {
            fxLanguages languages = new fxLanguages();
            fxLanguage language = languages.Choose();
            AstoriaTestLog.TraceInfo("Language Data: " + language.GetType().Name);

            // do them one at a time so that if one fails, we know which
            using (SqlConnection sqlConn = new SqlConnection(this.MachineConnectionString))
            {
                sqlConn.Open();
                for (int i = 0; i < 5; i++)
                {
                    using (SqlCommand sqlCmd = sqlConn.CreateCommand())
                    {
                        sqlCmd.CommandTimeout = 0;
                        sqlCmd.CommandText = GetInsertString(workspace, resourceType, language, TestUtil.Random);
                        try
                        {
                            sqlCmd.ExecuteNonQuery();
                        }
                        catch (SqlException error)
                        {
                            AstoriaTestLog.WriteLineIgnore("Error while executing: " + sqlCmd.CommandText);
                            throw;
                        }
                    }
                }
            }
        }