1

Here is my code :

BookMark[] st = CSDatabase.RunQuery<BookMark>(
            @"SELECT * FROM Bookmark WHERE link='" + link + "'");

class BookMark
{
    public string link;
}

Sometimes I get a NullReferenceException but I don't why.

Please help me!

ctacke
  • 66,480
  • 18
  • 94
  • 155
thongaduka
  • 627
  • 1
  • 8
  • 19

2 Answers2

1

If you are using a sqlite Database the problem is due to the sqlite database set to an encoding other than UTF-8. Just create a new sqlite database in the UTF-8 encoding and the error will go away.

ЯegDwight
  • 24,821
  • 10
  • 45
  • 52
0

You've given us almost nothing to go by. I'd guess you get the exception because the link variable in your code is null.

ctacke
  • 66,480
  • 18
  • 94
  • 155