Why do I get the error message ‘The SelectCommand property has not been initialized before calling ‘Fill’. ‘
You have to supply the Sql Statement or Stored Procedure for the DataAdapter as VB.NET da.SelectCommand.CommandText = ‘Select * from ‘ or da = new SqlDataAdapter (‘Select * from ‘, cn) C# da.SelectCommand.CommandText =’Select * from ‘; or da = new SqlDataAdapter (‘Select * from ‘, cn);
How to display items stored in a local application Cache
VB.NET Dim objItem As DictionaryEntry For Each objItem In Cache Response.Write((‘Key :’ + objItem.Key.ToString() + ‘ ‘)) Response.Write((‘ Value :’ + objItem.Value.ToString() + ‘ ‘)) Next C# foreach(DictionaryEntry objItem in Cache) { Response.Write (‘Key :’ + objItem.Key.ToString () + ‘ ‘); Response.Write(‘ Value :’ + objItem.Value.ToString ()+ ‘ ‘ ) ; }
How to access the Cache from a compiled class
VB.NET somevar=System.Web.HttpContext.Current.Cache(”) C# somevar=System.Web.HttpContext.Current.Cache(”);
Why do I get the error message ‘The type or namespace name ‘CacheDependency’ could not be found (are you missing a using directive or an assembly reference?) ‘
Use namespace System.Web.Caching or refer to it as System.Web.Caching.CacheDependency
Why do I get the error message ‘550 5.7.1 Unable to relay for xxx or 550 not local host xxx, not a gateway ‘
The SMTP server is not configured to allow you to relay. If you are working with a local SMTP server, you can configure it to allow relaying for IP 127.0.0.1.