Posts

WCF (Windows Communication Foundation)

What is WCF? WCF is service oriented technology. Using WCF framework, we can build the service oriented architecture. WCF is unification of .NET framework communication technologies like MSMQ, Remoting, Web Services and COM+.

Fiserv Interview Questions.

1) For edit functionality in DataGird specify Column name 2) Why you may not want to use Paging funtionality in data grid 3) Function of SqlCommanBuilder in code. 4) Find the error in code . Its related to database connection. I think that connection sould be closed in finally instead of try. 5) What is the relation between src='' & Inherits='' in <@ Page > directive 6) What is derective in the user control page & its extention of file 7) Question related to 404 error code Error page & Default error page. 8) Its related to Autherization in web config related to folders 9) Related to definition 10) not remembred with question but answer is cookiless = true related question 11) Page is posting the 2 times why is it so 1) user control load 2) some control call load 12) describe !Page.PostBack Select Options 13) Question related to Session mode = SQLServer 14) Some question related to validation control - compare validator 15) Some question ...

Send Email in asp.net

add System.Net.Mail; namespace ///*********************************************************************************     ///     ///To Send the simple  Email     ///     /// From Email Id     /// To Email Id     /// Email Subject     /// Email Body     /// Returns bool with Indication     ///*********************************************************************************     public bool SendEMail(string FromAddressId, string ToAddressId,                           string Subject, string MessageBody)     {         SmtpClient objSmtpClient = new SmtpClient();         MailMessage message = new MailMessage();  ...

Creating Error log

using System; using System.Data; using System.Configuration; using System.Web; using System.Web.Security; using System.Web.UI; using System.Web.UI.WebControls; using System.Web.UI.WebControls.WebParts; using System.Web.UI.HtmlControls; using System.Data.SqlClient; using CommonComponents; using System.IO; /// /// Summary description for clsErrorLog /// public class clsErrorLog {     /*************************************************************     NAME:          WriteToErrorLog     PURPOSE:       Open or create an error log and submit error message     PARAMETERS:    ex - object of Exception class                    ErrorTitle - title of the error              ...

Finding Nth Highest Salary Query

SELECT max(sal) FROM  tbltemp WHERE sal NOT IN (SELECT distinct top 2 sal FROM tbltemp ORDER BY sal desc) for eg. for 3rd highest top will be 3-1 =2  (top 2) therefore top N-1 Or SELECT TOP 1 sal  FROM (                SELECT DISTINCT TOP 2 sal                FROM tbltemp               ORDER BY sal DESC               ) A ORDER BY sal

Adding Custom Tags in Web.config

Image
To add cutom tag in your web config its a simple process. I will expain it step by step Add  Following to your web config Remember you have to add information about your System assembly which you can find in your GAC (Global assembly cache) Path: " C:\WINDOWS\assembly " right click on System assembly and you will get Property about it. Then to get those custom tag values  write the following code on default.aspx.cs file  protected void Page_Load(object sender, EventArgs e) {       NameValueCollection Col = new NameValueCollection(); Col = (NameValueCollection)System.Configuration.ConfigurationManager.GetSection("MyCustomSection");         for (int i = 0; i < c1.Keys.Count; i++)         {            Response.Write(String.Format("Key = {0}, Value = {1} ", c1.Keys[i], c1[i].ToString()));   ...

Singleton Design Pattern

one of the good explanation found in ASP.NET 3.5 Application Architecture Design public sealed class EmailManager { private static EmailManager _manager; //Private constructor so that objects cannot be created private EmailManager() { } public static EmailManager GetInstance() { // Use 'Lazy initialization' if (_manager == null) { //ensure thread safety using locks lock(typeof(EmailManager) { _manager = new EmailManager(); } } return _manager; } } let us understand the code step-by-step: 1. public sealed class EmailManager: We have used the sealed keyword to make our EmailManager class uninheritable. This is not necessary, but there is no use having derived classes as there can be only one instance of this class in memory. Having derived class objects will let us create two or more instances which will be against the singleton's design objective. 2. private static EmailManager _manager: Next, we...