c# - How to reslove the error of service -
i have .net project [scenario] in i:
1. downloaded files winscp.com library in .net 2. parsed them, created tokens, inserted them sql-db using linq sql.
problem during converting service:
the downloading part goes fine when run service *********************************************************************** when pushing db using linq sql gives exception without entering single row in db
i not know, why so. kindly me if 1 knows mistake being made me.
note:
the exception found using eventlog under:
application: errlogsservice_57_92.exe framework version: v4.0.30319 description: process terminated due unhandled exception. exception info: system.data.sqlclient.sqlexception stack: @ system.data.linq.datacontext.submitchanges(system.data.linq.conflictmode) @ errlogsservice_57_92.errlogscreation.read_log_file(system.string, int32, int32) @ errlogsservice_57_92.errlogscreation.parsefileandpush(int32) @ system.threading.executioncontext.runinternal(system.threading.executioncontext, system.threading.contextcallback, system.object, boolean) @ system.threading.executioncontext.run(system.threading.executioncontext, system.threading.contextcallback, system.object, boolean) @ system.threading.executioncontext.run(system.threading.executioncontext, system.threading.contextcallback, system.object) @ system.threading.threadhelper.threadstart()
the code inserting data is:
if (checklineerrornot(line_str_is)) { sql_db_logs_adatacontext rowinsert = new sql_db_logs_adatacontext(); col1 = get1_column_datetime(line_str_is, 0); col2 = get2_column_javafilename(line_str_is, 59); col3 = get3_column_portnumber(line_str_is, 90); col4 = get4_column_errorstring(line_str_is, endindexof_javafile, line_str_is.length); // request creation insert error-logs logserror insertqry = new logserror { datetime = col1.tostring(), filename = col2.tostring(), portnumber = col3.tostring(), errorstring = col4.tostring(), id_ip = (int)ip, id_file = (int)id_file_is }; rowinsert.logserrors.insertonsubmit(insertqry); rowinsert.submitchanges(); } else { ; }
Comments
Post a Comment