Is True, if the last query result was obtained from the cache.
Namespace: Nemiro.Data.SqlAssembly: Nemiro.Data (in Nemiro.Data.dll) Version: 2.11.4.126 (2.11.4.126)
public bool LastQueryResultsFromCache { get; }
public bool LastQueryResultsFromCache { get; }
Public ReadOnly Property LastQueryResultsFromCache As Boolean
Get
Public ReadOnly Property LastQueryResultsFromCache As Boolean
Get
Property Value
Type:
Booleanusing (SqlClient client = new SqlClient())
{
client.CacheDuration = 1200;
client.CommandText = "SELECT TOP 100 * FROM proxy";
var table = client.GetTable();
Console.WriteLine("1. From cache: {0}", client.LastQueryResultsFromCache);
var table = client.GetTable();
Console.WriteLine("2. From cache: {0}", client.LastQueryResultsFromCache);
}
using (SqlClient client = new SqlClient())
{
// query with cache
client.CacheDuration = 1200;
client.CommandText = "SELECT TOP 100 * FROM proxy";
var table = client.GetTable();
Console.WriteLine("1. From cache: {0}", client.LastQueryResultsFromCache);
// re-execute the query
var table = client.GetTable();
Console.WriteLine("2. From cache: {0}", client.LastQueryResultsFromCache);
}
Using client As New SqlClient()
client.CacheDuration = 1200
client.CommandText = "SELECT TOP 100 * FROM proxy"
Dim table As DataTable = client.GetTable()
Console.WriteLine("1. From cache: {0}", client.LastQueryResultsFromCache)
table = client.GetTable()
Console.WriteLine("2. From cache: {0}", client.LastQueryResultsFromCache)
End Using
Using client As New SqlClient()
' query with cache
client.CacheDuration = 1200
client.CommandText = "SELECT TOP 100 * FROM proxy"
Dim table As DataTable = client.GetTable()
Console.WriteLine("1. From cache: {0}", client.LastQueryResultsFromCache)
' re-execute the query
table = client.GetTable()
Console.WriteLine("2. From cache: {0}", client.LastQueryResultsFromCache)
End Using