Access to table element

May 17, 2012 at 6:51 AM

I s it possible to access e.g. "First Name" and compare it with some other string. 

Coordinator
May 18, 2012 at 12:03 AM

Yes, just use Linq.  Something like

If I follow the question correctly, just issues a query like
var table = await db.Table<User>();

var person = table.Where(one=>one.Name = someNameVariable && one.Passwrd ==
somePasswordVariable).FirstOrDefault(), then check for null. It is just
data, so you do whatever action you need to with it.
Thanks.

May 18, 2012 at 9:49 AM

 

 

 

I was working with your WinRTdbQuickstart example and i have "russia" as a entry for "Firstname". 

it didn't work always return null

  

 

MainViewModel min = new MainViewModel ();

 var personia = min.People.Where((one => one.FirstName == "russia" )).FirstOrDefault();  

//People is variable defined by you  in MainViewModel.cs    

 

if (personia == null

)

{

 

MessageDialog msg = new MessageDialog("hiiifgfgfgfgfgfgfgfgfgfgfgfgfg"

);

msg.ShowAsync();

}

 

 tell me if I am doing something wrong ?       

 

Coordinator
May 18, 2012 at 11:43 AM

You must not have any data in People to match your criteria?