I want to cache a table that I can Query using different criteria.
Why do I get the error:
Value of type 1-dimensional array of System.Data.DataRow cannot be converted to System.Data.DataRow.
When I try to compile this code?
Why do I get the error:
Value of type 1-dimensional array of System.Data.DataRow cannot be converted to System.Data.DataRow.
When I try to compile this code?
Code:
Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
If Cache.Item("AllTranscripts") Is Nothing Then
Dim ds As New DataSet
ds = dataAccess.ExecuteDataset(conn.ConnectionString, CommandType.StoredProcedure, "GetAllTranscripts")
Cache.Add("AllTranscripts", ds.Tables(0), Nothing, DateTime.Now.AddMinutes(30), TimeSpan.Zero, CacheItemPriority.Low, Nothing)
Dim dtNew As DataTable
dtNew = Cache.Item("AllTranscripts")
Dim drTranscriptSummary As DataRow
drTranscriptSummary = dtNew.Select("TranscriptsID = 681")
DataGrid1.DataSource = drTranscriptSummary
DataGrid1.DataBind()
Else
DataGrid1.DataSource = Cache.Item("AllTranscripts")
DataGrid1.DataBind()
End If
End Sub