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 related to page inheritance - I think answer is - page
16) One question related to Asp.net 1.1 -- Is the mobile application will work in asp.net 1.1
17) question  related to ASP.NET AdRotator Control - what is tag - A number that indicates the importance of the ad in the schedule of rotation relative to the other ads in the file (optional).

The larger the number, the more often the ad is displayed. The total of all Impressions values in the XML file cannot exceed 2,047,999,999. If it does, the AdRotator throws a run-time exception.

dont send me reply

18) Some question related to - error related to - input id="Button1" onserverclick="check" runat="server" type="button" value="button" /> & onserverclick

19) In repeter control they want to show title -- <%#Container.DataItem("title")%> OR <%# DataBinder.Eval(Container.DataItem,"CustomerName") %> Or ...
20) Related to DataList -- Value & Text Showing Its simple.
21) when the Viewsate is avilable in life cycle - answer is after LOAD
22) Simple c# code answer is 1
23) What are the Session-State Modes ? ans - InPro,StateServer,SQLServer
24)

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();

        try
        {
            MailAddress fromAddress = new MailAddress(FromAddressId);
            objSmtpClient.Host = SmtpServerName;
            objSmtpClient.Port = SmtpServerPortNo;
            message.From = fromAddress;
            message.To.Add(ToAddressId);
            message.Subject = Subject;
            message.IsBodyHtml = true;
            message.Body = MessageBody;
            objSmtpClient.Send(message);
            return true;
        }
        catch (Exception ex)
        {
            throw ex;
        }
        finally
        {
            objSmtpClient = null;
            message = null;
        }
    } // End Of Sendmail Function

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
                   ErrorClass - name of form or class in which error occured        
                   ErrorMethod - name of the method in which error occured
    RETURNS:       Nothing       
    '*************************************************************/
    ///
    /// Open or create an error log and submit error message. Returns void
    ///

    ///
object of Exception class
    /// title of the error
    /// name of form or class in which error occured
    /// name of the method in which error occured
    ///
    public static void WriteToErrorLog(Exception ex, string ErrorTitle, string ErrorClass, string ErrorMethod)
    {
        /* check and make the directory if necessary; this is set to look in
           the application folder, you may wish to place the error log in
           another location depending upon the user's role and write access to
           different areas of the file system */
        string strPath = HttpContext.Current.Server.MapPath("~\\Errors");
        //if (!Directory.Exists(strPath))
        //    Directory.CreateDirectory(strPath);
        DirectoryInfo objDirInfor = new DirectoryInfo(strPath);
        if (!objDirInfor.Exists)
            objDirInfor.Create();
        //check the file
        FileStream fs = new FileStream(strPath + "\\MilesSelfTestWebErrorlog.txt", FileMode.OpenOrCreate, FileAccess.ReadWrite);
        StreamWriter s = new StreamWriter(fs);
        s.Close();
        fs.Close();
        //log it
        FileStream fs1 = new FileStream(strPath + "\\MilesSelfTestWebErrorlog.txt", FileMode.Append, FileAccess.Write);
        StreamWriter s1 = new StreamWriter(fs1);
        System.Text.StringBuilder strErrorDesc = new System.Text.StringBuilder("");
        strErrorDesc.AppendLine("Title: " + ErrorTitle + Environment.NewLine);
        strErrorDesc.AppendLine("ErrorClass: " + ErrorClass + Environment.NewLine);
        strErrorDesc.AppendLine("ErrorMethod: " + ErrorMethod + Environment.NewLine);
        strErrorDesc.AppendLine("Message: " + ex.Message + Environment.NewLine);
        strErrorDesc.AppendLine("StackTrace: " + ex.StackTrace + Environment.NewLine);
        strErrorDesc.AppendLine("Date/Time: " + DateTime.Now.ToString() + Environment.NewLine);
        strErrorDesc.AppendLine("================================================" + Environment.NewLine);
        s1.Write(strErrorDesc.ToString());
        s1.Close();
        fs1.Close();
        //clsEmail objSimpleEmail = new clsEmail();
        //objSimpleEmail.SendEMail("admin@nigeriaexamsonline.com", "bhaveshp@iprogrammer.co.in, milindm@iprogrammer.co.in", ErrorTitle, strErrorDesc.ToString());
        //objSimpleEmail = null;
    }
}