Ado.net and SQl view ???
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
Date:Mon, 16 Jul 2007 10:52:03 -0700
Author:
|
Re: Ado.net and SQl view ???
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)
-----------------------------------------------------------------------------------------------------------------------
"calderara" wrote in message
news:6FBF8822-7591-4814-B6DF-08C0454E9F3E@microsoft.com...
> 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
Date:Mon, 16 Jul 2007 14:26:23 -0700
Author:
|