프로젝트

일반

사용자정보

개정판 465c8b6e

ID465c8b6ec266d69745543255c798c2c36a5ab9ca
상위 43541380
하위 d327a608

gaqhf 이(가) 5년 이상 전에 추가함

dev issue #1223 : add Log

Change-Id: I347b0bd0f70f1a50e62cf9dbe65b6470eead4a25

차이점 보기:

DTI_PID/APIDConverter/DB/Project_DB.cs
49 49
            }
50 50
            catch (Exception ex)
51 51
            {
52
                //Log.Write(ex.Message + "\r\n" + ex.StackTrace);
52
                Log.Write(ex.Message + "\r\n" + ex.StackTrace);
53 53
                if (connection != null)
54 54
                    connection.Dispose();
55 55
                connection = null;
......
81 81
                    }
82 82
                    catch (Exception ex)
83 83
                    {
84
                        //Log.Write(ex.Message + "\r\n" + ex.StackTrace);
84
                        Log.Write(ex.Message + "\r\n" + ex.StackTrace);
85 85
                    }
86 86
                    finally
87 87
                    {
......
106 106
                    }
107 107
                    catch (Exception ex)
108 108
                    {
109
                        //Log.Write(ex.Message + "\r\n" + ex.StackTrace);
109
                        Log.Write(ex.Message + "\r\n" + ex.StackTrace);
110 110
                    }
111 111
                    finally
112 112
                    {
......
118 118

  
119 119
            return result;
120 120
        }
121
        
121

  
122
        public static DataTable SelectID2SymbolTable()
123
        {
124
            DataTable dt = new DataTable();
125
            Project_Info projectInfo = Project_Info.GetInstance();
126
            if (projectInfo.DBType == ID2DB_Type.SQLite)
127
            {
128
                using (SQLiteConnection connection = new SQLiteConnection(string.Format(CultureInfo.CurrentCulture, "Data Source = {0}", projectInfo.DBFilePath)))
129
                {
130
                    try
131
                    {
132
                        connection.Open();
133
                        using (SQLiteCommand cmd = connection.CreateCommand())
134
                        {
135
                            cmd.CommandText = @"SELECT * FROM Symbol";
136
                            using (SQLiteDataReader dr = cmd.ExecuteReader())
137
                                dt.Load(dr);
138
                        }
139
                        connection.Close();
140
                    }
141
                    catch (Exception ex)
142
                    {
143
                        Log.Write(ex.Message + "\r\n" + ex.StackTrace);
144
                    }
145
                    finally
146
                    {
147
                        connection.Dispose();
148
                    }
149
                }
150
            }
151
            else if (projectInfo.DBType == ID2DB_Type.MSSQL)
152
            {
153
                using (SqlConnection connection = GetSqlConnection())
154
                {
155
                    try
156
                    {
157
                        if (connection != null && connection.State == ConnectionState.Open)
158
                        {
159
                            using (SqlCommand cmd = connection.CreateCommand())
160
                            {
161
                                cmd.CommandText = @"SELECT * FROM Symbol";
162
                                using (SqlDataReader dr = cmd.ExecuteReader())
163
                                    dt.Load(dr);
164
                            }
165
                            connection.Close();
166
                        }
167
                    }
168
                    catch (Exception ex)
169
                    {
170
                        Log.Write(ex.Message + "\r\n" + ex.StackTrace);
171
                    }
172
                    finally
173
                    {
174
                        if (connection != null)
175
                            connection.Dispose();
176
                    }
177
                }
178
            }
179

  
180
            return dt;
181
        }
182

  
122 183
    }
123 184
}

내보내기 Unified diff

클립보드 이미지 추가 (최대 크기: 500 MB)