Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8188269
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T02:51:02+00:00 2026-06-07T02:51:02+00:00

bool ret = false; try { SQLiteConnection sqlConn = new SQLiteConnection("Data Source=" + m_dbName);

  • 0
bool ret = false;
try
{
    SQLiteConnection sqlConn = new SQLiteConnection("Data Source=" + m_dbName);
    sqlConn.Open();
    SQLiteCommand sqlComm = sqlConn.CreateCommand();
    sqlComm.CommandText = "DELETE FROM " + szTablename + " WHERE name=" + name + "";
    SQLiteDataAdapter sqlAdapter = new SQLiteDataAdapter(sqlComm);
    if (null == sqlAdapter)
    {
        ret = false;
    }
    else
    {
        ret = true;
    }
    sqlConn.Close();
    return ret;
}
catch (SQLiteException sqlEx)
{
    Console.WriteLine(sqlEx.Message);
    return false;
}

I have that code to delete a row in an SQLite database, but nothing is done after I click the delete button.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-07T02:51:04+00:00Added an answer on June 7, 2026 at 2:51 am

    Instead of using a DataAdapter you could just execute the command directly:

    using(SQLiteConnection sqlConn = new SQLiteConnection("Data Source=" + m_dbName))
    {
        sqlConn.Open();
        //create command
    
        sqlCommand.ExecuteNonQuery();
    }
    

    You shouldn’t swallow any exceptions that get thrown from the ExecuteNonQuery method unless you can sensibly handle them. You should use parameterised queries instead of manually creating the queries by concatenating strings. You should also make sure you close the connection after you have finished using it as shown.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

bool hasDuplicate = false; int[] a = new int[] {1, 2, 3, 4}; int[]
bool isValid = false; string username = someadmin; If( !String.IsNullOrEmpty(username) && !( username.IndexOf(admin) !=
bool is_something_ok(int param,SomeStruct* p) { bool is_ok = false; // check if is_ok if(is_ok)
The problem is "after inserting a data using linq2sql & do submit changes ,
Here is some working code: std::pair<typename std::map< time_t, T >::iterator, bool> ret; ret =
bool myBool = true; byte myByte; This conversion runs myByte = Convert.ToByte(myBool); This conversion
BOOL utils::GetLogicDrivesByFreeSpace(LPTSTR pDrives) { TCHAR szBuff[257]; TCHAR chMaxDrive; DWORD dwLogicalDrives; ULARGE_INTEGER freeBytesAvaliable, maxFreeBytesAvaliable; ULARGE_INTEGER
bool operator()(Iterator it1, Iterator it2) const { return (*it1 < *it2); } Can someone
- (BOOL) ccTouchesEnded:(NSSet *)touches withEvent:(UIEvent *)event { CocosNode* spHead = [self getChildByTag:tagHead]; CocosNode* spBody
-(BOOL) textFieldShouldReturn:(UITextField*) theTextField{ [theTextField resignFirstResponder]; return YES; } it is not working....

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.