Ado.net and SQl view ???

G

Guest

Dear all,

I would like to bind a datgrid control to an SQL view.
How set SQL command type for a view ? Is it Text ?

IN which form the sql view is returned, data set ?

When I get my view bind to my grid, if new data is inserted in my database,
does my view will be automatically refreshed with new data or dor I have to
run the refresh my self with my datagrid ?

The idea is that I would like that my grid data gets automatically updated
if new data gets inserted and remove from my tables manged by the view

thnaks for help
regards
serge
 
W

William \(Bill\) Vaughn

Think of an SQL VIEW as a macro that simplifies a SELECT statement. When you
execute a SELECT on a VIEW instead of a TABLE, you get a set of columns and
rows (a rowset) determined by the SQL in the VIEW. This means ADO.NET (or
ADO) can manage the rowset like any other--with some limitations if the VIEW
is too complex. AFA as data viability, the rowset returned from a view is
cached on your client system--just as if it came from a TABLE or procedure.
If you want to see current data, you have to requery somehow.

I discuss this issue in depth in my book.

--
____________________________________
William (Bill) Vaughn
Author, Mentor, Consultant
Microsoft MVP
INETA Speaker
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.
__________________________________
Visit www.hitchhikerguides.net to get more information on my latest book:
Hitchhiker's Guide to Visual Studio and SQL Server (7th Edition)
and Hitchhiker's Guide to SQL Server 2005 Compact Edition (EBook)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top