J
James Page
Hi all
Having a mental block with linq!
I have a simple aspx page with a button and a label. When the button is
clicked I want the label to display the result of a simple query:
i.e. Select name from MyTable where id = 1
This should return ‘peter’ - simplicity using sql
I'm trying to do this with linq and getting nowhere (converting to string
error)
here's what I've got:
Button click event:
Dim db as New myTableDataContext
Dim name = From n In db.myTable Where n.Id = 1 Select n
Label1.text = name
Where am I going wrong?
Any pointers or tutorials would be great (vb.net)
Having a mental block with linq!
I have a simple aspx page with a button and a label. When the button is
clicked I want the label to display the result of a simple query:
i.e. Select name from MyTable where id = 1
This should return ‘peter’ - simplicity using sql
I'm trying to do this with linq and getting nowhere (converting to string
error)
here's what I've got:
Button click event:
Dim db as New myTableDataContext
Dim name = From n In db.myTable Where n.Id = 1 Select n
Label1.text = name
Where am I going wrong?
Any pointers or tutorials would be great (vb.net)