I have created a small Desktop [WinForm] data insertion application using C# VS2013 and SQLite database. It is working Fine and all the CURD Operation. But when I created Setup of this application using Advance Installer. Then whenever i run the application and try to Insert Data it popup this screen
And Thanks..
Here is Some Code Snipt.
//Add Property Function.
string ConnectionString = "Data Source=database/MyProperty.db;Version=3;Read Only=False";
public static long AddPropertyToDatabae( Property property )
{
SQLiteConnection con = new SQLiteConnection( ConnectionString );
SQLiteCommand cmd = new SQLiteCommand
{
Connection = con,
CommandText =
"INSERT INTO Properties (PropertyName,PropertyAddress,PropertyCity,PropertyState,PropertyZip,PropertyNotes)" +
" values (@Name,@Address,@City,@State,@Zip,@Notes)"
};
cmd.Parameters.AddWithValue( "@Name", property.PropertyName );
cmd.Parameters.AddWithValue( "@Address", property.PropertyAddress );
cmd.Parameters.AddWithValue( "@City", property.PropertyCity );
cmd.Parameters.AddWithValue( "@State", property.PropertyState );
cmd.Parameters.AddWithValue( "@Zip", property.PropertyZip );
cmd.Parameters.AddWithValue( "@Notes", property.PropertyNotes );
con.Open();
cmd.ExecuteNonQuery();
// Get the Last Inserted RowId.
cmd.CommandText = "select last_insert_rowid()";
long rowid = ( long )cmd.ExecuteScalar();
con.Close();
return rowid;
}
Note
This is 100% workring code on the VS. but it only generates error when i Create Setup of the Application

