Click to See Complete Forum and Search --> : LINQ and Web Forms


Jster
10-19-2007, 09:15 AM
I'm having a difficult time populating a web form using LINQ. I have a stored procedure attached the DBML and I'm calling it to get the result, but I can't get the form to populate. Below is my code.


private void fillForm(string uName)
{
MasterDataContent mdc = new MasterDataContent();
var query = mdc.GetUser(uName);
txtUserName.Text = query.username;
}


The error is: 'System.Data.Linq.ISingleResult<newBD_101507_.GetUserResult>' does not contain a definition for 'username' and no extension method 'username' accepting a first argument of type 'System.Data.Linq.ISingleResult<newBD_101507_.GetUserResult>' could be found (are you missing a using directive or an assembly reference?)

Thanks,
Josh