Bind DataGridView to sql view, with updates
I'd like to be able to bind a datagridview to a sql view and use the built in tableadapter update 开发者_StackOverflow中文版method to write data back to the view. Is this possible?
Thank you.
yes but it comes with limitations.
http://msdn.microsoft.com/en-us/library/aa933206(v=sql.80).aspx
Also:
"Microsoft SQL Server does not permit updating fields in multiple database tables used within a SQL view. According to Microsoft, “INSERT, UPDATE, and DELETE statements also must meet certain qualifications before they can reference a view that is updatable… UPDATE and INSERT statements can reference a view only if the view is updatable and the UPDATE or INSERT statement is written so that it modifies data in only one of the base tables referenced in the FROM clause of the view. A DELETE statement can reference an updatable view only if the view references exactly one table in its FROM clause."
精彩评论