In past I use dynamic sql and datatable to get data from database.
Such as :
Public shared function GetUsersByUsername(byval username as string) as datatable
dim strSQL as string="select * from
Users where Username= " & username
return dbClass.datatable(strSQL)
end function
And I could use this data such this:
Dim Email as string = GetUsersByUsername("mavera").rows(0).items("email")`
or
datagrid1.datasource=GetUsersByUsername("mavera")
datagrid1.databind()
And now, I want to use linq to sql to do that. I can write query with linq, but I can't use it like a datatable. What should my new using be done?