Can a DataReader go against a SQL View, how about an UDF?

  • Thread starter Thread starter Mark Bosley
  • Start date Start date
M

Mark Bosley

The SqlCommand.CommandType property seems to accept only "Text" or
StoredProcedure
Am I missing something?

Cheers, Mark
 
Sure. You can reference a VIEW in an SQL statement just as you can reference
a table.

SELECT Col1, Col2, Col19 FROM MyView WHERE X=Y

hth

--
____________________________________
William (Bill) Vaughn
Author, Mentor, Consultant
Microsoft MVP
www.betav.com/blog/billva
www.betav.com
Please reply only to the newsgroup so that others can benefit.
This posting is provided "AS IS" with no warranties, and confers no rights.
__________________________________
 
UDF is meant being used inside SQL Server. You can simply write a simple SP
to use the UDF to return data you want, like this:

Create PROCEDURE CALL_the_UDF
AS

SELECT MY_UDF() AS MyValue

RETURN

Then you can execute the SP in your .NET app.
 
Back
Top