Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

SQL Server CE error - only on compiled code

I have a strange error which causes my application to crash. It only happens when compiled and installed via a click-once and not when debugging in Visual Studio.

Viewing the event log gives me this:

<Event xmlns="http://schemas.microsoft.com/win/2004/08/events/event">
  <System>
    <Provider Name="Windows Error Reporting" /> 
    <EventID Qualifiers="0">1001</EventID> 
    <Level>4</Level> 
    <Task>0</Task> 
    <Keywords>0x80000000000000</Keywords> 
    <TimeCreated SystemTime="2015-04-27T14:51:30.000000000Z" /> 
    <EventRecordID>6471</EventRecordID> 
    <Channel>Application</Channel> 
    <Computer>me.local</Computer> 
    <Security /> 
  </System>
- <EventData>
    <Data /> 
    <Data>0</Data> 
    <Data>CLR20r3</Data> 
    <Data>Not available</Data> 
    <Data>0</Data> 
    <Data>calibration certificate builder</Data> 
    <Data>1.0.0.0</Data> 
    <Data>553e4aaa</Data> 
    <Data>System.Data.SqlServerCe</Data> 
    <Data>3.5.8080.0</Data> 
    <Data>4b743b2d</Data> 
    <Data>e3</Data> 
    <Data>0</Data> 
    <Data>System.ArgumentNullException</Data> 
    <Data /> 
    <Data>C:\Users\me\AppData\Local\Temp\WER80E0.tmp.WERInternalMetadata.xml</Data> 
    <Data>C:\Users\me\AppData\Local\Microsoft\Windows\WER\ReportArchive\AppCrash_pick_cert_e053eebdc3d787d726058a9b0d3405c6f279444_3b258dcb</Data> 
    <Data /> 
    <Data>0</Data> 
    <Data>e12fbed6-ecec-11e4-b276-24fd52358985</Data> 
    <Data>65</Data> 
  </EventData>
</Event>

I am unsure how to handle this. I have looked through my code and it does not appear to be an issue there. It does seem to be within the SQL Server CE code somewhere but I have been unable to find it.

I also pushed the event.ExceptionObject string to a text file and got this:

System.ArgumentNullException: Value cannot be null. at System.Threading.Monitor.Enter(Object obj) at System.Data.SqlServerCe.SqlCeCommand.Dispose(Boolean disposing) at System.Data.SqlServerCe.SqlCeCommand.Finalize()

Can anyone help me interpret this?

I have removed the use of the SQL CE services from other threads. I also removed the disposing of the SQL CE connection and also the finally blocks but the error logs remain the same.

Is the disposal of the connection causing an issue?

like image 843
redned Avatar asked Apr 27 '15 15:04

redned


1 Answers

I am guessing that you are trying to connect with SQL database using windows authentication connection string and that person does not have access to sql database. Try to change the connection string with an user ID and password. Change from "Data Source=URDATABASE;Initial Catalog=MYDATABASE;Integrated Security=True" to "Data Source=URDATABASE;Initial Catalog=MYDATABASE;Uid=UrUserID;Pwd=MyPassWord;"

like image 181
Nand Kishor Swami Avatar answered Nov 04 '22 02:11

Nand Kishor Swami