Click here to Skip to main content
15,899,679 members
Home / Discussions / C#
   

C#

 
AnswerRe: How to change ip in webBrowser control Pin
Richard MacCutchan22-Apr-15 6:35
mveRichard MacCutchan22-Apr-15 6:35 
GeneralRe: How to change ip in webBrowser control Pin
hapiten22-Apr-15 6:55
hapiten22-Apr-15 6:55 
GeneralRe: How to change ip in webBrowser control Pin
Richard MacCutchan22-Apr-15 7:03
mveRichard MacCutchan22-Apr-15 7:03 
AnswerRe: How to spoof ip in webBrowser control Pin
Eddy Vluggen22-Apr-15 9:01
professionalEddy Vluggen22-Apr-15 9:01 
QuestionWinForm Database is locked SQLite Pin
DPaul199422-Apr-15 4:20
DPaul199422-Apr-15 4:20 
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 
First, thank you for suggestions. So: Conexiune is a class. getConnection() is a function that makes the connection and return true if connection is opened. So I can't use that var connection. I used this code in other forms and it worked..I want to update indexrow column with the value of int variable idintrebare..So I rewrite your code like this:
C#
string update = "UPDATE questions SET indexrow=@idintrebare WHERE id=@idintrebare;";
            using (var connection = Conexiune.getConnection())
            using (SQLiteCommand cmd = new SQLiteCommand(update, connection))
            {
                connection.Open();
                cmd.Parameters.AddWithValue("@idintrebare", idintrebare);
                cmd.ExecuteNonQuery();
            }
,but I receive Operation is not valid due to the current state of the object.

Conexiune class looks like this: (This is good)
C#
private static string conn = @"Data Source=database.db;Pooling=true;FailIfMissing=false;Version=3;";
        public static SQLiteConnection connect = null;
        private Conexiune() { }
        public static SQLiteConnection getConnection()
        {
            SQLiteConnection connect = null;
            try
            {
                connect = new SQLiteConnection(conn);
                connect.Open();
                return connect;
            }
            catch (SQLiteException e)
            {
                throw new Exception("Cannot connect", e);
            }
        }

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 
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 

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.