프로젝트

일반

사용자정보

개정판 d327a608

IDd327a6081c08f7db300ce67ba52cea2dc5f26be4
상위 465c8b6e
하위 c7db500b

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

dev issue #1223 : project info 정리 및 converter form 개발

Change-Id: I3e9d87f2f2218a1c1ace702e9f62b8d08beb2e2d

차이점 보기:

DTI_PID/APIDConverter/DB/Project_DB.cs
179 179

  
180 180
            return dt;
181 181
        }
182
        public static DataTable SelectSymbolType()
183
        {
184
            DataTable dt = new DataTable();
185
            Project_Info projectInfo = Project_Info.GetInstance();
186
            if (projectInfo.DBType == ID2DB_Type.SQLite)
187
            {
188
                using (SQLiteConnection connection = new SQLiteConnection(string.Format(CultureInfo.CurrentCulture, "Data Source = {0}", projectInfo.DBFilePath)))
189
                {
190
                    try
191
                    {
192
                        connection.Open();
193
                        using (SQLiteCommand cmd = connection.CreateCommand())
194
                        {
195
                            cmd.CommandText = string.Format("SELECT * FROM {0}", SymbolType_TABLE);
196
                            using (SQLiteDataReader dr = cmd.ExecuteReader())
197
                                dt.Load(dr);
198
                        }
199
                        connection.Close();
200
                    }
201
                    catch (Exception ex)
202
                    {
203
                        Log.Write(ex.Message + "\r\n" + ex.StackTrace);
204
                    }
205
                    finally
206
                    {
207
                        connection.Dispose();
208
                    }
209
                }
210
            }
211
            else if (projectInfo.DBType == ID2DB_Type.MSSQL)
212
            {
213
                using (SqlConnection connection = GetSqlConnection())
214
                {
215
                    try
216
                    {
217
                        if (connection != null && connection.State == ConnectionState.Open)
218
                        {
219
                            using (SqlCommand cmd = connection.CreateCommand())
220
                            {
221
                                cmd.CommandText = string.Format("SELECT * FROM {0}", SymbolType_TABLE);
222
                                using (SqlDataReader dr = cmd.ExecuteReader())
223
                                    dt.Load(dr);
224
                            }
225
                            connection.Close();
226
                        }
227
                    }
228
                    catch (Exception ex)
229
                    {
230
                        Log.Write(ex.Message + "\r\n" + ex.StackTrace);
231
                    }
232
                    finally
233
                    {
234
                        if (connection != null)
235
                            connection.Dispose();
236
                    }
237
                }
238
            }
182 239

  
240
            return dt;
241
        }
183 242
    }
184 243
}

내보내기 Unified diff

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