hi frnds....
As we do in ADO.net with dataset , get the data from database and store in c# variable.
The same thin i want to do with linq.
When a user get login i want to get all the information of user from database and store in c# static variable.
But i dnt get idea that how it will be do with linq.
So please lead me if you know..
Thanks
Loading


Abhinav Golwalkar87 reputationPosted Dec 17, 2013, 7:13 PM EST
You can get the user information like this;
var userInfo= _contect.users.Where(usr => (usr.UserName == someusernametocheck && usr.Password == somepasswordtocheck).FirstOrDefaut();
if(userInfo != null)
{
// You got your user in database
//assign in some static variable
LoggedInuser = userInfo;
}
Jignesh TrivediRank #16 · 50.3K reputationPosted Dec 17, 2013, 10:18 PM EST
hi,
it depend what method are you using to retrieve the data from database.
are you use Entity framework as DAL or use any other method?
LINQ is more useful when you use entity framework as DAL or you want retrieve data from stored collection.
Mukesh Kumar TiwariRank #1,774 · 844 reputationPosted Dec 19, 2013, 1:20 AM EST
Hey jignesh i m facing an another problem with linq.
when i m making an exe of the project then vs2008 show that Building failed.
But my exe generate and when i install that exe then that ext working without any error or problem..
so please you can lead me that why this type of msg showing by vs 2008 SP1.
BCZ i hve to go client side next weak for installing this project...i hav a little bit tense. BEZ i have first time developed this sw with linq.
Jignesh TrivediRank #16 · 50.3K reputationPosted Dec 19, 2013, 1:23 AM EST
Are you generate you exe in release mode or debug mode?
Mukesh Kumar TiwariRank #1,774 · 844 reputationPosted Dec 19, 2013, 1:36 AM EST
And no any error is coming
When we build exe then in last we get a msg that build succesfull
at the place of build successfull build failed is displaying
not any another error or msg is showing
Jignesh TrivediRank #16 · 50.3K reputationPosted Dec 19, 2013, 1:42 AM EST
hi,
Try the solution provided by below link
http://stackoverflow.com/questions/5068011/visual-studio-2010-says-build-failed-with-no-errors-after-i-change-a-source-file
get back to us if your problem is not resolved.