Click here to Skip to main content
15,913,773 members
Home / Discussions / C#
   

C#

 
AnswerRe: WinForm Database is locked SQLite Pin
Simon_Whale22-Apr-15 4:29
Simon_Whale22-Apr-15 4:29 
AnswerRe: WinForm Database is locked SQLite Pin
Sascha Lefèvre22-Apr-15 4:42
professionalSascha Lefèvre22-Apr-15 4:42 
GeneralRe: WinForm Database is locked SQLite Pin
DPaul199422-Apr-15 5:34
DPaul199422-Apr-15 5:34 
GeneralRe: WinForm Database is locked SQLite Pin
Sascha Lefèvre22-Apr-15 5:46
professionalSascha Lefèvre22-Apr-15 5:46 
GeneralRe: WinForm Database is locked SQLite Pin
DPaul199422-Apr-15 8:28
DPaul199422-Apr-15 8:28 
GeneralRe: WinForm Database is locked SQLite Pin
Sascha Lefèvre22-Apr-15 8:38
professionalSascha Lefèvre22-Apr-15 8:38 
GeneralRe: WinForm Database is locked SQLite Pin
DPaul199422-Apr-15 9:10
DPaul199422-Apr-15 9:10 
GeneralRe: WinForm Database is locked SQLite Pin
Sascha Lefèvre22-Apr-15 9:24
professionalSascha Lefèvre22-Apr-15 9:24 
I don't think this is the issue but for good practice you should change this like so:
C#
string selectareLicenta = "SELECT licenta FROM licente WHERE licenta = '" + maskedTextBox1.Text + "'";
using (SQLiteConnection conn = Conexiune.getConnection())
using (SQLiteCommand cmd = new SQLiteCommand(selectareLicenta, conn))
using (SQLiteDataReader read = cmd.ExecuteReader(CommandBehavior.CloseConnection))
{
    if (read.Read())
    {
        SimulatorManager.Licenta = read["licenta"].ToString();
    }
    // no need to explicitly close the reader when used in a using-block
}

..and you also should use an Sql-Parameter here.

Regarding the actual problem: I would suggest you double-check that all parts of your code where you run a select-query look like the above to ensure that the reader and connection get properly closed.

For the purpose of testing you could execute an update-statement as the very first action in your program and see if that works.
If the brain were so simple we could understand it, we would be so simple we couldn't. — Lyall Watson

GeneralRe: WinForm Database is locked SQLite Pin
DPaul199422-Apr-15 9:44
DPaul199422-Apr-15 9:44 
GeneralRe: WinForm Database is locked SQLite Pin
DPaul199422-Apr-15 9:53
DPaul199422-Apr-15 9:53 
GeneralRe: WinForm Database is locked SQLite Pin
Sascha Lefèvre22-Apr-15 9:58
professionalSascha Lefèvre22-Apr-15 9:58 
GeneralRe: WinForm Database is locked SQLite Pin
DPaul199422-Apr-15 9:59
DPaul199422-Apr-15 9:59 
GeneralRe: WinForm Database is locked SQLite Pin
DPaul199422-Apr-15 9:57
DPaul199422-Apr-15 9:57 
GeneralRe: WinForm Database is locked SQLite Pin
Sascha Lefèvre22-Apr-15 10:04
professionalSascha Lefèvre22-Apr-15 10:04 
GeneralRe: WinForm Database is locked SQLite Pin
DPaul199422-Apr-15 10:08
DPaul199422-Apr-15 10:08 
GeneralRe: WinForm Database is locked SQLite Pin
Sascha Lefèvre22-Apr-15 10:10
professionalSascha Lefèvre22-Apr-15 10:10 
SuggestionRe: WinForm Database is locked SQLite Pin
Richard Deeming22-Apr-15 4:43
mveRichard Deeming22-Apr-15 4:43 
GeneralRe: WinForm Database is locked SQLite Pin
DPaul199422-Apr-15 5:27
DPaul199422-Apr-15 5:27 
QuestionHow to register the library flash for C# 2005 ? Pin
Member 245846721-Apr-15 17:53
Member 245846721-Apr-15 17:53 
QuestionIf a class can call its base constructor then why the constructor is not inherited Pin
CRobert45621-Apr-15 17:04
CRobert45621-Apr-15 17:04 
GeneralRe: If a class can call its base constructor then why the constructor is not inherited Pin
PIEBALDconsult21-Apr-15 17:15
mvePIEBALDconsult21-Apr-15 17:15 
GeneralRe: If a class can call its base constructor then why the constructor is not inherited Pin
CRobert45621-Apr-15 17:26
CRobert45621-Apr-15 17:26 
GeneralRe: If a class can call its base constructor then why the constructor is not inherited Pin
PIEBALDconsult21-Apr-15 17:32
mvePIEBALDconsult21-Apr-15 17:32 
GeneralRe: If a class can call its base constructor then why the constructor is not inherited Pin
Matt T Heffron22-Apr-15 9:53
professionalMatt T Heffron22-Apr-15 9:53 
GeneralRe: If a class can call its base constructor then why the constructor is not inherited Pin
David A. Gray3-May-15 10:26
David A. Gray3-May-15 10:26 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.