데이터베이스에서 데이터를 읽는 창 서비스를 만들었습니다. 그러나 데이터베이스에서 데이터를 읽지 않습니다. 디버깅하려고하지만 발생하지 않습니다. 내가 eventviewer.However에 기록되지 아니 eventviewer.but 로그인을 사용하여 여러 로그를 작성했습니다, 윈도우 폼 응용 프로그램의 모든 코드 작업이 코드는Visual Studio 2010에서 Window 서비스를 디버깅하는 방법
eventLog1.WriteEntry("GApps Sync is Collecting parameters from GUI seting", System.Diagnostics.EventLogEntryType.Information);
var folderPath = Path.Combine(Environment.GetFolderPath(
Environment.SpecialFolder.ApplicationData), "GAppsSync");
if (!Directory.Exists(folderPath))
{
eventLog1.WriteEntry("Please stop service and Run GUI Tool set all the syn parameter", System.Diagnostics.EventLogEntryType.Error);
}
path = Path.Combine(folderPath, "databaseFile.db3");
FileInfo fileInfo = new FileInfo(path);
if (fileInfo.Exists)
{
eventLog1.WriteEntry("GApps Sync is getting parameters from GUI tool", System.Diagnostics.EventLogEntryType.Information);
try
{
using (SQLiteConnection con = new SQLiteConnection("data source=" + path))
{
con.Open();
SQLiteCommand cmdSyncPara = new SQLiteCommand("Select SyncInterval, CRMSetting,GoogleSetting,SyncOption From Synchroniszation",con);
SQLiteDataReader dataReader = cmdSyncPara.ExecuteReader();
eventLog1.WriteEntry("GApps Sync is Reading database parameter:", System.Diagnostics.EventLogEntryType.Error);
while (dataReader.Read())
{
SyncInterval = dataReader.GetString(0);
eventLog1.WriteEntry("GApps Sync is getting parameters from GUI tool Syncinterval:" + SyncInterval, System.Diagnostics.EventLogEntryType.Information);
CRMSetting = dataReader.GetString(1);
eventLog1.WriteEntry("GApps Sync is getting parameters from GUI tool CRMSetting:" + CRMSetting, System.Diagnostics.EventLogEntryType.Information);
GoogleSetting = dataReader.GetString(2);
SyncOption = dataReader.GetString(3);
}
eventLog1.WriteEntry("GApps Sync got GUI sync Options and Sync Interval parameters", System.Diagnostics.EventLogEntryType.Information);
SQLiteCommand cmdReadData = new SQLiteCommand("Select Enable, GmailId,GmailPassword,EmployeeAccount From SyncDataDetail",con);
SQLiteDataReader dataReaderDetail = cmdReadData.ExecuteReader();
while (dataReaderDetail.Read())
{
DataContainer dc = new DataContainer();
dc.Enable = bool.Parse(dataReaderDetail.GetString(0));
dc.EmailText = dataReaderDetail.GetString(1);
dc.Password = Decrypt(dataReaderDetail.GetString(2));
dc.EmployeeAccount = dataReaderDetail.GetString(3);
ItemCollection.Add(dc);
}
eventLog1.WriteEntry("GApps Sync got GUI Save Account Mapping ", System.Diagnostics.EventLogEntryType.Information);
}
}
catch (Exception ex)
{
eventLog1.WriteEntry("GApps Sync Failed to get GUI Save Account Mapping ", System.Diagnostics.EventLogEntryType.Error);
}
}
}
이러한 일반적인 설명을 어떻게 도울 수 있습니까? 그것은 마치 '바퀴가 달려있어 엔진이 작동하지 않는다. 내 차는 달리지 않는다.'라고 말하는 것과 같다. ... –
코드를 추가했다. 일부 로그를 작성하지 않습니다 –