Function GetProducts() As DataView Dim dstProducts As DataSet Dim conNorthwind As SqlConnection Dim dadProducts As SqlDataAdapter Dim dvwProducts As DataView dvwProducts = Cache( "Products" ) If dvwProducts Is Nothing Then dstProducts = New DataSet() conNorthwind = New SqlConnection( "Server=localhost;UID=sa;PWD=secret;Database=Northwind" ) dadProducts = New SqlDataAdapter( "Select * from Products", conNorthwind ) dadProducts.Fill( dstProducts, "Products" ) dvwProducts = dstProducts.Tables( "Products" ).DefaultView() Cache( "Products" ) = dvwProducts End If Return dvwProducts End Function
i got an error at the line inside which i put the dvwProducts inside the cache it says he cannot convert from datarow view to dataview
i tried many castings but no way and i copied the code form asp.net unleashed
any help????