Quantcast
Channel: Xamarin.Forms — Xamarin Community Forums
Viewing all articles
Browse latest Browse all 91519

Cannot delete String: it has no PK

$
0
0

Hi,
I have a SQLite database, each table having an autoincrement ID field as a primary key. Then I want to clear a table, I pass a table name into a routine and do...
public static async Task ClearTable(string tablename)
{

        try
        {
            lock (locker)
            {
                RWBDatabase.database.Delete(tablename);
            }
        }
        catch (Exception ex)
        {
            Debug.WriteLine(ex.ToString());
            return false;
        }
        return true;
    }

I always get a failure of Cannot delete String: it has no PK.

Thanks

Pete


Viewing all articles
Browse latest Browse all 91519

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>