Returning invalid rows when using EntityFramework for List <table>?

I am building a simple WinForms tool that uses the RankTrackr API and then waits for a callback to update a database table upon completion.

Before completion:

Keyword : matters postID : matters Returned : false

, the URL : null

, TimePosted : DateTime.Now

, TimeBack :null

Upon completion (this is what the tool is waiting for):

Keyword : matters postID : matters Returned : true

, the URL : matters TimePosted : matters TimeBack :DateTime.Now

Problem: When querying the database for -

List<ranktrackrTesting> KeywordList = db.ranktrackrTestings.Where(x =>
(x.PostID >= fpid && x.PostID <= lpid && x.URL != null)).ToList();

      

It returns items that are correct, lets say that if 2 strings are needed, it will return them two strings in a list, but mind you x.URL != null

.

This is what the list looks like:

List from database

Why is the URL null

when I specifically requested that it is not null. Plus the only way the tool gets to this point is when everyone returned with data in the URL column. I was checking the database uptime and running and the data is inserted in the correct row as shown below:

Row from database, after completion

Can anyone help with this? Thank you in advance.

It doesn't seem to be updated in the list correctly, and it looks like it would before completion.

Screenshot of the tool:

Screenshot of tool

The export button is activated when all rows are returned as completed with URL != null

, then the problem occurs on click. The tool will then try to put all records in List<table>

and point to the correct strings, however the URL will be null

.

+3


source to share





All Articles