dtc
dtc

Reputation: 10296

How can you tell if a stored procedure does not return results when using vb.net and linqtosql?

I have a linqtosql dbml where I dropped a stored procedure into the designer interface.

Stored procedure name: GetUser(@userid int)

Select * from users_tbl where userid=@userid

Now in the code I want to do something like this:

Dim db as new UserDataContext

Dim myuser as users_tbl = db.GetUser(1)

How can I tell if GetUser returned a user or not?

Upvotes: 0

Views: 122

Answers (1)

kbrimington
kbrimington

Reputation: 25652

If it returns a record, users_tbl will not be null and will not have a .Count() of 0.

Upvotes: 1

Related Questions