tag:blogger.com,1999:blog-82071143273200084932024-02-08T04:49:34.513-08:00My Postsharish chandnahttp://www.blogger.com/profile/06099169032804747646noreply@blogger.comBlogger43125truetag:blogger.com,1999:blog-8207114327320008493.post-66961282957828246572012-06-21T03:52:00.003-07:002012-06-21T03:53:31.417-07:00Jquery - Image Swap on hover (you can use it menu also)<div dir="ltr" style="text-align: left;" trbidi="on"><html xmlns="http://www.w3.org/1999/xhtml"><br />
<head><br />
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" /><br />
<title>jQuery Example - Image Swap Preload - Design Chemical Bangkok</title><br />
<link href="/css/style.css" rel="stylesheet" type="text/css" /><br />
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js"></script><br />
<br />
<script type="text/JavaScript"><br />
// prepare the form when the DOM is ready<br />
$(document).ready(function() {<br />
$(".img-swap-1").hover(<br />
function() {<br />
this.src = this.src.replace("_off", "_on");<br />
this.style.marginTop = "-25px";<br />
},<br />
function() {<br />
this.src = this.src.replace("_on", "_off");<br />
this.style.marginTop = "0px";<br />
});<br />
});<br />
$.fn.preload = function() {<br />
this.each(function() {<br />
$('<img/>')[0].src = this;<br />
});<br />
}<br />
</script><br />
<br />
<style type="text/css"><br />
.onehalf<br />
{<br />
margin-bottom: 15px;<br />
}<br />
.onehalf h3<br />
{<br />
margin-bottom: 15px;<br />
}<br />
.onehalf ul li<br />
{<br />
margin-bottom: 5px;<br />
}<br />
.onehalf ul li img<br />
{<br />
cursor: pointer;<br />
}<br />
.dvOutPlan<br />
{<br />
float: left;<br />
cursor: pointer;<br />
width: 245px;<br />
}<br />
</style><br />
</head><br />
<body><br />
<div style="background-color: #fafafa; width: 100%; padding-bottom: 10px; border-left: solid 1px #666666;<br />
border-right: solid 1px #666666; float: left; padding-top: 32px;" align="center"><br />
<div class="onehalf float-left"><br />
<div id="dvPremium" class="dvOutPlan"><br />
<img src="images/Premium_off.jpg" alt="1" class="img-swap-1" /><br />
</div><br />
<div id="dvPlus" class="dvOutPlan"><br />
<img src="images/Premium_off.jpg" alt="2" class="img-swap-1" /><br />
</div><br />
<div id="dvBasic" class="dvOutPlan"><br />
<img src="images/Premium_off.jpg" alt="3" class="img-swap-1" /><br />
</div><br />
<div id="dvLite" class="dvOutPlan"><br />
<img src="images/Premium_off.jpg" alt="3" class="img-swap-1" /><br />
</div><br />
</div><br />
</div><br />
</body><br />
</html></div>harish chandnahttp://www.blogger.com/profile/06099169032804747646noreply@blogger.com0tag:blogger.com,1999:blog-8207114327320008493.post-16578889613189039852012-05-04T02:02:00.003-07:002012-05-04T02:27:03.426-07:00Remember Me funcationlaity in asp.net<div dir="ltr" style="text-align: left;" trbidi="on"> On Login Button Click<br />
================================== <br />
//Remeber me functionality<br />
if (chkRememberMe.Checked == true)<br />
{<br />
Response.Cookies["UName"].Value = txtLogin.Text;<br />
Response.Cookies["PWD"].Value = txtPassword.Text;<br />
Response.Cookies["UName"].Expires = DateTime.Now.AddMonths(2);<br />
Response.Cookies["PWD"].Expires = DateTime.Now.AddMonths(2);<br />
}<br />
else<br />
{<br />
Response.Cookies["UName"].Expires = DateTime.Now.AddMonths(-1);<br />
Response.Cookies["PWD"].Expires = DateTime.Now.AddMonths(-1);<br />
}<br />
<br />
<br />
on page load<br />
===================<br />
//for remember me funcationality<br />
if (Request.Cookies["UName"] != null)<br />
txtLogin.Text = Request.Cookies["UName"].Value;<br />
if (Request.Cookies["PWD"] != null)<br />
txtPassword.Attributes.Add("value", Request.Cookies["PWD"].Value);<br />
if (Request.Cookies["UName"] != null && Request.Cookies["PWD"] != null)<br />
chkRememberMe.Checked = true; <br />
<br />
</div>harish chandnahttp://www.blogger.com/profile/06099169032804747646noreply@blogger.com0tag:blogger.com,1999:blog-8207114327320008493.post-66160773101302580202012-04-25T23:55:00.000-07:002012-04-25T23:55:23.719-07:00get list of child tables for a database table?<div dir="ltr" style="text-align: left;" trbidi="on"><br />
<br />
<u><b>in</b></u><u><b> sql server : 2008 </b></u><br />
<br />
select object_name(referenced_object_id) as [primary table], object_name(parent_object_id) [child table]<br />
from sys.foreign_keys<br />
WHERE object_name(referenced_object_id) ='PatientMaster'<br />
ORDER by object_name(parent_object_id)<br />
<br />
<br />
<u><b>in sql server : 2005</b></u> <br />
select o1.name, o2.name<br />
from sysforeignkeys fk<br />
join sysobjects o1 on o1.id = fk.fkeyid<br />
join sysobjects o2 on o2.id = fk.rkeyid<br />
where o2.name = 'PatientMaster'</div>harish chandnahttp://www.blogger.com/profile/06099169032804747646noreply@blogger.com0tag:blogger.com,1999:blog-8207114327320008493.post-19489134567198990012012-04-05T03:11:00.000-07:002012-04-05T03:11:34.109-07:00Use Calander Control with FromDate and ToDate (User Control)<div dir="ltr" style="text-align: left;" trbidi="on"><br />
/*************.ascx page*********************/ <br />
<br />
<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="ajax" %><br />
<asp:TextBox ID="txtDate" runat="server" MaxLength="11"></asp:TextBox><br />
<ajax:CalendarExtender ID="clndrDate" runat="server" TargetControlID="txtDate" Format="MM/dd/yyyy"<br />
CssClass="MyCalendar"><br />
</ajax:CalendarExtender><br />
<div class="mandatory"><br />
<asp:RequiredFieldValidator ID="reqUCDate" runat="server" <br />
ControlToValidate="txtDate" Display="Dynamic" SetFocusOnError="true"<br />
ErrorMessage="please select date" Text="*"></asp:RequiredFieldValidator><br />
<asp:RangeValidator<br />
ID="rangeUCDate"<br />
runat="server"<br />
SetFocusOnError="true"<br />
ControlToValidate="txtDate"<br />
ErrorMessage="Please enter valid date"<br />
Type="Date" Display="Dynamic"<br />
Enabled="false" /><br />
</div><br />
<input id="txtCurrDate" type="hidden" value="<%=DateTime.Now.AddHours(20).ToString("MM/dd/yyyy") %>"/><br />
<asp:TextBox ID="txtTempDate" Visible="false" runat="server" MaxLength="11"></asp:TextBox> <br />
<br />
<br />
<br />
<br />
/*************. Code Behind Page *********************/<br />
/// <summary><br />
/// This Control is use for Date Textbox with Calender control on page<br />
/// For this control use on page some of functions are created in javascript for validation <br />
/// </summary><br />
/// <CreatedBy>Khushant Dhingra</CreatedBy><br />
/// <CreatedDate>20/may/2011</CreatedDate><br />
protected void Page_Load(object sender, EventArgs e)<br />
{<br />
if (!IsPostBack)<br />
{<br />
//DateRequired = false;<br />
}<br />
}<br />
<br />
#region Variable<br />
<br />
private string date;<br />
<br />
#endregion<br />
<br />
#region Property<br />
/// <summary><br />
/// This Property use for get and set date in dd MMM yyyy format<br />
/// </summary><br />
/// <CreatedBy>Khushant Dhingra</CreatedBy><br />
/// <CreatedDate>20/may/2011</CreatedDate><br />
public string Date<br />
{<br />
get<br />
{<br />
date = txtDate.Text;<br />
return date;<br />
<br />
}<br />
set<br />
{<br />
date = value;<br />
if (date != string.Empty)<br />
{<br />
txtDate.Text = Convert.ToDateTime(date).ToString("MM/dd/yyyy");<br />
}<br />
else<br />
{<br />
txtDate.Text = "";<br />
}<br />
}<br />
<br />
}<br />
<br />
/// <summary><br />
/// This Property is used to set width of data control<br />
/// </summary><br />
/// <CreatedBy>Khushant Dhingra</CreatedBy><br />
/// <CreatedDate>20/may/2011</CreatedDate><br />
public int DateControlWidth<br />
{<br />
set<br />
{<br />
txtDate.Width = value;<br />
}<br />
}<br />
<br />
/// <summary><br />
/// This Property is used to set height of date control<br />
/// </summary><br />
/// <CreatedBy>Khushant Dhingra</CreatedBy><br />
/// <CreatedDate>20/may/2011</CreatedDate><br />
public int DateControlHeight<br />
{<br />
set<br />
{<br />
txtDate.Height = value;<br />
}<br />
}<br />
<br />
/// <summary><br />
/// This Property is used to make date cotrol read only<br />
/// </summary><br />
/// <CreatedBy>Khushant Dhingra</CreatedBy><br />
/// <CreatedDate>20/may/2011</CreatedDate><br />
public bool DateControlReadOnly<br />
{<br />
set<br />
{<br />
txtDate.ReadOnly = value;<br />
clndrDate.TargetControlID = "txtTempDate";<br />
}<br />
get<br />
{<br />
return txtDate.ReadOnly;<br />
}<br />
}<br />
<br />
/// <summary><br />
/// This property used to make date mandatory<br />
/// </summary><br />
/// <CreatedBy>Khushant Dhingra</CreatedBy><br />
/// <CreatedDate>20/may/2011</CreatedDate><br />
public bool DateRequired<br />
{<br />
set<br />
{<br />
reqUCDate.Enabled = value;<br />
}<br />
}<br />
<br />
public string ValidationGroup<br />
{<br />
set<br />
{<br />
reqUCDate.ValidationGroup = value;<br />
rangeUCDate.ValidationGroup = value;<br />
}<br />
}<br />
<br />
#endregion<br />
<br />
#region Methods<br />
/// <summary><br />
/// Used to set maximum date<br />
/// </summary><br />
/// <CreatedBy>Khushant Dhingra</CreatedBy><br />
/// <CreatedDate>20/may/2011</CreatedDate><br />
/// <param name="dt"></param><br />
public void DateMaximum(DateTime dt)<br />
{<br />
rangeUCDate.Enabled = true;<br />
rangeUCDate.MaximumValue = dt.ToString("MM/dd/yyyy");<br />
rangeUCDate.MinimumValue = new DateTime(1600, 01, 01).ToString("MM/dd/yyyy");<br />
}<br />
<br />
/// <summary><br />
/// Used to set minimum date<br />
/// </summary><br />
/// <CreatedBy>Khushant Dhingra</CreatedBy><br />
/// <CreatedDate>20/may/2011</CreatedDate><br />
/// <param name="dt"></param><br />
public void DateMinimum(DateTime dt)<br />
{<br />
rangeUCDate.Enabled = true;<br />
rangeUCDate.MinimumValue = dt.ToString("MM/dd/yyyy");<br />
rangeUCDate.MaximumValue = DateTime.Now.AddYears(50).ToString("MM/dd/yyyy");<br />
}<br />
<br />
#endregion </div>harish chandnahttp://www.blogger.com/profile/06099169032804747646noreply@blogger.com0tag:blogger.com,1999:blog-8207114327320008493.post-5371198035834945432012-04-05T03:09:00.000-07:002012-04-05T03:09:01.556-07:00Calander and Ajax Tab nice Skins<div dir="ltr" style="text-align: left;" trbidi="on">/*Below Different Tab controls themes*/<br />
<br />
/* ajax__tab_xp-theme theme */<br />
<br />
.Tab .ajax__tab_header<br />
{<br />
color: #4682b4;<br />
font-family: Calibri;<br />
font-size: 14px;<br />
font-weight: bold;<br />
background: url("../../Images/black_navi.jpg") repeat-x;<br />
margin-left: 0px;<br />
width: 980px;<br />
height: 38px;<br />
vertical-align: middle;<br />
}<br />
/*Body*/<br />
.Tab .ajax__tab_body<br />
{<br />
border: 1px solid #b4cbdf;<br />
padding-top: 0px;<br />
width: 978px;<br />
padding-bottom: 10px;<br />
}<br />
/*Tab Active*/<br />
.Tab .ajax__tab_active .ajax__tab_tab<br />
{<br />
color: #75BECF;<br />
background: url("../../Images/tab_active.gif") repeat-x;<br />
height: 20px;<br />
}<br />
.Tab .ajax__tab_active .ajax__tab_inner<br />
{<br />
color: #75BECF;<br />
background: url("../../Images/tab_active.gif") no-repeat left;<br />
padding-left: 10px;<br />
}<br />
.Tab .ajax__tab_active .ajax__tab_outer<br />
{<br />
color: #75BECF;<br />
background: url("../../Images/tab_active.gif") no-repeat right;<br />
padding-right: 6px;<br />
margin-top: 8px;<br />
}<br />
/*Tab Hover*/<br />
.Tab .ajax__tab_hover .ajax__tab_tab<br />
{<br />
color: #75BECF;<br />
background: url("../../Images/tab_hover.gif") repeat-x;<br />
height: 20px;<br />
}<br />
.Tab .ajax__tab_hover .ajax__tab_inner<br />
{<br />
color: #75BECF;<br />
background: url("../../Images/tab_hover.gif") no-repeat left;<br />
padding-left: 10px;<br />
}<br />
.Tab .ajax__tab_hover .ajax__tab_outer<br />
{<br />
color: #75BECF;<br />
background: url("../../Images/tab_hover.gif") no-repeat right;<br />
padding-right: 6px;<br />
}<br />
/*Tab Inactive*/<br />
.Tab .ajax__tab_tab<br />
{<br />
color: #ffffff;<br />
background: url("../../Images/tab_Inactive.gif") repeat-x;<br />
height: 20px;<br />
}<br />
.Tab .ajax__tab_inner<br />
{<br />
color: #ffffff;<br />
background: url("../../Images/tab_inactive.gif") no-repeat left;<br />
padding-left: 10px;<br />
}<br />
.Tab .ajax__tab_outer<br />
{<br />
padding-right: 6px;<br />
margin-right: 1px;<br />
border-right: 1px solid #FFFFFF;<br />
}<br />
/*Above Different Tab controls theme*/<br />
<br />
<br />
/*Below Calendar controls themes*/<br />
.MyCalendar .ajax__calendar_container<br />
{<br />
background-color: #e2e2e2;<br />
border: solid 1px #cccccc;<br />
}<br />
<br />
.MyCalendar .ajax__calendar_header<br />
{<br />
background-color: #ffffff;<br />
margin-bottom: 4px;<br />
}<br />
<br />
<br />
.MyCalendar .MyCalendar .ajax__calendar_next, .MyCalendar .ajax__calendar_prev<br />
{<br />
color: #004080;<br />
padding-top: 3px;<br />
}<br />
<br />
.MyCalendar .ajax__calendar_title<br />
{<br />
color: #004080;<br />
padding-bottom:5px;<br />
}<br />
<br />
.MyCalendar .ajax__calendar_body<br />
{<br />
background-color: #e9e9e9;<br />
border: solid 1px #cccccc;<br />
}<br />
<br />
.MyCalendar .ajax__calendar_dayname<br />
{<br />
text-align: center;<br />
font-weight: bold;<br />
margin-bottom: 4px;<br />
margin-top: 2px;<br />
}<br />
<br />
.MyCalendar .ajax__calendar_day<br />
{<br />
text-align: center;<br />
}<br />
<br />
.MyCalendar .ajax__calendar_hover .ajax__calendar_day, .MyCalendar .ajax__calendar_hover .ajax__calendar_month, .MyCalendar .ajax__calendar_hover .ajax__calendar_year, .MyCalendar .ajax__calendar_active<br />
{<br />
color: #004080;<br />
font-weight: bold;<br />
background-color: #ffffff;<br />
}<br />
<br />
.MyCalendar .ajax__calendar_today<br />
{<br />
font-weight: bold;<br />
padding-top:0px;<br />
padding-bottom:5px;<br />
}<br />
<br />
.MyCalendar .ajax__calendar_other, .MyCalendar .ajax__calendar_hover .ajax__calendar_today, .MyCalendar .ajax__calendar_hover .ajax__calendar_title<br />
{<br />
color: #bbbbbb;<br />
}<br />
/*Above Calendar controls theme*/</div>harish chandnahttp://www.blogger.com/profile/06099169032804747646noreply@blogger.com0tag:blogger.com,1999:blog-8207114327320008493.post-68753649984398070192012-03-26T02:29:00.000-07:002012-03-26T02:29:15.149-07:00SystemClass.cs in Database Service<div dir="ltr" style="text-align: left;" trbidi="on">using System;<br />
using System.Collections.Generic;<br />
using System.Linq;<br />
using System.Web;<br />
using System.Data;<br />
using System.Data.SqlClient;<br />
using System.IO;<br />
using System.Text;<br />
<br />
namespace DataBaseService<br />
{<br />
public partial class DataBaseService : IDataBaseService<br />
{<br />
public static string ConnectionString = Convert.ToString(System.Configuration.ConfigurationManager.ConnectionStrings["con"]);<br />
<br />
static SqlConnection GlobalConn()<br />
{<br />
SqlConnection sql = new SqlConnection(ConnectionString);<br />
return sql;<br />
}<br />
<br />
public DataSet GetDataSet(string uspName, string[] paramArray, object[] valueArray)<br />
{<br />
SqlConnection con = null;<br />
DataSet dataSet;<br />
SqlDataAdapter sqlDataAdapter;<br />
SqlCommand sqlCommand;<br />
int i;<br />
dataSet = new DataSet();<br />
try<br />
{<br />
sqlDataAdapter = new SqlDataAdapter();<br />
sqlDataAdapter.SelectCommand = new SqlCommand();<br />
con = GlobalConn();<br />
con.Open();<br />
<br />
sqlDataAdapter.SelectCommand.Connection = con;<br />
<br />
sqlCommand = sqlDataAdapter.SelectCommand;<br />
sqlCommand.CommandType = CommandType.StoredProcedure;<br />
sqlCommand.CommandText = uspName;<br />
i = 0;<br />
while ((((!paramArray.Length.Equals(0)) && (!valueArray.Length.Equals(0))) && (paramArray.Length.Equals(valueArray.Length))) && (i < paramArray.Length))<br />
{<br />
if (paramArray[i] != null)<br />
{<br />
sqlCommand.Parameters.AddWithValue(paramArray[i], valueArray[i]);<br />
}<br />
i++;<br />
}<br />
sqlDataAdapter.Fill(dataSet);<br />
<br />
}<br />
catch (Exception Ex)<br />
{<br />
throw new Exception(Ex.Message, Ex);<br />
}<br />
finally<br />
{<br />
con.Close();<br />
}<br />
return dataSet;<br />
}<br />
<br />
public DataSet GetDataSetWithOutParam(string spName)<br />
{<br />
SqlConnection con = null;<br />
DataSet dataSet;<br />
SqlDataAdapter sqlDataAdapter;<br />
SqlCommand sqlCommand;<br />
dataSet = new DataSet();<br />
try<br />
{<br />
sqlDataAdapter = new SqlDataAdapter();<br />
sqlDataAdapter.SelectCommand = new SqlCommand();<br />
con = GlobalConn();<br />
con.Open();<br />
<br />
sqlDataAdapter.SelectCommand.Connection = con;<br />
<br />
sqlCommand = sqlDataAdapter.SelectCommand;<br />
sqlCommand.CommandType = CommandType.StoredProcedure;<br />
sqlCommand.CommandText = spName;<br />
sqlDataAdapter.Fill(dataSet);<br />
}<br />
catch (Exception Ex)<br />
{<br />
throw new Exception(Ex.Message, Ex);<br />
}<br />
finally<br />
{<br />
con.Close();<br />
}<br />
return dataSet;<br />
}<br />
<br />
public DataSet GetDataSetReturnWithParam(string uspName, string[] paramArray, object[] valueArray, string OutParamName, out Int32 OutParam)<br />
{<br />
SqlConnection con = null;<br />
DataSet dataSet;<br />
SqlDataAdapter sqlDataAdapter;<br />
SqlCommand sqlCommand;<br />
int i;<br />
dataSet = new DataSet();<br />
OutParam = 0;<br />
try<br />
{<br />
sqlDataAdapter = new SqlDataAdapter();<br />
sqlDataAdapter.SelectCommand = new SqlCommand();<br />
<br />
con = GlobalConn();<br />
con.Open();<br />
<br />
sqlDataAdapter.SelectCommand.Connection = con;<br />
<br />
sqlCommand = sqlDataAdapter.SelectCommand;<br />
sqlCommand.CommandType = CommandType.StoredProcedure;<br />
sqlCommand.CommandText = uspName;<br />
i = 0;<br />
while ((((!paramArray.Length.Equals(0)) && (!valueArray.Length.Equals(0))) && (paramArray.Length.Equals(valueArray.Length))) && (i < paramArray.Length))<br />
{<br />
if (paramArray[i] != null)<br />
{<br />
sqlCommand.Parameters.AddWithValue(paramArray[i], valueArray[i]);<br />
}<br />
i++;<br />
}<br />
//Set out parameter<br />
sqlCommand.Parameters.AddWithValue(OutParamName, OutParam);<br />
sqlCommand.Parameters[OutParamName].Direction = ParameterDirection.Output;<br />
sqlCommand.Parameters[OutParamName].DbType = System.Data.DbType.Int32;<br />
sqlDataAdapter.Fill(dataSet);<br />
if (sqlCommand.Parameters[OutParamName] != null)<br />
{<br />
OutParam = Convert.ToInt32(sqlCommand.Parameters[OutParamName].Value); //sqlCommand.Parameters.Add(OutParamName, SqlDbType.Int)<br />
}<br />
}<br />
catch (Exception Ex)<br />
{<br />
throw new Exception(Ex.Message, Ex);<br />
}<br />
finally<br />
{<br />
con.Close();<br />
}<br />
return dataSet;<br />
}<br />
<br />
public DataSet GetDataSetWithReturnValue(string uspName, string[] paramArray, object[] valueArray, out Int32 OutParam)<br />
{<br />
SqlConnection con = null;<br />
DataSet dataSet;<br />
SqlDataAdapter sqlDataAdapter;<br />
SqlCommand sqlCommand;<br />
int i;<br />
dataSet = new DataSet();<br />
OutParam = 0;<br />
string OutParamName = "@ReturnValue";<br />
<br />
try<br />
{<br />
sqlDataAdapter = new SqlDataAdapter();<br />
sqlDataAdapter.SelectCommand = new SqlCommand();<br />
con = GlobalConn();<br />
con.Open();<br />
<br />
sqlDataAdapter.SelectCommand.Connection = con;<br />
<br />
sqlCommand = sqlDataAdapter.SelectCommand;<br />
sqlCommand.CommandType = CommandType.StoredProcedure;<br />
sqlCommand.CommandText = uspName;<br />
i = 0;<br />
while ((((!paramArray.Length.Equals(0)) && (!valueArray.Length.Equals(0))) && (paramArray.Length.Equals(valueArray.Length))) && (i < paramArray.Length))<br />
{<br />
if (paramArray[i] != null)<br />
{<br />
sqlCommand.Parameters.AddWithValue(paramArray[i], valueArray[i]);<br />
}<br />
i++;<br />
}<br />
//Set out parameter<br />
sqlCommand.Parameters.AddWithValue(OutParamName, OutParam);<br />
sqlCommand.Parameters[OutParamName].Direction = ParameterDirection.ReturnValue;<br />
sqlCommand.Parameters[OutParamName].SqlDbType = SqlDbType.Int;<br />
sqlDataAdapter.Fill(dataSet);<br />
if (sqlCommand.Parameters[OutParamName] != null)<br />
{<br />
OutParam = Convert.ToInt32(sqlCommand.Parameters[OutParamName].Value); //sqlCommand.Parameters.Add(OutParamName, SqlDbType.Int)<br />
}<br />
}<br />
catch (Exception Ex)<br />
{<br />
throw new Exception(Ex.Message, Ex);<br />
}<br />
finally<br />
{<br />
con.Close();<br />
}<br />
return dataSet;<br />
}<br />
<br />
public DataTable GetDataTable(string uspName, string strParam, string strMain)<br />
{<br />
SqlConnection con = null;<br />
DataTable dataTable;<br />
SqlDataAdapter sqlDataAdapter;<br />
dataTable = new DataTable();<br />
try<br />
{<br />
sqlDataAdapter = new SqlDataAdapter();<br />
sqlDataAdapter.SelectCommand = new SqlCommand();<br />
con = GlobalConn();<br />
con.Open();<br />
<br />
sqlDataAdapter.SelectCommand.Connection = con;<br />
SqlCommand sqlCommand = sqlDataAdapter.SelectCommand;<br />
sqlCommand.CommandType = CommandType.StoredProcedure;<br />
sqlCommand.CommandText = uspName;<br />
sqlCommand.Parameters.Add(strParam, SqlDbType.VarChar).Value = strMain;<br />
sqlDataAdapter.Fill(dataTable);<br />
}<br />
catch (Exception Ex)<br />
{<br />
//GlobalConnection.dtlMessageBox = new SgtDetailMsgBox("Problem in Getting Data.", Ex.Message);<br />
throw new Exception(Ex.Message, Ex);<br />
}<br />
finally<br />
{<br />
con.Close();<br />
}<br />
return dataTable;<br />
}<br />
<br />
public void ExecuteSPReturn(string uspName)<br />
{<br />
SqlConnection con = null;<br />
try<br />
{<br />
SqlCommand sqlCommand = new SqlCommand();<br />
con = GlobalConn();<br />
con.Open();<br />
<br />
sqlCommand.Connection = con;<br />
sqlCommand.CommandType = CommandType.StoredProcedure;<br />
sqlCommand.CommandText = uspName;<br />
sqlCommand.ExecuteNonQuery();<br />
<br />
}<br />
catch (Exception Ex)<br />
{<br />
//GlobalConnection.dtlMessageBox = new SgtDetailMsgBox("Problem occured during execution.", Ex.Message);<br />
throw new Exception(Ex.Message, Ex);<br />
}<br />
finally<br />
{<br />
con.Close();<br />
}<br />
}<br />
<br />
public object ExecuteSPReturnWithParam(string uspName, string[] ParamArr, object[] ValueArr, object OutParam)<br />
{<br />
SqlConnection con = null;<br />
string str;<br />
SqlCommand sqlCommand;<br />
int i;<br />
try<br />
{<br />
str = "";<br />
sqlCommand = new SqlCommand();<br />
con = GlobalConn();<br />
<br />
SqlConnection sqlCon = con;<br />
sqlCon.Open();<br />
sqlCommand.Connection = sqlCon;<br />
sqlCommand.CommandType = CommandType.StoredProcedure;<br />
sqlCommand.CommandText = uspName;<br />
if ((ParamArr.Length.Equals(0)) || (ValueArr.Length.Equals(0)))<br />
{<br />
return "";<br />
}<br />
if (!ParamArr.Length.Equals(ValueArr.Length))<br />
{<br />
return "";<br />
}<br />
i = 0;<br />
while (i < ParamArr.Length)<br />
{<br />
if (ParamArr[i] != null)<br />
{<br />
sqlCommand.Parameters.AddWithValue(ParamArr[i], ValueArr[i]);<br />
}<br />
str = string.Concat(str, ",", ValueArr[i].ToString());<br />
i++;<br />
}<br />
sqlCommand.Parameters["@OutParam"].Direction = ParameterDirection.Output;<br />
sqlCommand.Parameters["@OutParam"].DbType = System.Data.DbType.Int64;<br />
sqlCommand.ExecuteNonQuery();<br />
OutParam = sqlCommand.Parameters.Add("@OutParam", SqlDbType.BigInt).Value;<br />
sqlCon.Close();<br />
<br />
}<br />
catch (Exception Ex)<br />
{<br />
//GlobalConnection.dtlMessageBox = new SgtDetailMsgBox("Problem occured during execution.", Ex.Message);<br />
throw new Exception(Ex.Message, Ex);<br />
}<br />
finally<br />
{<br />
con.Close();<br />
}<br />
return OutParam;<br />
}<br />
<br />
public long SetAddDataXML(string uspName, DataSet ds, long ID )<br />
{<br />
SqlConnection con = null;<br />
object obj;<br />
string str;<br />
SqlDataAdapter sqlDataAdapter;<br />
obj = new object();<br />
str = "";<br />
obj = 0;<br />
try<br />
{<br />
sqlDataAdapter = new SqlDataAdapter();<br />
sqlDataAdapter.SelectCommand = new SqlCommand();<br />
con = GlobalConn();<br />
con.Open();<br />
<br />
sqlDataAdapter.SelectCommand.Connection = con;<br />
<br />
SqlCommand sqlCommand = sqlDataAdapter.SelectCommand;<br />
sqlCommand.CommandType = CommandType.StoredProcedure;<br />
sqlCommand.CommandText = uspName;<br />
MemoryStream memoryStream = new MemoryStream();<br />
ds.WriteXml(memoryStream);<br />
memoryStream.Position = 0;<br />
StreamReader streamReader = new StreamReader(memoryStream);<br />
str = streamReader.ReadToEnd();<br />
sqlCommand.Parameters.AddWithValue("@AddData", str);<br />
//sqlCommand.Parameters.AddWithValue("@MasterType", mstType);<br />
sqlCommand.Parameters["@Outparam"].Direction = ParameterDirection.Output;<br />
sqlCommand.ExecuteNonQuery();<br />
obj = sqlCommand.Parameters.Add("@Outparam", SqlDbType.BigInt).Value;<br />
<br />
<br />
<br />
<br />
}<br />
catch (Exception Ex)<br />
{<br />
//GlobalConnection.dtlMessageBox = new SgtDetailMsgBox("Problem occured during execution. Unable to save data.", Ex.Message);<br />
throw new Exception(Ex.Message, Ex);<br />
}<br />
finally<br />
{<br />
con.Close();<br />
}<br />
return Convert.ToInt64(obj);<br />
}<br />
<br />
public void ExecuteSQLQuery(string sStr)<br />
{<br />
SqlConnection con = null;<br />
try<br />
{<br />
<br />
SqlCommand sqlCommand = new SqlCommand();<br />
con = GlobalConn();<br />
con.Open();<br />
<br />
sqlCommand.Connection = con;<br />
sqlCommand.CommandType = CommandType.Text;<br />
sqlCommand.CommandText = sStr;<br />
sqlCommand.ExecuteNonQuery();<br />
}<br />
catch (Exception Ex)<br />
{<br />
//GlobalConnection.dtlMessageBox = new SgtDetailMsgBox("Problem occured during execution. Unable to do the operation.", Ex.Message);<br />
throw new Exception(Ex.Message, Ex);<br />
}<br />
finally<br />
{<br />
con.Close();<br />
}<br />
}<br />
<br />
<br />
public int ExecuteNonQueryWithReturn(string uspName, string[] paramArray, object[] valueArray)<br />
{<br />
SqlConnection sqlCon = null;<br />
<br />
try<br />
{<br />
<br />
int result = 0;<br />
SqlCommand sqlCommand = new SqlCommand();<br />
sqlCon = GlobalConn();<br />
sqlCon.Open();<br />
<br />
sqlCommand.Connection = sqlCon;<br />
<br />
sqlCommand.CommandType = CommandType.StoredProcedure;<br />
sqlCommand.CommandText = uspName;<br />
int i = 0;<br />
while ((((!paramArray.Length.Equals(0)) && (!valueArray.Length.Equals(0))) && (paramArray.Length.Equals(valueArray.Length))) && (i < paramArray.Length))<br />
{<br />
if (paramArray[i] != null)<br />
{<br />
sqlCommand.Parameters.AddWithValue(paramArray[i], valueArray[i]);<br />
}<br />
i++;<br />
}<br />
SqlParameter myParm = sqlCommand.Parameters.Add("@ReturnValue", SqlDbType.Int);<br />
sqlCommand.Parameters["@ReturnValue"].Direction = ParameterDirection.ReturnValue;<br />
sqlCommand.ExecuteNonQuery();<br />
result = (Int32)sqlCommand.Parameters["@ReturnValue"].Value;<br />
<br />
<br />
return result;<br />
<br />
}<br />
catch (Exception Ex)<br />
{<br />
<br />
throw new Exception(Ex.Message, Ex);<br />
<br />
}<br />
finally<br />
{<br />
sqlCon.Close();<br />
}<br />
<br />
}<br />
<br />
public int ExecuteNonQueryWithReturn(string uspName, string param, System.Data.SqlTypes.SqlXml value)<br />
{<br />
SqlConnection sqlCon = null;<br />
<br />
try<br />
{<br />
<br />
int result = 0;<br />
SqlCommand sqlCommand = new SqlCommand();<br />
sqlCon = GlobalConn();<br />
sqlCon.Open();<br />
<br />
sqlCommand.Connection = sqlCon;<br />
<br />
sqlCommand.CommandType = CommandType.StoredProcedure;<br />
sqlCommand.CommandText = uspName;<br />
<br />
sqlCommand.Parameters.Add(param, SqlDbType.Xml);<br />
sqlCommand.Parameters[param].Value = value.Value.Replace(" xmlns=\"http://tempuri.org/\"", "");<br />
<br />
SqlParameter myParm = sqlCommand.Parameters.Add("@ReturnValue", SqlDbType.Int);<br />
sqlCommand.Parameters["@ReturnValue"].Direction = ParameterDirection.ReturnValue;<br />
<br />
sqlCommand.ExecuteNonQuery();<br />
result = (Int32)sqlCommand.Parameters["@ReturnValue"].Value;<br />
<br />
<br />
return result;<br />
<br />
}<br />
catch (Exception Ex)<br />
{<br />
<br />
throw new Exception(Ex.Message, Ex);<br />
<br />
}<br />
finally<br />
{<br />
sqlCon.Close();<br />
}<br />
<br />
}<br />
<br />
<br />
<br />
public int ExecuteNonQueryWithSaveXML(string uspName, string[] paramArray, object[] valueArray, string xmlparam, System.Data.SqlTypes.SqlXml value)<br />
{<br />
SqlConnection sqlCon = null;<br />
<br />
try<br />
{<br />
<br />
int result = 0;<br />
SqlCommand sqlCommand = new SqlCommand();<br />
sqlCon = GlobalConn();<br />
sqlCon.Open();<br />
<br />
sqlCommand.Connection = sqlCon;<br />
<br />
sqlCommand.CommandType = CommandType.StoredProcedure;<br />
sqlCommand.CommandText = uspName;<br />
int i = 0;<br />
while ((((!paramArray.Length.Equals(0)) && (!valueArray.Length.Equals(0))) && (paramArray.Length.Equals(valueArray.Length))) && (i < paramArray.Length))<br />
{<br />
if (paramArray[i] != null)<br />
{<br />
sqlCommand.Parameters.AddWithValue(paramArray[i], valueArray[i]);<br />
}<br />
i++;<br />
}<br />
<br />
sqlCommand.Parameters.Add(xmlparam, SqlDbType.Xml);<br />
sqlCommand.Parameters[xmlparam].Value = value.Value.Replace(" xmlns=\"http://tempuri.org/\"", "");<br />
<br />
SqlParameter myParm = sqlCommand.Parameters.Add("@ReturnValue", SqlDbType.Int);<br />
sqlCommand.Parameters["@ReturnValue"].Direction = ParameterDirection.ReturnValue;<br />
<br />
sqlCommand.ExecuteNonQuery();<br />
result = (Int32)sqlCommand.Parameters["@ReturnValue"].Value;<br />
<br />
<br />
return result;<br />
<br />
}<br />
catch (Exception Ex)<br />
{<br />
<br />
throw new Exception(Ex.Message, Ex);<br />
<br />
}<br />
finally<br />
{<br />
sqlCon.Close();<br />
}<br />
<br />
}<br />
<br />
<br />
<br />
<br />
public int ExecuteSPWithReturn(string uspName)<br />
{<br />
SqlConnection con = null;<br />
int result = 0;<br />
try<br />
{<br />
SqlCommand sqlCommand = new SqlCommand();<br />
con = GlobalConn();<br />
con.Open();<br />
<br />
sqlCommand.Connection = con;<br />
sqlCommand.CommandType = CommandType.StoredProcedure;<br />
sqlCommand.CommandText = uspName;<br />
<br />
sqlCommand.Parameters.Add("@ReturnValue", SqlDbType.Int);<br />
sqlCommand.Parameters["@ReturnValue"].Direction = ParameterDirection.ReturnValue;<br />
<br />
sqlCommand.ExecuteNonQuery();<br />
result = (Int32)sqlCommand.Parameters["@ReturnValue"].Value;<br />
}<br />
catch (Exception Ex)<br />
{<br />
//GlobalConnection.dtlMessageBox = new SgtDetailMsgBox("Problem occured during execution.", Ex.Message);<br />
throw new Exception(Ex.Message, Ex);<br />
}<br />
finally<br />
{<br />
con.Close();<br />
}<br />
return result;<br />
}<br />
<br />
public int ExecuteNonQuery(string uspName, string[] paramArray, object[] valueArray)<br />
{<br />
SqlConnection sqlCon = null;<br />
try<br />
{<br />
int result=0;<br />
SqlCommand sqlCommand = new SqlCommand();<br />
sqlCon= GlobalConn();<br />
sqlCon.Open();<br />
sqlCommand.Connection = sqlCon;<br />
<br />
sqlCommand.CommandType = CommandType.StoredProcedure;<br />
sqlCommand.CommandText = uspName;<br />
int i = 0;<br />
while ((((!paramArray.Length.Equals(0)) && (!valueArray.Length.Equals(0))) && (paramArray.Length.Equals(valueArray.Length))) && (i < paramArray.Length))<br />
{<br />
if (paramArray[i] != null)<br />
{<br />
sqlCommand.Parameters.AddWithValue(paramArray[i], valueArray[i]);<br />
}<br />
i++;<br />
}<br />
result = sqlCommand.ExecuteNonQuery();<br />
sqlCon.Close();<br />
return result;<br />
<br />
}<br />
catch (Exception Ex)<br />
{<br />
<br />
throw new Exception(Ex.Message, Ex);<br />
<br />
}<br />
finally<br />
{<br />
sqlCon.Close();<br />
}<br />
<br />
}<br />
<br />
<br />
}<br />
}<br />
</div>harish chandnahttp://www.blogger.com/profile/06099169032804747646noreply@blogger.com1tag:blogger.com,1999:blog-8207114327320008493.post-48142278253721743752012-03-04T21:40:00.002-08:002012-03-04T21:40:29.116-08:00Encrypt Decrypt String<div dir="ltr" style="text-align: left;" trbidi="on">/// <summary><br />
/// Encrypt a string using dual encryption method. Return a encrypted cipher Text<br />
/// </summary><br />
/// <param name="toEncrypt">string to be encrypted</param><br />
/// <param name="useHashing">use hashing? send to for extra secirity</param><br />
/// <returns></returns><br />
public static string Encrypt(string toEncrypt, bool useHashing)<br />
{<br />
byte[] keyArray;<br />
byte[] toEncryptArray = UTF8Encoding.UTF8.GetBytes(toEncrypt);<br />
<br />
//System.Configuration.AppSettingsReader settingsReader = new AppSettingsReader();<br />
// Get the key from config file<br />
//string key = (string)settingsReader.GetValue("SecurityKey", typeof(String));<br />
//By Rohit kumar<br />
string key = "truworth infotech limited";<br />
//System.Windows.Forms.MessageBox.Show(key);<br />
if (useHashing)<br />
{<br />
MD5CryptoServiceProvider hashmd5 = new MD5CryptoServiceProvider();<br />
keyArray = hashmd5.ComputeHash(UTF8Encoding.UTF8.GetBytes(key));<br />
hashmd5.Clear();<br />
}<br />
else<br />
keyArray = UTF8Encoding.UTF8.GetBytes(key);<br />
<br />
TripleDESCryptoServiceProvider tdes = new TripleDESCryptoServiceProvider();<br />
tdes.Key = keyArray;<br />
tdes.Mode = CipherMode.ECB;<br />
tdes.Padding = PaddingMode.PKCS7;<br />
<br />
ICryptoTransform cTransform = tdes.CreateEncryptor();<br />
byte[] resultArray = cTransform.TransformFinalBlock(toEncryptArray, 0, toEncryptArray.Length);<br />
tdes.Clear();<br />
return Convert.ToBase64String(resultArray, 0, resultArray.Length);<br />
}<br />
<br />
<br />
/// <summary><br />
/// DeCrypt a string using dual encryption method. Return a DeCrypted clear string<br />
/// </summary><br />
/// <param name="cipherString">encrypted string</param><br />
/// <param name="useHashing">Did you use hashing to encrypt this data? pass true is yes</param><br />
/// <returns></returns><br />
public static string Decrypt(string cipherString, bool useHashing)<br />
{<br />
byte[] keyArray;<br />
byte[] toEncryptArray = Convert.FromBase64String(cipherString);<br />
<br />
//System.Configuration.AppSettingsReader settingsReader = new AppSettingsReader();<br />
//Get your key from config file to open the lock!<br />
//string key = (string)settingsReader.GetValue("SecurityKey", typeof(String));<br />
//BY Rohit kumar<br />
string key = "truworth infotech limited";<br />
<br />
if (useHashing)<br />
{<br />
MD5CryptoServiceProvider hashmd5 = new MD5CryptoServiceProvider();<br />
keyArray = hashmd5.ComputeHash(UTF8Encoding.UTF8.GetBytes(key));<br />
hashmd5.Clear();<br />
}<br />
else<br />
keyArray = UTF8Encoding.UTF8.GetBytes(key);<br />
<br />
TripleDESCryptoServiceProvider tdes = new TripleDESCryptoServiceProvider();<br />
tdes.Key = keyArray;<br />
tdes.Mode = CipherMode.ECB;<br />
tdes.Padding = PaddingMode.PKCS7;<br />
<br />
ICryptoTransform cTransform = tdes.CreateDecryptor();<br />
byte[] resultArray = cTransform.TransformFinalBlock(toEncryptArray, 0, toEncryptArray.Length);<br />
<br />
tdes.Clear();<br />
return UTF8Encoding.UTF8.GetString(resultArray);<br />
}</div>harish chandnahttp://www.blogger.com/profile/06099169032804747646noreply@blogger.com0tag:blogger.com,1999:blog-8207114327320008493.post-42893776005668230832012-02-14T23:32:00.000-08:002012-02-14T23:32:00.596-08:00Numbers Only! (1-9999)(Regualr Expression Validation)<div dir="ltr" style="text-align: left;" trbidi="on"><asp:RegularExpressionValidator ID="rgvClientCount" runat="server" ControlToValidate="txtClientCount"<br />
ValidationExpression="^[1-9][0-9]{0,7}$" ErrorMessage="Numbers Only! (1-9999)"<br />
Display="Dynamic" SetFocusOnError="true" ValidationGroup="Submit" /></div>harish chandnahttp://www.blogger.com/profile/06099169032804747646noreply@blogger.com0tag:blogger.com,1999:blog-8207114327320008493.post-18328748421249348272012-02-09T22:53:00.001-08:002012-02-09T22:53:22.197-08:00Update Query With Inner Join<div dir="ltr" style="text-align: left;" trbidi="on"><br />
UPDATE Patient<br />
SET Patient_Area = Area.Area_Desc --etc<br />
FROM Patient <br />
JOIN<br />
Area ON Patient.Patient_Area=Area.Area_Id<br />
<br />
</div>harish chandnahttp://www.blogger.com/profile/06099169032804747646noreply@blogger.com0tag:blogger.com,1999:blog-8207114327320008493.post-458668121518016002012-02-09T03:54:00.003-08:002012-02-09T03:54:43.293-08:00Catch Error Stored Procedure for error handling<div dir="ltr" style="text-align: left;" trbidi="on">USE [RiskCurve]<br />
GO<br />
/****** Object: StoredProcedure [dbo].[CatchError] Script Date: 02/09/2012 17:17:51 ******/<br />
SET ANSI_NULLS ON<br />
GO<br />
SET QUOTED_IDENTIFIER ON<br />
GO<br />
/*********************************************************<br />
Procedure Name: CatchError<br />
Version: 1.0<br />
Purpose: This procedure is used to save ERROR LOG . <br />
Input: Many peramnetrs<br />
Default value: None <br />
Output: <br />
Returns: <br />
Dependencies: <br />
Tables: Request<br />
Procedures: No<br />
Created By: Pradeep Kumar<br />
Created Date: 19-MAY-2011<br />
Checked by & Date: <br />
Modifier & Date: <br />
Modification Description: <br />
Modification Purpose:<br />
Limitations/Restriction:<br />
Algorithm: <br />
*********************************************************/<br />
<br />
<br />
ALTER PROCEDURE [dbo].[CatchError] <br />
AS<br />
<br />
BEGIN<br />
<br />
--To keep the error message<br />
Declare @ErrMsg as varchar(1000)<br />
<br />
BEGIN TRY <br />
<br />
INSERT INTO dbo.Error_Log(Error_Date,Error_Msg,Error_Number,Error_Source )<br />
SELECT DATEADD(HOUR, 20, GETDATE()), ERROR_MESSAGE() ,ERROR_NUMBER(), ERROR_PROCEDURE()<br />
<br />
<br />
END TRY <br />
<br />
BEGIN CATCH <br />
<br />
END CATCH<br />
<br />
set @ErrMsg = ERROR_MESSAGE()<br />
<br />
Raiserror(@ErrMsg -- Error Message<br />
, 16 --Severity Level<br />
, 1 --State<br />
)<br />
<br />
END<br />
</div>harish chandnahttp://www.blogger.com/profile/06099169032804747646noreply@blogger.com0tag:blogger.com,1999:blog-8207114327320008493.post-79309399206742437912012-02-09T03:54:00.001-08:002012-02-09T03:54:15.310-08:00harish chandnahttp://www.blogger.com/profile/06099169032804747646noreply@blogger.com0tag:blogger.com,1999:blog-8207114327320008493.post-61025910998579663702012-01-31T04:19:00.001-08:002012-01-31T04:19:31.529-08:00Regular Express Validation for Mobile Number<div dir="ltr" style="text-align: left;" trbidi="on"><asp:RegularExpressionValidator ID="RegularExpressionValidator1" runat="server" ControlToValidate="txtMobile"<br />
ValidationExpression="^[0-9]{10}" ErrorMessage="*" Display="Dynamic" ValidationGroup="Submit"><br />
</asp:RegularExpressionValidator></div>harish chandnahttp://www.blogger.com/profile/06099169032804747646noreply@blogger.com0tag:blogger.com,1999:blog-8207114327320008493.post-18941589575174284412011-12-07T22:22:00.001-08:002011-12-07T22:22:52.831-08:00Check Integer and Double Value in Javascript<div dir="ltr" style="text-align: left;" trbidi="on">function checkDouble(evt, strValue) {<br />
var iKeyCode = (evt.which) ? evt.which : event.keyCode;<br />
<br />
//if( iKeyCode <= 46 || iKeyCode > 58 || iKeyCode==47)<br />
if (iKeyCode <= 46 || iKeyCode > 57 || iKeyCode == 47) {<br />
<br />
// handle "." case<br />
if (iKeyCode == 46) {<br />
<br />
var is_dot = strValue.indexOf('.');<br />
if (is_dot == -1) {<br />
return true;<br />
}<br />
else {<br />
<br />
iKeyCode = 0;<br />
return false;<br />
}<br />
}<br />
else if (iKeyCode != 8 && iKeyCode != 13 && iKeyCode != 9) {<br />
//alert(iKeyCode);<br />
//iKeyCode= 0;<br />
<br />
//alert("Please enter Numeric or Decimal value");<br />
return false;<br />
}<br />
else if (iKeyCode == 8 || iKeyCode == 9) {<br />
return true;<br />
}<br />
else {<br />
iKeyCode = 0;<br />
return false;<br />
}<br />
}<br />
return true;<br />
}<br />
<br />
function checkInteger(evt, strValue) {<br />
var iKeyCode = (evt.which) ? evt.which : event.keyCode;<br />
<br />
//if( iKeyCode <= 46 || iKeyCode > 58 || iKeyCode==47)<br />
if (iKeyCode <= 47 || iKeyCode > 57 || iKeyCode == 47) {<br />
<br />
if (iKeyCode != 8 && iKeyCode != 13 && iKeyCode != 9) {<br />
//alert("Please enter Numeric or Decimal value");<br />
return false;<br />
}<br />
else if (iKeyCode == 8 || iKeyCode == 9) {<br />
return true;<br />
}<br />
else {<br />
iKeyCode = 0;<br />
return false;<br />
}<br />
}<br />
return true;<br />
}</div>harish chandnahttp://www.blogger.com/profile/06099169032804747646noreply@blogger.com0tag:blogger.com,1999:blog-8207114327320008493.post-66107826150364874402011-12-05T04:03:00.001-08:002011-12-05T04:03:57.349-08:00Types of Inherotance In C#<div dir="ltr" style="text-align: left;" trbidi="on"><h1 class="pt" id="ctl00_ContentPlaceHolder1_stitle">Types of Inheritance in C#.NET</h1><br />
<br />
Creating a new class from existing class is called as inheritance.<br />
<br />
<a href="http://www.programcall.com/19/csnet/inheritance-with-an-example-in-csnet.aspx" target="_blank" title="Example for inheritance">Inheritance with Example</a><br />
<br />
<span style="color: #e36c09;"><strong><span style="text-decoration: underline;">Inheritance can be classified to 5 types.<br />
</span></strong></span><br />
<ol><li>Single Inheritance </li>
<li>Hierarchical Inheritance </li>
<li>Multi Level Inheritance </li>
<li>Hybrid Inheritance </li>
<li>Multiple Inheritance </li>
</ol><span style="color: #4f6128;"><strong>1. Single Inheritance</strong></span><br />
<br />
when a single derived class is created from a single base class then the inheritance is called as single inheritance.<br />
<br />
<br />
<img alt="Single level Inheritance" src="http://images.programcall.com/Single-level-inheritance.jpg" /><br />
<br />
<br />
<span style="color: #4f6128;"><strong>2. Hierarchical Inheritance<br />
</strong></span><br />
when more than one derived class are created from a single base class, then that inheritance is called as hierarchical inheritance.<br />
<br />
<img alt="Hierarical Inheritance" src="http://images.programcall.com/inheritance-Hierarchical-cs.jpg" /><br />
<br />
<br />
<strong><span style="color: #4f6128;">3. Multi Level Inheritance<br />
</span></strong><br />
when a derived class is created from another derived class, then that inheritance is called as multi level inheritance.<br />
<br />
<img alt="Multi level Inheritance" src="http://images.programcall.com/inheritance-multi-level.jpg" /><br />
<br />
<br />
<span style="color: #4f6128;"><strong>4. Hybrid Inheritance<br />
</strong></span><br />
Any combination of single, hierarchical and multi level inheritances is called as hybrid inheritance.<br />
<br />
<br />
<img alt="Hybrid inheritance in C#" src="http://images.programcall.com/inheritance-hybrid.jpg" /><br />
<br />
<br />
<span style="color: #4f6128;"><strong>5. Multiple Inheritance<br />
</strong></span><br />
when a derived class is created from more than one base class then that inheritance is called as multiple inheritance. But multiple inheritance is not supported by .net using classes and can be done using interfaces.<br />
<br />
<img alt="Multiple inheritance in C#" src="http://images.programcall.com/multiple%20inheritance.jpg" /><br />
<br />
<br />
Handling the complexity that causes due to multiple inheritance is very complex. Hence it was not supported in dotnet with class and it can be done with interfaces.</div>harish chandnahttp://www.blogger.com/profile/06099169032804747646noreply@blogger.com0tag:blogger.com,1999:blog-8207114327320008493.post-82893477823538435972011-11-30T03:52:00.000-08:002011-11-30T03:52:45.601-08:00Save XML by stored procedure In SQL Server, also see the use of transaction<div dir="ltr" style="text-align: left;" trbidi="on">ALTER PROCEDURE [dbo].[AdminSectionFactLinkSave]<br />
@RegXML AS XML<br />
AS<br />
BEGIN <br />
<br />
BEGIN TRY<br />
<br />
BEGIN TRANSACTION <br />
<br />
DECLARE @SectionFact AS INT<br />
<br />
<br />
DELETE FROM SectionFactKnowFactLink WHERE SFKF_SFID IN (<br />
SELECT SectionFactLink.ITEM.query('./SFKF_SFID').value('.','INT')<br />
FROM @RegXML.nodes('/DocumentElement/SectionFactLink') AS SectionFactLink(ITEM))<br />
<br />
<br />
INSERT INTO SectionFactKnowFactLink(SFKF_SFID,SFKF_KFMasterID)<br />
SELECT SectionFactLink.ITEM.query('./SFKF_SFID').value('.','INT'),<br />
SectionFactLink.ITEM.query('./SFKF_KFMasterID').value('.','INT')<br />
FROM @RegXML.nodes('/DocumentElement/SectionFactLink') AS SectionFactLink(ITEM) <br />
WHERE SectionFactLink.ITEM.query('./SFKF_KFMasterID').value('.','INT') > 0<br />
<br />
COMMIT<br />
RETURN 0<br />
<br />
END TRY<br />
<br />
BEGIN CATCH<br />
EXEC CatchError<br />
IF @@TRANCOUNT > 0 ROLLBACK <br />
RETURN -1<br />
END CATCH<br />
<br />
END<br />
<br />
<br />
****************************************************************************<br />
<u>Catch Error</u>:<br />
<br />
<br />
CREATE PROCEDURE [dbo].[CatchError] <br />
AS<br />
<br />
BEGIN<br />
<br />
--To keep the error message<br />
Declare @ErrMsg as varchar(1000)<br />
<br />
BEGIN TRY <br />
<br />
INSERT INTO dbo.Error_Log(Error_Date,Error_Msg,Error_Number,Error_Source )<br />
SELECT DATEADD(HOUR, 20, GETDATE()), ERROR_MESSAGE() ,ERROR_NUMBER(), ERROR_PROCEDURE()<br />
<br />
<br />
END TRY <br />
<br />
BEGIN CATCH <br />
<br />
END CATCH<br />
<br />
set @ErrMsg = ERROR_MESSAGE()<br />
<br />
Raiserror(@ErrMsg -- Error Message<br />
, 16 --Severity Level<br />
, 1 --State<br />
)<br />
<br />
END<br />
<br />
</div>harish chandnahttp://www.blogger.com/profile/06099169032804747646noreply@blogger.com0tag:blogger.com,1999:blog-8207114327320008493.post-52972746576774890922011-11-29T21:06:00.001-08:002011-11-29T21:06:45.621-08:00Check Remot Server File Exist or not<div dir="ltr" style="text-align: left;" trbidi="on">WebRequest request; <br />
WebResponse response;<br />
String strMSG = string.Empty;<br />
request = WebRequest.Create(new Uri(“http://www.tradeget.com/images/topimg.jpg”));<br />
request.Method = “HEAD”;<br />
try<br />
{<br />
response = request.GetResponse();<br />
strMSG = string.Format(“{0} {1}”, response.ContentLength, response.ContentType);<br />
}<br />
catch (Exception ex)<br />
{<br />
//In case of File not Exist Server return the (404) Error<br />
strMSG = ex.Message;<br />
}<br />
<br />
lblMSG.Text = strMSG;</div>harish chandnahttp://www.blogger.com/profile/06099169032804747646noreply@blogger.com0tag:blogger.com,1999:blog-8207114327320008493.post-40780781112823793552011-11-29T21:03:00.000-08:002011-11-29T21:03:10.179-08:00SQ Server Interview Questions Part-2<div dir="ltr" style="text-align: left;" trbidi="on"><!--[if gte mso 9]><xml> <w:WordDocument> <w:View>Normal</w:View> <w:Zoom>0</w:Zoom> <w:PunctuationKerning/> <w:ValidateAgainstSchemas/> <w:SaveIfXMLInvalid>false</w:SaveIfXMLInvalid> <w:IgnoreMixedContent>false</w:IgnoreMixedContent> <w:AlwaysShowPlaceholderText>false</w:AlwaysShowPlaceholderText> <w:Compatibility> <w:BreakWrappedTables/> <w:SnapToGridInCell/> <w:WrapTextWithPunct/> <w:UseAsianBreakRules/> <w:DontGrowAutofit/> </w:Compatibility> <w:BrowserLevel>MicrosoftInternetExplorer4</w:BrowserLevel> </w:WordDocument> </xml><![endif]--><!--[if gte mso 9]><xml> <w:LatentStyles DefLockedState="false" LatentStyleCount="156"> </w:LatentStyles> </xml><![endif]--><!--[if gte mso 10]> <style>
/* Style Definitions */
table.MsoNormalTable
{mso-style-name:"Table Normal";
mso-tstyle-rowband-size:0;
mso-tstyle-colband-size:0;
mso-style-noshow:yes;
mso-style-parent:"";
mso-padding-alt:0in 5.4pt 0in 5.4pt;
mso-para-margin:0in;
mso-para-margin-bottom:.0001pt;
mso-pagination:widow-orphan;
font-size:10.0pt;
font-family:"Times New Roman";
mso-ansi-language:#0400;
mso-fareast-language:#0400;
mso-bidi-language:#0400;}
</style> <![endif]--> <br />
<b>What is normalization? Explain different levels of normalization?</b><br />
<div class="MsoNormal"><br />
</div>Check out the article Q100139 from Microsoft knowledge base and of course, there's much more information available in the net. It will be a good idea to get a hold of any RDBMS fundamentals text book, especially the one by C. J. Date. Most of the times, it will be okay if you can explain till third normal form.<br />
<div class="MsoNormal"><br />
</div><b>What is de-normalization and when would you go for it?</b><br />
<div class="MsoNormal"><br />
</div>As the name indicates, de-normalization is the reverse process of normalization. It is the controlled introduction of redundancy in to the database design. It helps improve the query performance as the number of joins could be reduced.<br />
<div class="MsoNormal"><br />
</div><b>How do you implement one-to-one, one-to-many and many-to-many relationships while designing tables?</b><br />
<div class="MsoNormal"><br />
</div>One-to-One relationship can be implemented as a single table and rarely as two tables with primary and foreign key relationships. One-to-Many relationships are implemented by splitting the data into two tables with primary key and foreign key relationships. Many-to-Many relationships are implemented using a junction table with the keys from both the tables forming the composite primary key of the junction table.<br />
<div class="MsoNormal"><br />
</div>It will be a good idea to read up a database designing fundamentals text book.<br />
<div class="MsoNormal"><br />
</div><b>What's the difference between a primary key and a unique key?</b><br />
<div class="MsoNormal"><br />
</div>Both primary key and unique enforce uniqueness of the column on which they are defined. But by default primary key creates a clustered index on the column, where are unique creates a non-clustered index by default. Another major difference is that, primary key does not allow <span style="color: navy; font-family: "Courier New"; font-size: 10.0pt;">NULL</span>s, but unique key allows one <span style="color: navy; font-family: "Courier New"; font-size: 10.0pt;">NULL</span> only.<br />
<div class="MsoNormal"><br />
</div><b>What are user defined data types and when you should go for them?</b><br />
<div class="MsoNormal"><br />
</div>User defined data types let you extend the base SQL Server data types by providing a descriptive name, and format to the database. Take for example, in your database, there is a column called <span style="color: navy; font-family: "Courier New"; font-size: 10.0pt;">Flight_Num</span> which appears in many tables. In all these tables it should be <span style="color: navy; font-family: "Courier New"; font-size: 10.0pt;">varchar(8)</span>. In this case you could create a user defined data type called <span style="color: navy; font-family: "Courier New"; font-size: 10.0pt;">Flight_num_type</span> of <span style="color: navy; font-family: "Courier New"; font-size: 10.0pt;">varchar(8)</span> and use it across all your tables.<br />
<div class="MsoNormal"><br />
</div>See <span style="color: navy; font-family: "Courier New"; font-size: 10.0pt;">sp_addtype</span>, <span style="color: navy; font-family: "Courier New"; font-size: 10.0pt;">sp_droptype</span> in books online.<br />
<div class="MsoNormal"><br />
</div><b>What is bit data type and what's the information that can be stored inside a bit column?</b><br />
<div class="MsoNormal"><br />
</div>Bit data type is used to store Boolean information like 1 or 0 (<span style="color: navy; font-family: "Courier New"; font-size: 10.0pt;">true</span> or <span style="color: navy; font-family: "Courier New"; font-size: 10.0pt;">false</span>). Until SQL Server 6.5 bit data type could hold either a 1 or 0 and there was no support for <span style="color: navy; font-family: "Courier New"; font-size: 10.0pt;">NULL</span>. But from SQL Server 7.0 onwards, bit data type can represent a third state, which is <span style="color: navy; font-family: "Courier New"; font-size: 10.0pt;">NULL</span>.<br />
<div class="MsoNormal"><br />
</div><b>Define candidate key, alternate key, composite key.</b><br />
<div class="MsoNormal"><br />
</div>A <span style="color: navy; font-family: "Courier New"; font-size: 10.0pt;">candidate key</span> is one that can identify each row of a table uniquely. Generally a candidate key becomes the primary key of the table. If the table has more than one candidate key, one of them will become the primary key, and the rest are called <span style="color: navy; font-family: "Courier New"; font-size: 10.0pt;">alternate keys</span>.<br />
<div class="MsoNormal"><br />
</div>A key formed by combining at least two or more columns is called <span style="color: navy; font-family: "Courier New"; font-size: 10.0pt;">composite key</span>.<br />
<div class="MsoNormal"><br />
</div><b>What are defaults? Is there a column to which a default cannot be bound?</b><br />
<div class="MsoNormal"><br />
</div>A default is a value that will be used by a column, if no value is supplied to that column while inserting data. <span style="color: navy; font-family: "Courier New"; font-size: 10.0pt;">IDENTITY</span> columns and timestamp columns can't have defaults bound to them. See <span style="color: navy; font-family: "Courier New"; font-size: 10.0pt;">CREATE DEFAULT</span> in books online.<br />
<div class="MsoNormal"><br />
</div><b>What is a transaction and what are ACID properties?</b><br />
<div class="MsoNormal"><br />
</div>A transaction is a logical unit of work in which, all the steps must be performed or none. <span style="color: navy; font-family: "Courier New"; font-size: 10.0pt;">ACID</span> stands for Atomicity, Consistency, Isolation, Durability. These are the properties of a transaction. For more information and explanation of these properties, see SQL Server books online or any <span style="color: navy; font-family: "Courier New"; font-size: 10.0pt;">RDBMS</span> fundamentals text book.<br />
<div class="MsoNormal"><br />
</div><b>Explain different isolation levels</b><br />
<div class="MsoNormal"><br />
</div>An isolation level determines the degree of isolation of data between concurrent transactions. The default SQL Server isolation level is Read Committed. Here are the other isolation levels (in the ascending order of isolation): Read Uncommitted, Read Committed, Repeatable Read, Serializable. See SQL Server books online for an explanation of the isolation levels. Be sure to read about <span style="color: navy; font-family: "Courier New"; font-size: 10.0pt;">SET TRANSACTION ISOLATION LEVEL</span>, which lets you customize the isolation level at the connection level.<br />
<div class="MsoNormal"><br />
</div><span style="color: navy; font-family: "Courier New"; font-size: 10.0pt;">CREATE INDEX myIndex ON myTable (myColumn)</span><br />
<div class="MsoNormal"><br />
</div><b>What type of Index will get created after executing the above statement?</b><br />
<div class="MsoNormal"><br />
</div>Non-clustered index. Important thing to note: By default a clustered index gets created on the primary key, unless specified otherwise.<br />
<div class="MsoNormal"><br />
</div><b>What is the maximum size of a row?</b><br />
<div class="MsoNormal"><br />
</div>8060 bytes. Do not be surprised with questions like 'What is the maximum number of columns per table'. Check out SQL Server books online for the page titled: "Maximum Capacity Specifications".<br />
<div class="MsoNormal"><br />
</div><b>Explain Active/Active and Active/Passive cluster configurations</b><br />
<div class="MsoNormal"><br />
</div>Hopefully you have experience setting up cluster servers. But if you do not, at least be familiar with the way clustering works and the two clustering configurations Active/Active and Active/Passive. SQL Server books online has enough information on this topic and there is a good white paper available on Microsoft site.<br />
<div class="MsoNormal"><br />
</div><b>Explain the architecture of SQL Server</b><br />
<div class="MsoNormal"><br />
</div>This is a very important question and you better be able to answer it if consider yourself a DBA. SQL Server books online is the best place to read about SQL Server architecture. Read up the chapter dedicated to SQL Server Architecture.<br />
<div class="MsoNormal"><br />
</div><b>What is Lock Escalation?</b><br />
<div class="MsoNormal"><br />
</div>Lock escalation is the process of converting a lot of low level locks (like row locks, page locks) into higher level locks (like table locks). Every lock is a memory structure too many locks would mean, more memory being occupied by locks. To prevent this from happening, SQL Server escalates the many fine-grain locks to fewer coarse-grain locks. Lock escalation threshold was definable in SQL Server 6.5, but from SQL Server 7.0 onwards it's dynamically managed by SQL Server.<br />
<div class="MsoNormal"><br />
</div><b>What's the difference between DELETE TABLE and TRUNCATE TABLE commands?</b><br />
<div class="MsoNormal"><br />
</div><span style="color: navy; font-family: "Courier New"; font-size: 10.0pt;">DELETE TABLE </span>is a logged operation, so the deletion of each row gets logged in the transaction log, which makes it slow. <span style="color: navy; font-family: "Courier New"; font-size: 10.0pt;">TRUNCATE TABLE </span>also deletes all the rows in a table, but it will not log the deletion of each row, instead it logs the de-allocation of the data pages of the table, which makes it faster. Of course, <span style="color: navy; font-family: "Courier New"; font-size: 10.0pt;">TRUNCATE TABLE </span>can be rolled back.<br />
<div class="MsoNormal"><br />
</div><b>Explain the storage models of OLAP</b><br />
<div class="MsoNormal"><br />
</div>Check out <span style="color: navy; font-family: "Courier New"; font-size: 10.0pt;">MOLAP</span>, <span style="color: navy; font-family: "Courier New"; font-size: 10.0pt;">ROLAP</span> and <span style="color: navy; font-family: "Courier New"; font-size: 10.0pt;">HOLAP</span> in SQL Server books online for more information.<br />
<div class="MsoNormal"><br />
</div>What are the new features introduced in SQL Server 2000 (or the latest release of SQL Server at the time of your interview)? What changed between the previous version of SQL Server and the current version?<br />
<div class="MsoNormal"><br />
</div>This question is generally asked to see how current is your knowledge. Generally there is a section in the beginning of the books online titled "What's New", which has all such information. Of course, reading just that is not enough, you should have tried those things to better answer the questions. Also check out the section titled "Backward Compatibility" in books online which talks about the changes that have taken place in the new version.<br />
<div class="MsoNormal"><br />
</div><b>What are constraints? Explain different types of constraints.</b><br />
<div class="MsoNormal"><br />
</div>Constraints enable the RDBMS enforce the integrity of the database automatically, without needing you to create triggers, rule or defaults.<br />
<div class="MsoNormal"><br />
</div>Types of constraints: <span style="color: navy; font-family: "Courier New"; font-size: 10.0pt;">NOT NULL, CHECK, UNIQUE, PRIMARY KEY, FOREIGN KEY</span><br />
<div class="MsoNormal"><br />
</div>For an explanation of these constraints see books online for the pages titled: "<span style="color: navy; font-family: "Courier New"; font-size: 10.0pt;">Constraints</span>" and "<span style="color: navy; font-family: "Courier New"; font-size: 10.0pt;">CREATE TABLE</span>", "<span style="color: navy; font-family: "Courier New"; font-size: 10.0pt;">ALTER TABLE</span>"<br />
<div class="MsoNormal"><br />
</div><b>What is an index? What are the types of indexes? How many clustered indexes can be created on a table? I create a separate index on each column of a table. what are the advantages and disadvantages of this approach?</b><br />
<div class="MsoNormal"><br />
</div>Indexes in SQL Server are similar to the indexes in books. They help SQL Server retrieve the data quicker.<br />
<div class="MsoNormal"><br />
</div>Indexes are of two types. Clustered indexes and non-clustered indexes. When you create a clustered index on a table, all the rows in the table are stored in the order of the clustered index key. So, there can be only one clustered index per table. Non-clustered indexes have their own storage separate from the table data storage. Non-clustered indexes are stored as B-tree structures (so do clustered indexes), with the leaf level nodes having the index key and it's row locater. The row located could be the RID or the Clustered index key, depending up on the absence or presence of clustered index on the table.<br />
<div class="MsoNormal"><br />
</div>If you create an index on each column of a table, it improves the query performance, as the query optimizer can choose from all the existing indexes to come up with an efficient execution plan. At the same time, data modification operations (such as <span style="color: navy; font-family: "Courier New"; font-size: 10.0pt;">INSERT, UPDATE, DELETE</span>) will become slow, as every time data changes in the table, all the indexes need to be updated. Another disadvantage is that, indexes need disk space, the more indexes you have, more disk space is used.<br />
<div class="MsoNormal"><br />
</div><b>What is RAID and what are different types of RAID configurations?</b><br />
<div class="MsoNormal"><br />
</div><span style="color: navy; font-family: "Courier New"; font-size: 10.0pt;">RAID </span>stands for <span style="color: navy; font-family: "Courier New"; font-size: 10.0pt;">Redundant Array of Inexpensive Disks</span>, used to provide fault tolerance to database servers. There are six <span style="color: navy; font-family: "Courier New"; font-size: 10.0pt;">RAID</span> levels 0 through 5 offering different levels of performance, fault tolerance. MSDN has some information about <span style="color: navy; font-family: "Courier New"; font-size: 10.0pt;">RAID</span> levels and for detailed information, check out the RAID advisory board's homepage<br />
<div class="MsoNormal"><br />
</div><b>What are the steps you will take to improve performance of a poor performing query?</b><br />
<div class="MsoNormal"><br />
</div>This is a very open ended question and there could be a lot of reasons behind the poor performance of a query. But some general issues that you could talk about would be: No indexes, table scans, missing or out of date statistics, blocking, excess recompilations of stored procedures, procedures and triggers without <span style="color: navy; font-family: "Courier New"; font-size: 10.0pt;">SET NOCOUNT ON</span>, poorly written query with unnecessarily complicated joins, too much normalization, excess usage of cursors and temporary tables.<br />
<div class="MsoNormal"><br />
</div>Some of the tools/ways that help you troubleshooting performance problems are: <br />
<div class="MsoNormal"><br />
</div><ul type="disc"><li class="MsoNormal" style="mso-list: l1 level1 lfo1; mso-margin-bottom-alt: auto; mso-margin-top-alt: auto; tab-stops: list .5in;"><span style="color: navy; font-family: "Courier New"; font-size: 10.0pt;">SET SHOWPLAN_ALL ON, </span></li>
<li class="MsoNormal" style="mso-list: l1 level1 lfo1; mso-margin-bottom-alt: auto; mso-margin-top-alt: auto; tab-stops: list .5in;"><span style="color: navy; font-family: "Courier New"; font-size: 10.0pt;">SET SHOWPLAN_TEXT ON, </span></li>
<li class="MsoNormal" style="mso-list: l1 level1 lfo1; mso-margin-bottom-alt: auto; mso-margin-top-alt: auto; tab-stops: list .5in;"><span style="color: navy; font-family: "Courier New"; font-size: 10.0pt;">SET STATISTICS IO ON, </span></li>
<li class="MsoNormal" style="mso-list: l1 level1 lfo1; mso-margin-bottom-alt: auto; mso-margin-top-alt: auto; tab-stops: list .5in;">SQL Server Profiler, </li>
<li class="MsoNormal" style="mso-list: l1 level1 lfo1; mso-margin-bottom-alt: auto; mso-margin-top-alt: auto; tab-stops: list .5in;">Windows NT /2000 Performance monitor, </li>
<li class="MsoNormal" style="mso-list: l1 level1 lfo1; mso-margin-bottom-alt: auto; mso-margin-top-alt: auto; tab-stops: list .5in;">Graphical execution plan in Query Analyzer.</li>
</ul>Download the white paper on performance tuning SQL Server from Microsoft web site. <br />
<div class="MsoNormal"><br />
</div><b>What are the steps you will take, if you are tasked with securing an SQL Server?</b><br />
<div class="MsoNormal"><br />
</div>Again this is another open ended question. Here are some things you could talk about: Preferring NT authentication, using server, database and application roles to control access to the data, securing the physical database files using <span style="color: navy; font-family: "Courier New"; font-size: 10.0pt;">NTFS </span>permissions, using an unguessable <span style="color: navy; font-family: "Courier New"; font-size: 10.0pt;">SA </span>password, restricting physical access to the SQL Server, renaming the Administrator account on the SQL Server computer, disabling the Guest account, enabling auditing, using multi-protocol encryption, setting up <span style="color: navy; font-family: "Courier New"; font-size: 10.0pt;">SSL</span>, setting up firewalls, isolating SQL Server from the web server etc.<br />
<div class="MsoNormal"><br />
</div>Read the white paper on SQL Server security from Microsoft website. Also check out My SQL Server security best practices<br />
<div class="MsoNormal"><br />
</div><b>What is a deadlock and what is a live lock? How will you go about resolving deadlocks?</b><br />
<div class="MsoNormal"><br />
</div>Deadlock is a situation when two processes, each having a lock on one piece of data, attempt to acquire a lock on the other's piece. Each process would wait indefinitely for the other to release the lock, unless one of the user processes is terminated. SQL Server detects deadlocks and terminates one user's process.<br />
<div class="MsoNormal"><br />
</div>A livelock is one, where a request for an exclusive lock is repeatedly denied because a series of overlapping shared locks keeps interfering. SQL Server detects the situation after four denials and refuses further shared locks. A livelock also occurs when read transactions monopolize a table or page, forcing a write transaction to wait indefinitely.<br />
<div class="MsoNormal"><br />
</div>Check out <span style="color: navy; font-family: "Courier New"; font-size: 10.0pt;">SET DEADLOCK_PRIORITY </span>and "<span style="color: navy; font-family: "Courier New"; font-size: 10.0pt;">Minimizing Deadlocks</span>" in SQL Server books online. Also check out the article Q169960 from Microsoft knowledge base.<br />
<div class="MsoNormal"><br />
</div><b>What is blocking and how would you troubleshoot it?</b><br />
<div class="MsoNormal"><br />
</div>Blocking happens when one connection from an application holds a lock and a second connection requires a conflicting lock type. This forces the second connection to wait, blocked on the first.<br />
<div class="MsoNormal"><br />
</div>Read up the following topics in SQL Server books online: Understanding and avoiding blocking, Coding efficient transactions.<br />
<div class="MsoNormal"><br />
</div><b>Explain CREATE DATABASE syntax</b><br />
<div class="MsoNormal"><br />
</div>Many of us are used to creating databases from the Enterprise Manager or by just issuing the command: <br />
<div class="MsoNormal"><br />
</div><span style="color: navy; font-family: "Courier New"; font-size: 10.0pt;">CREATE DATABASE MyDB</span>. <br />
<div class="MsoNormal"><br />
</div>But what if you have to create a database with two file groups, one on drive C and the other on drive D with log on drive E with an initial size of 600 MB and with a growth factor of 15%? That's why being a DBA you should be familiar with the <span style="color: navy; font-family: "Courier New"; font-size: 10.0pt;">CREATE DATABASE </span>syntax. Check out SQL Server books online for more information.<br />
<div class="MsoNormal"><br />
</div><b>How to restart SQL Server in single user mode? How to start SQL Server in minimal configuration mode?</b><br />
<div class="MsoNormal"><br />
</div>SQL Server can be started from command line, using the <span style="color: navy; font-family: "Courier New"; font-size: 10.0pt;">SQLSERVR.EXE</span>. This EXE has some very important parameters with which a DBA should be familiar with. -m is used for starting SQL Server in single user mode and <span style="color: navy; font-family: "Courier New"; font-size: 10.0pt;">-f</span> is used to start the SQL Server in minimal configuration mode. Check out SQL Server books online for more parameters and their explanations.<br />
<div class="MsoNormal"><br />
</div><b>As a part of your job, what are the DBCC commands that you commonly use for database maintenance?</b><br />
<div class="MsoNormal"><br />
</div><span style="color: navy; font-family: "Courier New"; font-size: 10.0pt;">DBCC CHECKDB, <br />
DBCC CHECKTABLE, <br />
DBCC CHECKCATALOG, <br />
DBCC CHECKALLOC, <br />
DBCC SHOWCONTIG, <br />
DBCC SHRINKDATABASE, <br />
DBCC SHRINKFILE etc</span>. <br />
<div class="MsoNormal"><br />
</div>But there are a whole load of DBCC commands which are very useful for DBAs. Check out SQL Server books online for more information.<br />
<div class="MsoNormal"><br />
</div><b>What are statistics, under what circumstances they go out of date, how do you update them?</b><br />
<div class="MsoNormal"><br />
</div>Statistics determine the selectivity of the indexes. If an indexed column has unique values then the selectivity of that index is more, as opposed to an index with non-unique values. Query optimizer uses these indexes in determining whether to choose an index or not while executing a query.<br />
<div class="MsoNormal"><br />
</div>Some situations under which you should update statistics:<br />
<div class="MsoNormal"><br />
</div><ol start="1" type="1"><li class="MsoNormal" style="mso-list: l2 level1 lfo2; mso-margin-bottom-alt: auto; mso-margin-top-alt: auto; tab-stops: list .5in;">If there is significant change in the key values in the index</li>
<li class="MsoNormal" style="mso-list: l2 level1 lfo2; mso-margin-bottom-alt: auto; mso-margin-top-alt: auto; tab-stops: list .5in;">If a large amount of data in an indexed column has been added, changed, or removed (that is, if the distribution of key values has changed), or the table has been truncated using the TRUNCATE TABLE statement and then repopulated</li>
<li class="MsoNormal" style="mso-list: l2 level1 lfo2; mso-margin-bottom-alt: auto; mso-margin-top-alt: auto; tab-stops: list .5in;">Database is upgraded from a previous version</li>
</ol>Look up SQL Server books online for the following commands: <br />
<div class="MsoNormal"><br />
</div><span style="color: navy; font-family: "Courier New"; font-size: 10.0pt;">UPDATE STATISTICS, <br />
STATS_DATE, <br />
DBCC SHOW_STATISTICS, <br />
CREATE STATISTICS, <br />
DROP STATISTICS, <br />
sp_autostats, <br />
sp_createstats, <br />
sp_updatestats</span><br />
<div class="MsoNormal"><br />
</div><b>What are the different ways of moving data/databases between servers and databases in SQL Server?</b><br />
<div class="MsoNormal"><br />
</div>There are lots of options available, you have to choose your option depending upon your requirements. Some of the options you have are: <br />
<div class="MsoNormal"><br />
</div><span style="color: navy; font-family: "Courier New"; font-size: 10.0pt;">BACKUP/RESTORE</span>, <span style="color: navy; font-family: "Courier New"; font-size: 10.0pt;"><br />
Detaching and attaching databases, <br />
Replication, <br />
DTS, <br />
BCP, <br />
logshipping</span>, <span style="color: navy; font-family: "Courier New"; font-size: 10.0pt;"><br />
INSERT...SELECT, <br />
SELECT...INTO</span>, <br />
creating <span style="color: navy; font-family: "Courier New"; font-size: 10.0pt;">INSERT </span>scripts to generate data.<br />
<div class="MsoNormal"><br />
</div><b>Explain different types of BACKUPs available in SQL Server? Given a particular scenario, how would you go about choosing a backup plan?</b><br />
<div class="MsoNormal"><br />
</div>Types of backups you can create in SQL Sever 7.0+ are Full database backup, differential database backup, transaction log backup, filegroup backup. Check out the <span style="color: navy; font-family: "Courier New"; font-size: 10.0pt;">BACKUP</span> and <span style="color: navy; font-family: "Courier New"; font-size: 10.0pt;">RESTORE </span>commands in SQL Server books online. Be prepared to write the commands in your interview. Books online also has information on detailed backup/restore architecture and when one should go for a particular kind of backup.<br />
<div class="MsoNormal"><br />
</div><b>What is database replication? What are the different types of replication you can set up in SQL Server?</b><br />
<div class="MsoNormal"><br />
</div>Replication is the process of copying/moving data between databases on the same or different servers. SQL Server supports the following types of replication scenarios:<br />
<div class="MsoNormal"><br />
</div> * Snapshot replication<br />
* Transactional replication (with immediate updating subscribers, with queued updating subscribers)<br />
* Merge replication<br />
<div class="MsoNormal"><br />
</div>See SQL Server books online for in-depth coverage on replication. Be prepared to explain how different replication agents function, what are the main system tables used in replication etc.<br />
<div class="MsoNormal"><br />
</div><b>How to determine the service pack currently installed on SQL Server?</b><br />
<div class="MsoNormal"><br />
</div>The global variable <span style="color: navy; font-family: "Courier New"; font-size: 10.0pt;">@@Version </span>stores the build number of the <span style="color: navy; font-family: "Courier New"; font-size: 10.0pt;">sqlservr.exe</span>, which is used to determine the service pack installed. To know more about this process visit SQL Server service packs and versions.<br />
<div class="MsoNormal"><br />
</div><b>What are cursors? Explain different types of cursors. What are the disadvantages of cursors? How can you avoid cursors?</b><br />
<div class="MsoNormal"><br />
</div>Cursors allow row-by-row processing of the resultsets.<br />
<div class="MsoNormal"><br />
</div>Types of cursors: <br />
<div class="MsoNormal"><br />
</div><span style="color: navy; font-family: "Courier New"; font-size: 10.0pt;">Static, <br />
Dynamic, <br />
Forward-only, <br />
Keyset-driven. </span><br />
<div class="MsoNormal"><br />
</div>See books online for more information.<br />
<div class="MsoNormal"><br />
</div>Disadvantages of cursors: Each time you fetch a row from the cursor, it results in a network roundtrip, where as a normal <span style="color: navy; font-family: "Courier New"; font-size: 10.0pt;">SELECT</span> query makes only one round trip, however large the resultset is. Cursors are also costly because they require more resources and temporary storage (results in more IO operations). Further, there are restrictions on the <span style="color: navy; font-family: "Courier New"; font-size: 10.0pt;">SELECT </span>statements that can be used with some types of cursors.<br />
<div class="MsoNormal"><br />
</div>Most of the times, set based operations can be used instead of cursors. Here is an example:<br />
<div class="MsoNormal"><br />
</div>If you have to give a flat hike to your employees using the following criteria:<br />
<div class="MsoNormal"><br />
</div><span style="color: navy; font-family: "Courier New"; font-size: 10.0pt;">Salary between 30000 and 40000 -- 5000 hike<br />
Salary between 40000 and 55000 -- 7000 hike<br />
Salary between 55000 and 65000 -- 9000 hike</span><br />
<div class="MsoNormal"><br />
</div>In this situation many developers tend to use a cursor, determine each employee's salary and update his salary according to the above formula. But the same can be achieved by multiple update statements or can be combined in a single <span style="color: navy; font-family: "Courier New"; font-size: 10.0pt;">UPDATE</span> statement as shown below:<br />
<div class="MsoNormal"><br />
</div><span style="color: navy; font-family: "Courier New"; font-size: 10.0pt;">UPDATE tbl_emp SET salary =<br />
CASE WHEN salary BETWEEN 30000 AND 40000 THEN salary + 5000<br />
WHEN salary BETWEEN 40000 AND 55000 THEN salary + 7000<br />
WHEN salary BETWEEN 55000 AND 65000 THEN salary + 10000<br />
END</span><br />
<div class="MsoNormal"><br />
</div>Another situation in which developers tend to use cursors: You need to call a stored procedure when a column in a particular row meets certain condition. You don't have to use cursors for this. This can be achieved using <span style="color: navy; font-family: "Courier New"; font-size: 10.0pt;">WHILE </span>loop, as long as there is a unique key to identify each row. <br />
<div class="MsoNormal"><br />
</div><b>Write down the general syntax for a SELECT statements covering all the options.</b><br />
<div class="MsoNormal"><br />
</div>Here's the basic syntax: (Also checkout <span style="color: navy; font-family: "Courier New"; font-size: 10.0pt;">SELECT</span> in books online for advanced syntax).<br />
<div class="MsoNormal"><br />
</div><span style="color: navy; font-family: "Courier New"; font-size: 10.0pt;">SELECT select_list<br />
[INTO new_table_]<br />
FROM table_source<br />
[WHERE search_condition]<br />
[GROUP BY group_by__expression]<br />
[HAVING search_condition]<br />
[ORDER BY order__expression [ASC | DESC] ]</span><br />
<div class="MsoNormal"><br />
</div><b>What is a join and explain different types of joins?</b><br />
<div class="MsoNormal"><br />
</div>Joins are used in queries to explain how different tables are related. Joins also let you select data from a table depending upon data from another table.<br />
<div class="MsoNormal"><br />
</div>Types of joins: <br />
<div class="MsoNormal"><br />
</div><span style="color: navy; font-family: "Courier New"; font-size: 10.0pt;">INNER JOINs, <br />
OUTER JOINs, <br />
CROSS JOINs</span><br />
<div class="MsoNormal"><br />
</div><span style="color: navy; font-family: "Courier New"; font-size: 10.0pt;">OUTER JOINs </span>are further classified as <br />
<div class="MsoNormal"><br />
</div><span style="color: navy; font-family: "Courier New"; font-size: 10.0pt;">LEFT OUTER JOINS, <br />
RIGHT OUTER JOINS </span>and <span style="color: navy; font-family: "Courier New"; font-size: 10.0pt;"><br />
FULL OUTER JOINS.</span><br />
<div class="MsoNormal"><br />
</div>For more information see pages from books online titled: "<i>Join Fundamentals</i>" and "<i>Using Joins</i>".<br />
<div class="MsoNormal"><br />
</div><b>Can you have a nested transaction?</b><br />
<div class="MsoNormal"><br />
</div>Yes, very much. Check out <span style="color: navy; font-family: "Courier New"; font-size: 10.0pt;">BEGIN TRAN, COMMIT, ROLLBACK, SAVE TRAN </span>and <span style="color: navy; font-family: "Courier New"; font-size: 10.0pt;">@@TRANCOUNT</span><br />
<div class="MsoNormal"><br />
</div><b>What is an extended stored procedure? Can you instantiate a COM object by using T-SQL?</b><br />
<div class="MsoNormal"><br />
</div>An extended stored procedure is a function within a DLL (written in a programming language like C, C++ using Open Data Services (ODS) API) that can be called from T-SQL, just the way we call normal stored procedures using the <span style="color: navy; font-family: "Courier New"; font-size: 10.0pt;">EXEC</span> statement. See books online to learn how to create extended stored procedures and how to add them to SQL Server.<br />
<div class="MsoNormal"><br />
</div>Yes, you can instantiate a COM (written in languages like VB, VC++) object from T-SQL by using <span style="color: navy; font-family: "Courier New"; font-size: 10.0pt;">sp_OACreate </span>stored procedure. <br />
<div class="MsoNormal"><br />
</div>Also see books online for <span style="color: navy; font-family: "Courier New"; font-size: 10.0pt;">sp_OAMethod</span>, <span style="color: navy; font-family: "Courier New"; font-size: 10.0pt;">sp_OAGetProperty</span>, <span style="color: navy; font-family: "Courier New"; font-size: 10.0pt;">sp_OASetProperty</span>, <span style="color: navy; font-family: "Courier New"; font-size: 10.0pt;">sp_OADestroy</span>. <br />
<div class="MsoNormal"><br />
</div><b>What is the system function to get the current user's user id?</b><br />
<div class="MsoNormal"><br />
</div><span style="color: navy; font-family: "Courier New"; font-size: 10.0pt;">USER_ID(). </span>Also check out other system functions like <br />
<div class="MsoNormal"><br />
</div><span style="color: navy; font-family: "Courier New"; font-size: 10.0pt;">USER_NAME(), <br />
SYSTEM_USER, <br />
SESSION_USER, <br />
CURRENT_USER, <br />
USER, <br />
SUSER_SID(), <br />
HOST_NAME().</span><br />
<div class="MsoNormal"><br />
</div><b>What are triggers? How many triggers you can have on a table? How to invoke a trigger on demand?</b><br />
<div class="MsoNormal"><br />
</div>Triggers are special kind of stored procedures that get executed automatically when an <span style="color: navy; font-family: "Courier New"; font-size: 10.0pt;">INSERT, UPDATE </span>or <span style="color: navy; font-family: "Courier New"; font-size: 10.0pt;">DELETE </span>operation takes place on a table.<br />
<div class="MsoNormal"><br />
</div>In SQL Server 6.5 you could define only 3 triggers per table, one for <span style="color: navy; font-family: "Courier New"; font-size: 10.0pt;">INSERT</span>, one for <span style="color: navy; font-family: "Courier New"; font-size: 10.0pt;">UPDATE </span>and one for <span style="color: navy; font-family: "Courier New"; font-size: 10.0pt;">DELETE</span>. From SQL Server 7.0 onwards, this restriction is gone, and you could create multiple triggers per each action. But in 7.0 there's no way to control the order in which the triggers fire. In SQL Server 2000 you could specify which trigger fires first or fires last using <span style="color: navy; font-family: "Courier New"; font-size: 10.0pt;">sp_settriggerorder</span><br />
<div class="MsoNormal"><br />
</div>Triggers cannot be invoked on demand. They get triggered only when an associated action (<span style="color: navy; font-family: "Courier New"; font-size: 10.0pt;">INSERT, UPDATE, DELETE</span>) happens on the table on which they are defined.<br />
<div class="MsoNormal"><br />
</div>Triggers are generally used to implement business rules, auditing. Triggers can also be used to extend the referential integrity checks, but wherever possible, use constraints for this purpose, instead of triggers, as constraints are much faster.<br />
<div class="MsoNormal"><br />
</div>Till SQL Server 7.0, triggers fire only after the data modification operation happens. So in a way, they are called post triggers. But in SQL Server 2000 you could create pre triggers also. Search SQL Server 2000 books online for <span style="color: navy; font-family: "Courier New"; font-size: 10.0pt;">INSTEAD OF </span>triggers.<br />
<div class="MsoNormal"><br />
</div>Also check out books online for '<span style="color: navy; font-family: "Courier New"; font-size: 10.0pt;">inserted table</span>', '<span style="color: navy; font-family: "Courier New"; font-size: 10.0pt;">deleted table</span>' and <span style="color: navy; font-family: "Courier New"; font-size: 10.0pt;">COLUMNS_UPDATED()</span><br />
<div class="MsoNormal"><br />
</div>There is a trigger defined for <span style="color: navy; font-family: "Courier New"; font-size: 10.0pt;">INSERT</span> operations on a table, in an <span style="color: navy; font-family: "Courier New"; font-size: 10.0pt;">OLTP </span>system. The trigger is written to instantiate a <span style="color: navy; font-family: "Courier New"; font-size: 10.0pt;">COM</span> object and pass the newly inserted rows to it for some custom processing. <br />
<div class="MsoNormal"><br />
</div><b>What do you think of this implementation? Can this be implemented better?</b><br />
<div class="MsoNormal"><br />
</div>Instantiating <span style="color: navy; font-family: "Courier New"; font-size: 10.0pt;">COM</span> objects is a time consuming process and since you are doing it from within a trigger, it slows down the data insertion process. Same is the case with sending emails from triggers. This scenario can be better implemented by logging all the necessary data into a separate table, and have a job which periodically checks this table and does the needful.<br />
<br />
<h1><span style="font-size: 18.0pt;">In Database Systems What Is Meant By Referential Integrity?</span></h1>Referential <a href="http://www.blurtit.com/q7884403.html">integrity</a> is a rule that also helps in maintaining the organized form of data. It preserves the relationships defined between the data entities during the data updates. In the case of relational data model, relations/<a href="http://sql-databases.blurtit.com/q719632.html"><span class="klink"><span style="color: #1183c9; text-decoration: none; text-underline: none;">tables</span></span></a> are the data entities. All these entities in a <a href="http://sql-databases.blurtit.com/q315992.html">database</a> are connected with on another <a href="http://sql-databases.blurtit.com/q719632.html"><span class="klink"><span style="color: #1183c9; text-decoration: none; text-underline: none;">via</span></span></a> one or more attributes. These attributes are normally called 'primary key 'of the table.<br />
<br />
By applying the rules of referential integrity, you ensures that no any update can be effective that destroy the relations defined between tables , i.e. no any value of foreign key can be entered that does not has a corresponding <a href="http://www.blurtit.com/q9204316.html">primary</a> key value in the related table.<br />
In a database, data is stored in more than one relation, thus complete information about an entity may be stored in more than one tables. When two relations/tables are linked with each other through a relationship, one is called a master table and other is called child table. <br />
<br />
The referential integrity rules are used in such cases to provide the following advantages:<br />
1. If the record does not exist in master table, it can not be stored in child table.<br />
2. A record can not be deleted from master table unless that record is deleted first from relevant child table<br />
<br />
<h1><span style="font-size: 18.0pt;">What Is The Scope Of Good Database Design?</span></h1><div class="MsoNormal" style="margin-bottom: 12.0pt;">A good <a href="http://sql-databases.blurtit.com/q315992.html">database</a> is one that is simple to understand and well planned. The database doesn't have redundant tables. One can use ERD's (Entity-Relationship Diagrams) or EER's (Enhanced-Entity Relationship Diagrams) in order to make a good database. <br />
<br />
Now about the scope; well if you have good database then</div><ol start="1" type="1"><li class="MsoNormal" style="mso-list: l0 level1 lfo3; mso-margin-bottom-alt: auto; mso-margin-top-alt: auto; tab-stops: list .5in;">Easy to locate the data or information in no time.</li>
<li class="MsoNormal" style="mso-list: l0 level1 lfo3; mso-margin-bottom-alt: auto; mso-margin-top-alt: auto; tab-stops: list .5in;">No redundant data.</li>
<li class="MsoNormal" style="mso-list: l0 level1 lfo3; mso-margin-bottom-alt: auto; mso-margin-top-alt: auto; tab-stops: list .5in;">No repetition.</li>
<li class="MsoNormal" style="mso-list: l0 level1 lfo3; mso-margin-bottom-alt: auto; mso-margin-top-alt: auto; tab-stops: list .5in;">More security. Like if one is accessing or changing the data other can not change the same data at that time.</li>
<li class="MsoNormal" style="mso-list: l0 level1 lfo3; mso-margin-bottom-alt: auto; mso-margin-top-alt: auto; tab-stops: list .5in;"><a href="http://sql-databases.blurtit.com/q346256.html"><span class="klink"><span style="color: #1183c9; text-decoration: none; text-underline: none;">Table</span></span></a> references (keys like : <a href="http://www.blurtit.com/q9204316.html">Primary</a> and foreign keys) are easy to maintain.</li>
</ol><h1><span style="font-size: 18.0pt;">What Is A Key? Describe Different Types Of Keys Used In Database?</span></h1>Key<br />
A key is a single or combination of multiple fields. Its purpose is to access or retrieve data rows from table according to the requirement. <a href="http://sql-databases.blurtit.com/q775064.html"><span class="klink"><span style="color: #1183c9; text-decoration: none; text-underline: none;">The keys</span></span></a> are defined in tables to access or sequence the stored data quickly and smoothly. They are also used to create links between different tables.<br />
<br />
Types of Keys<br />
The following tables or relations will be used to <a href="http://www.blurtit.com/q1350730.html">define</a> different types of keys.<br />
<br />
Primary Key<br />
The attribute or combination of attributes that uniquely identifies a row or record in a relation is known as primary key.<br />
<br />
Secondary key<br />
A field or combination of fields that is basis for <a href="http://www.blurtit.com/q5350574.html">retrieval</a> is known as secondary key. Secondary key is a non-unique field. One secondary key value may refer to many records.<br />
<br />
Candidate Key or Alternate key<br />
A relation can have only one <a href="http://www.blurtit.com/q9204316.html">primary</a> key. It may contain many fields or combination of fields that can be used as primary key. One field or combination of fields is used as primary key. The fields or combination of fields that are not used as primary key are known as candidate key or alternate key.<br />
Composite key or concatenate key<br />
A primary key that consists of two or more attributes is known as composite key.<br />
<br />
Sort Or control key<br />
A field or combination of fields that is used to physically <a href="http://www.blurtit.com/uq3381663.html">sequence</a> the stored data called sort key. It is also known s control key.<br />
<br />
Foreign Key<br />
A foreign key is an attribute or combination of attribute in a relation whose value match a primary key in another relation. The <a href="http://sql-databases.blurtit.com/q775064.html"><span class="klink"><span style="color: #1183c9; text-decoration: none; text-underline: none;">table</span></span></a> in which foreign key is created is called as dependent table. The table to which foreign key is refers is known as parent table<br />
<br />
<h1><span style="font-size: 18.0pt;">Discuss Different Types Of Queries Use In Any Database?</span></h1><br />
<div class="MsoNormal"><br />
</div></div>harish chandnahttp://www.blogger.com/profile/06099169032804747646noreply@blogger.com0tag:blogger.com,1999:blog-8207114327320008493.post-10465493949980153322011-11-29T04:11:00.001-08:002011-11-29T21:00:57.986-08:00SQ Server Interview Questions Part-1<div dir="ltr" style="text-align: left;" trbidi="on"><h1 class="entry-title">MS SQL Server interview questions</h1><div class="entry-meta"><span class="author vcard">By <a class="url fn n" href="http://www.techinterviews.com/author/admin/" title="View all posts by admin">admin</a></span><span class="meta-sep"> | </span><span class="entry-date"><abbr class="published" title="2004-11-03T14:22:21-0500">November 3, 2004</abbr></span></div><div class="entry-content">This one always gets asked. For a while the database interview questions were limited to Oracle and generic database design questions. This is a set of more than a hundred Microsoft SQL Server interview questions. Some questions are open-ended, and some do not have answers.<br />
<ol style="text-align: left;"><li>What is normalization? - Well a relational database is basically composed of tables that contain related data. So the Process of organizing this data into tables is actually referred to as normalization. </li>
<li>What is a <a href="http://www.google.com/search?num=100&hl=en&lr=&c2coff=1&client=firefox-a&oi=defmore&q=define:stored+procedure">Stored Procedure</a>? - Its nothing but a set of T-SQL statements combined to perform a single task of several tasks. Its basically like a Macro so when you invoke the Stored procedure, you actually run a set of statements. </li>
<li>Can you give an example of Stored Procedure? - sp_helpdb , sp_who2, sp_renamedb are a set of system defined stored procedures. We can also have user defined stored procedures which can be called in similar way.</li>
<li>What is a trigger? - Triggers are basically used to implement business rules. Triggers is also similar to stored procedures. The difference is that it can be activated when data is added or edited or deleted from a table in a database. </li>
<li>What is a view? - If we have several tables in a db and we want to view only specific columns from specific tables we can go for views. It would also suffice the needs of security some times allowing specfic users to see only specific columns based on the permission that we can configure on the view. Views also reduce the effort that is required for writing queries to access specific columns every time. </li>
<li>What is an Index? - When queries are run against a db, an index on that db basically helps in the way the data is sorted to process the query for faster and data retrievals are much faster when we have an index. </li>
<li>What are the types of indexes available with SQL Server? - There are basically two types of indexes that we use with the <a href="http://www.microsoft.com/sql/default.asp">SQL Server</a>. Clustered and the Non-Clustered. </li>
<li>What is the basic difference between <a href="http://www.sql-server-performance.com/gv_index_data_structures.asp">clustered and a non-clustered index</a>? - The difference is that, Clustered index is unique for any given table and we can have only one clustered index on a table. The leaf level of a clustered index is the actual data and the data is resorted in case of clustered index. Whereas in case of non-clustered index the leaf level is actually a pointer to the data in rows so we can have as many non-clustered indexes as we can on the db. </li>
<li>What are cursors? - Well cursors help us to do an operation on a set of data that we retreive by commands such as Select columns from table. For example : If we have duplicate records in a table we can remove it by declaring a cursor which would check the records during retreival one by one and remove rows which have duplicate values. </li>
<li>When do we use the UPDATE_STATISTICS command? - This command is basically used when we do a large processing of data. If we do a large amount of deletions any modification or Bulk Copy into the tables, we need to basically update the indexes to take these changes into account. UPDATE_STATISTICS updates the indexes on these tables accordingly. </li>
<li>Which TCP/IP port does SQL Server run on? - SQL Server runs on port 1433 but we can also change it for better security. </li>
<li>From where can you change the default port? - From the Network Utility TCP/IP properties –> Port number.both on client and the server. </li>
<li>Can you tell me the difference between DELETE & TRUNCATE commands? - Delete command removes the rows from a table based on the condition that we provide with a WHERE clause. Truncate will actually remove all the rows from a table and there will be no data in the table after we run the truncate command. </li>
<li>Can we use Truncate command on a table which is referenced by FOREIGN KEY? - No. We cannot use Truncate command on a table with Foreign Key because of referential integrity. </li>
<li>What is the use of DBCC commands? - DBCC stands for database consistency checker. We use these commands to check the consistency of the databases, i.e., maintenance, validation task and status checks. </li>
<li>Can you give me some DBCC command options?(Database consistency check) - DBCC CHECKDB - Ensures that tables in the db and the indexes are correctly linked.and DBCC CHECKALLOC - To check that all pages in a db are correctly allocated. DBCC SQLPERF - It gives report on current usage of transaction log in percentage. DBCC CHECKFILEGROUP - Checks all tables file group for any damage. </li>
<li>What command do we use to rename a db? - sp_renamedb ‘oldname’ , ‘newname’ </li>
<li>Well sometimes sp_reanmedb may not work you know because if some one is using the db it will not accept this command so what do you think you can do in such cases? - In such cases we can first bring to db to single user using sp_dboptions and then we can rename that db and then we can rerun the sp_dboptions command to remove the single user mode. </li>
<li>What is the difference between a HAVING CLAUSE and a WHERE CLAUSE? - Having Clause is basically used only with the GROUP BY function in a query. WHERE Clause is applied to each row before they are part of the GROUP BY function in a query. </li>
<li>What do you mean by COLLATION? - Collation is basically the sort order. There are three types of sort order Dictionary case sensitive, Dictonary - case insensitive and Binary. </li>
<li>What is a Join in SQL Server? - Join actually puts data from two or more tables into a single result set. </li>
<li>Can you explain the types of Joins that we can have with Sql Server? - There are three types of joins: Inner Join, Outer Join, Cross Join </li>
<li>When do you use <a href="http://msdn.microsoft.com/library/default.asp?url=/library/en-us/adminsql/ad_mon_perf_86ib.asp">SQL Profiler</a>? - SQL Profiler utility allows us to basically track connections to the SQL Server and also determine activities such as which SQL Scripts are running, failed jobs etc.. </li>
<li>What is a <a href="http://www.databasejournal.com/features/mssql/article.php/3085211">Linked Server</a>? - Linked Servers is a concept in SQL Server by which we can add other SQL Server to a Group and query both the SQL Server dbs using T-SQL Statements. </li>
<li>Can you link only other SQL Servers or any database servers such as Oracle? - We can link any server provided we have the OLE-DB provider from Microsoft to allow a link. For Oracle we have a OLE-DB provider for oracle that microsoft provides to add it as a linked server to the sql server group. </li>
<li>Which stored procedure will you be running to add a linked server? - <a href="http://msdn.microsoft.com/library/default.asp?url=/library/en-us/tsqlref/ts_sp_adda_8gqa.asp">sp_addlinkedserver</a>, <a href="http://www.dbazine.com/sharma2.shtml">sp_addlinkedsrvlogin</a></li>
<li>What are the OS services that the SQL Server installation adds? - MS SQL SERVER SERVICE, SQL AGENT SERVICE, DTC (Distribution transac co-ordinator) </li>
<li>Can you explain the role of each service? - SQL SERVER - is for running the databases SQL AGENT - is for automation such as Jobs, DB Maintanance, Backups DTC - Is for linking and connecting to other SQL Servers </li>
<li>How do you troubleshoot SQL Server if its running very slow? - First check the processor and memory usage to see that processor is not above 80% utilization and memory not above 40-45% utilization then check the disk utilization using Performance Monitor, Secondly, use SQL Profiler to check for the users and current SQL activities and jobs running which might be a problem. Third would be to run UPDATE_STATISTICS command to update the indexes </li>
<li>Lets say due to N/W or Security issues client is not able to connect to server or vice versa. How do you troubleshoot? - First I will look to ensure that port settings are proper on server and client Network utility for connections. ODBC is properly configured at client end for connection ——Makepipe & readpipe are utilities to check for connection. Makepipe is run on Server and readpipe on client to check for any connection issues. </li>
<li>What are the authentication modes in SQL Server? - Windows mode and mixed mode (SQL & Windows). </li>
<li>Where do you think the users names and passwords will be stored in sql server? - They get stored in master db in the sysxlogins table. </li>
<li>What is log shipping? Can we do logshipping with SQL Server 7.0 - Logshipping is a new feature of SQL Server 2000. We should have two SQL Server - Enterprise Editions. From Enterprise Manager we can configure the logshipping. In logshipping the transactional log file from one server is automatically updated into the backup database on the other server. If one server fails, the other server will have the same db and we can use this as the DR (disaster recovery) plan. </li>
<li>Let us say the SQL Server crashed and you are rebuilding the databases including the master database what procedure to you follow? - For restoring the master db we have to stop the SQL Server first and then from command line we can type SQLSERVER –m which will basically bring it into the maintenance mode after which we can restore the master db. </li>
<li>Let us say master db itself has no backup. Now you have to rebuild the db so what kind of action do you take? - (I am not sure- but I think we have a command to do it). </li>
<li>What is BCP? When do we use it? - BulkCopy is a tool used to copy huge amount of data from tables and views. But it won’t copy the structures of the same. </li>
<li>What should we do to copy the tables, schema and views from one SQL Server to another? - We have to write some DTS packages for it. </li>
<li>What are the different types of joins and what dies each do? </li>
<li>What are the four main query statements? </li>
<li>What is a sub-query? When would you use one? </li>
<li>What is a NOLOCK? </li>
<li>What are three SQL keywords used to change or set someone’s permissions? </li>
<li>What is the difference between HAVING clause and the WHERE clause? </li>
<li>What is referential integrity? What are the advantages of it? </li>
<li>What is database normalization? </li>
<li>Which command using Query Analyzer will give you the version of SQL server and operating system? </li>
<li>Using query analyzer, name 3 ways you can get an accurate count of the number of records in a table? </li>
<li>What is the purpose of using COLLATE in a query? </li>
<li>What is a trigger? </li>
<li>What is one of the first things you would do to increase performance of a query? For example, a boss tells you that “a query that ran yesterday took 30 seconds, but today it takes 6 minutes” </li>
<li>What is an execution plan? When would you use it? How would you view the execution plan? </li>
<li>What is the STUFF function and how does it differ from the REPLACE function? </li>
<li>What does it mean to have quoted_identifier on? What are the implications of having it off? </li>
<li>What are the different types of replication? How are they used? </li>
<li>What is the difference between a local and a global variable? </li>
<li>What is the difference between a Local temporary table and a Global temporary table? How is each one used? </li>
<li>What are cursors? Name four types of cursors and when each one would be applied? </li>
<li>What is the purpose of UPDATE STATISTICS? </li>
<li>How do you use DBCC statements to monitor various aspects of a SQL server installation? </li>
<li>How do you load large data to the SQL server database? </li>
<li>How do you check the performance of a query and how do you optimize it? </li>
<li>How do SQL server 2000 and XML linked? Can XML be used to access data? </li>
<li>What is SQL server agent? </li>
<li>What is referential integrity and how is it achieved? </li>
<li>What is indexing? </li>
<li>What is normalization and what are the different forms of normalizations? </li>
<li>Difference between server.transfer and server.execute method? </li>
<li>What id de-normalization and when do you do it? </li>
<li>What is better - 2nd Normal form or 3rd normal form? Why? </li>
<li>Can we rewrite subqueries into simple select statements or with joins? Example? </li>
<li>What is a function? Give some example? </li>
<li>What is a stored procedure? </li>
<li>Difference between Function and Procedure-in general? </li>
<li>Difference between Function and Stored Procedure? </li>
<li>Can a stored procedure call another stored procedure. If yes what level and can it be controlled? </li>
<li>Can a stored procedure call itself(recursive). If yes what level and can it be controlled.? </li>
<li>How do you find the number of rows in a table? </li>
<li>Difference between Cluster and Non-cluster index? </li>
<li>What is a table called, if it does not have neither Cluster nor Non-cluster Index? </li>
<li>Explain DBMS, RDBMS? </li>
<li>Explain basic SQL queries with SELECT from where Order By, Group By-Having? </li>
<li>Explain the basic concepts of SQL server architecture? </li>
<li>Explain couple pf features of SQL server </li>
<li>Scalability, Availability, Integration with internet, etc.)? </li>
<li>Explain fundamentals of Data ware housing & OLAP? </li>
<li>Explain the new features of SQL server 2000? </li>
<li>How do we upgrade from SQL Server 6.5 to 7.0 and 7.0 to 2000? </li>
<li>What is data integrity? Explain constraints? </li>
<li>Explain some DBCC commands? </li>
<li>Explain sp_configure commands, set commands? </li>
<li>Explain what are db_options used for? </li>
<li>What is the basic functions for master, msdb, tempdb databases? </li>
<li>What is a job? </li>
<li>What are tasks? </li>
<li>What are primary keys and foreign keys? </li>
<li>How would you Update the rows which are divisible by 10, given a set of numbers in column? </li>
<li>If a stored procedure is taking a table data type, how it looks? </li>
<li>How m-m relationships are implemented? </li>
<li>How do you know which index a table is using? </li>
<li>How will oyu test the stored procedure taking two parameters namely first name and last name returning full name? </li>
<li>How do you find the error, how can you know the number of rows effected by last SQL statement? </li>
<li>How can you get @@error and @@rowcount at the same time? </li>
<li>What are sub-queries? Give example? In which case sub-queries are not feasible? </li>
<li>What are the type of joins? When do we use Outer and Self joins? </li>
<li>Which virtual table does a trigger use? </li>
<li>How do you measure the performance of a stored procedure? </li>
<li>Questions regarding Raiseerror? </li>
<li>Questions on identity? </li>
<li>If there is failure during updation of certain rows, what will be the state?</li>
</ol><ol style="text-align: left;"><li> </li>
<li> </li>
</ol>***********************************************************************************<br />
<span style="color: red;">What is normalization?</span> <br />
<span style="color: #3333ff;">Normalization is the basic concept used in designing a database. Its nothing but, an advise given to the database to have minimal repetition of data, highly structured, highly secured, easy to retrieve. In high level definition, the Process of organizing data into tables is referred to as normalization.</span> <br />
<br />
<span style="color: red;">What is a stored procedure:</span><br />
<span style="color: #3333ff;">Stored procedures are precompiled T-SQL statements combined to perform a single task of several tasks. Its basically like a Macro so when you invoke the Stored procedure, you actually run a set of statements. As, its precompiled statement, execution of Stored procedure is compatatively high when compared to an ordinary T-SQL statement.</span><br />
<br />
<span style="color: red;">What is the difference between UNION ALL Statement and UNION ?</span><br />
<span style="color: #3333ff;">The main difference between UNION ALL statement and UNION is UNION All statement is much faster than UNION,the reason behind this is that because UNION ALL statement does not look for duplicate rows, but on the other hand UNION statement does look for duplicate rows, whether or not they exist.</span> <br />
<span style="color: red;">Example for Stored Procedure?</span><br />
<span style="color: #3333ff;"> They are three kinds of stored procedures,1.System stored procedure – Start with sp_2. User defined stored procedure – SP created by the user.3. Extended stored procedure – SP used to invoke a process in the external systems.Example for system stored proceduresp_helpdb - Database and its propertiessp_who2 – Gives details about the current user connected to your system. sp_renamedb – Enable you to rename your database</span><br />
<br />
<span style="color: red;">What is a trigger?</span> <br />
<span style="color: #3333ff;">Triggers are precompiled statements similar to Stored Procedure. It will automatically invoke for a particular operation. Triggers are basically used to implement business rules. </span><br />
<br />
<span style="color: red;">What is a view?</span><br />
<span style="color: #3333ff;">If we have several tables in a db and we want to view only specific columns from specific tables we can go for views. It would also suffice the needs of security some times allowing specfic users to see only specific columns based on the permission that we can configure on the view. Views also reduce the effort that is required for writing queries to access specific columns every time.</span> <br />
<br />
<span style="color: red;">What is an Index?</span><br />
<span style="color: #3333ff;">When queries are run against a db, an index on that db basically helps in the way the data is sorted to process the query for faster and data retrievals are much faster when we have an index. </span><br />
<br />
<ol></ol></div></div>harish chandnahttp://www.blogger.com/profile/06099169032804747646noreply@blogger.com0tag:blogger.com,1999:blog-8207114327320008493.post-11089904172721757102011-11-28T20:35:00.000-08:002011-11-29T03:04:14.602-08:00.Net Basics<div dir="ltr" style="text-align: left;" trbidi="on"><h2><b>What is Access Modifier?</b></h2>Objects in .NET are created from a class, struct, etc. These definitions, as well as the properties, methods, or events within them, use an access modifer that determines who can access it. A class or structure outside of the current class definition or even the in different projects have different access rights depending on the type of accessor used. Take a look at the accessors below:<br />
<b>Access modifiers determine the extent to which a variable or method can be accessed from another class or object</b><br />
<br />
The following five accessibility levels can be specified using the access modifiers<br />
<br />
* Private<br />
* Protected<br />
* Internal<br />
* Protected internal<br />
* Public <br />
<b>public</b><br />
This makes the member visible globally<br />
Eg. class Gremlin { public Gremlin spawn() { return new Gremlin(); } } <br />
<br />
<b>protected</b><br />
This makes the member visible to the current class and to child classes. Protected members are only accessible in the same class or through inherited classes.<br />
Eg. class ParentClass { protected int valueA; }<br />
class ChildClass { public void doSomething() { valueA = 3; } }<br />
<br />
<b>private</b><br />
This makes the member visible only to the current class.<br />
Eg. class MyCollection { private int lastIndex; }<br />
<br />
<b>internal / Friend</b><br />
This makes the member visible within the same assembly.<br />
Eg. internal class ProprietaryStuff { } <br />
<br />
<b>protected internal / Protected Friend</b><br />
A combination of protected and internal. This makes the member visible within the same assembly and also makes the member visible to an inheriting class. An inheriting class does not need to be in the same assembly to access the member. <br />
***********************************************************************************<br />
<br />
<div style="text-align: center;"><u><b>Diffrence between SQL Server 2000, 2005 & 2008</b></u></div><div style="text-align: left;"><br />
</div><div style="text-align: left;"><span id="_ctl5_ctlTopic"><span id="_ctl5_ctlTopic_ctlPanelBar"><span id="_ctl5_ctlTopic_ctlPanelBar_ctlTopicsRepeater__ctl20_lblFullMessage">[color=123][color=123][/color]<span style="font-family: Arial;">--Reference:<br />
http://stackoverflow.com/questions/198478/advantages-of-ms-sql-server-2008-over-ms-sql-server-2005<br />
<br />
<u>SQL SERVER 2000:</u><br />
<br />
1.Query Analyser and Enterprise manager are separate.<br />
2.No XML datatype is used.<br />
3.We can create maximum of 65,535 databases.<br />
4.Nill<br />
5.Nill<br />
6.Nill<br />
7.Nill<br />
8.Nill<br />
9.Nill<br />
10.Nill<br />
11.Nill<br />
12.Nill<br />
13.cant compress the tables and indexes.<br />
14.Datetime datatype is used for both date and time.<br />
15.No varchar(max) or varbinary(max) is available.<br />
16.No table datatype is included.<br />
17.No SSIS is included.<br />
18.CMS is not available.<br />
19.PBM is not available.<br />
20.PIVOT and UNPIVOT functions are not used.<br />
<br />
<u>SQL SERVER 2005:</u><br />
<br />
1.Both are combined as SSMS(Sql Server management Studio).<br />
2.XML datatype is introduced.<br />
3.We can create 2(pow(20))-1 databases.<br />
4.Exception Handling<br />
5.Varchar(Max) data type<br />
6.DDL Triggers<br />
7.DataBase Mirroring<br />
8.RowNumber function for paging<br />
9.Table fragmentation<br />
10.Full Text Search<br />
11.Bulk Copy Update<br />
12.Cant encrypt<br />
13.Can Compress tables and indexes.(Introduced in 2005 SP2)<br />
14.Datetime is used for both date and time.<br />
15.Varchar(max) and varbinary(max) is used.<br />
16.No table datatype is included.<br />
17.SSIS is started using.<br />
18.CMS is not available.<br />
19.PBM is not available.<br />
20.PIVOT and UNPIVOT functions are used.<br />
<br />
[u]SQL SERVER 2008:<br />
<br />
1.Both are combined as SSMS(Sql Server management Studio).<br />
2.XML datatype is used.<br />
3.We can create 2(pow(20))-1 databases.<br />
4.Exception Handling<br />
5.Varchar(Max) data type<br />
6.DDL Triggers<br />
7.DataBase Mirroring<br />
8.RowNumber function for paging<br />
9.Table fragmentation<br />
10.Full Text Search<br />
11.Bulk Copy Update<br />
12.Can encrypt the entire database introduced in 2008.<br />
--check it(http://technet.microsoft.com/en-us/library/cc278098(SQL.100).aspx)<br />
(http://www.sqlservercentral.com/articles/Administration/implementing_efs/870/) <br />
(http://www.kodyaz.com/articles/sql-server-2005-database-encryption-step-by-step.aspx)<br />
(http://www.sql-server-performance.com/articles/dev/encryption_2005_1_p1.aspx)<br />
(http://geekswithblogs.net/chrisfalter/archive/2008/05/08/encrypt-documents-with-sql-server.aspx)<br />
13.Can compress tables and indexes.<br />
-http://www.mssqltips.com/tip.asp?tip=1582<br />
14.Date and time are seperately used for date and time datatype,geospatial and timestamp with internal timezone <br />
is used.<br />
15.Varchar(max) and varbinary(max) is used.<br />
16.Table datatype introduced.<br />
17.SSIS avails in this version.<br />
18.Central Management Server(CMS) is Introduced.<br />
-http://msdn.microsoft.com/en-us/library/bb934126.aspx<br />
-http://www.sqlskills.com/BLOGS/KIMBERLY/post/SQL-Server-2008-Central-Management-Servers-have-you-seen-these.aspx<br />
19.Policy based management(PBM) server is Introduced.<br />
-http://www.mssqltips.com/tip.asp?tip=1492<br />
-http://msdn.microsoft.com/en-us/library/bb510667.aspx<br />
20.PIVOT and UNPIVOT functions are used.<br />
-http://blog.sqlauthority.com/2008/06/07/sql-server-pivot-and-unpivot-table-examples/<br />
-N.S.SATHISH</span>[/color]</span></span></span></div><div style="text-align: center;">***********************************************************************************<br />
<u><b>Generic Κλασς</b></u><br />
<br />
<h1>What are Generic Classes</h1><ul style="text-align: left;">Generic classes are classes that can hold objects of any class. Containers such as Lists, Arrays, Bags and Sets are examples of generic classes. Container classes have the property that the type of objects they contain is of little interest to the definer of the container class but of crucial importance to the user of the particular container. Therefore, the type of the contained object is an argument to the container class. The definer specifies the container class in terms of this argument and the user specifies what the type of the contained object is to be for the particular container.</ul><br />
<br />
<br />
</div><br />
</div>harish chandnahttp://www.blogger.com/profile/06099169032804747646noreply@blogger.com0tag:blogger.com,1999:blog-8207114327320008493.post-74850539690978015012011-11-25T04:04:00.001-08:002011-11-25T04:04:25.335-08:00Interview Questions for 1 Year Experience:<div dir="ltr" style="text-align: left;" trbidi="on"><h3>Dotnet Framework Interview Questions for 1 Year Experience:</h3>1. What is CLR and it's functions?<br />
2. How memory is managed in Dotnet applications?<br />
Hint: Automatically by Garbage collector<br />
3. What is an assembly?<br />
4. What is a strong name?<br />
5. What is MSIL?<br />
<h3>C# Interview Questions for 1 Year Experience:</h3>1. What are the 4 pillars of Object Oriented Programming?<br />
2. What is a Class? What is an Object?<br />
3. What is a partial class?<br />
4. What is a sealed class?<br />
5. What is constructor?<br />
6. What is stringbuilder?<br />
<h3>ADO.Net Interview Questions for 1 Year Experience:</h3>1. What is connection string?<br />
2. What is Datareader?<br />
3. Difference between Dataset and datareader?<br />
4. What is Ado.Net?<br />
5. Namespace for using sqlserver database?<br />
<h3>ASP.Net Interview Questions for 1 Year Experience:</h3>1. What is web.config file and it's use?<br />
2. What is global.asax?<br />
3. What is session?<br />
4. Which all controls you have used in your project?<br />
5. What is gridview?<br />
6. What is Authentication in ASP.Net and types of authentication?<br />
<h3>SQL Server Interview Questions for 1 Year Experience:</h3>1. What is Primary key, unique key and difference between them?<br />
2. What is index? Types of index?<br />
3. What is a stored procedure? Why it is better than inline query?<br />
Hint: Stored Procedure is precompiles and has a execution plan. Hence faster execution.<br />
4. You might be asked to write simple query<br />
5. What is inner join<br />
<br />
</div>harish chandnahttp://www.blogger.com/profile/06099169032804747646noreply@blogger.com0tag:blogger.com,1999:blog-8207114327320008493.post-51242158059630082442011-11-25T04:03:00.001-08:002011-11-25T04:03:17.678-08:00Basic .NET, ASP.NET, OOPS and SQL Server Interview questions and answers.<div dir="ltr" style="text-align: left;" trbidi="on"><strong>Basic .NET, ASP.NET, OOPS and SQL Server Interview questions and answers.</strong><br />
<ul style="font-size: 12px; font-weight: normal; line-height: 25px; margin-left: 15px; padding-left: 15px; width: 650px;"><li> What is IL code, CLR, CTS, GAC & GC?</li>
<li> How can we do Assembly versioning?</li>
<li>can you explain how ASP.NET application life cycle and page life cycle events fire?</li>
<li> What is the problem with Functional Programming?</li>
<li>Can you define OOP and the 4 principles of OOP?</li>
<li>What are Classes and Objects?</li>
<li> What is Inheritance?</li>
<li>What is Polymorphism, overloading, overriding and virtual?</li>
<li> Can you explain encapsulation and abstraction?</li>
<li>What is an abstract class?</li>
<li> Define Interface & What is the diff. between abstract & interface?</li>
<li> What problem does Delegate Solve ?</li>
<li> What is a Multicast delegate ?</li>
<li> What are events and what's the difference between delegates and events?</li>
<li> How can we make Asynchronous method calls using delegates ?</li>
<li> What is a stack, Heap, Value types and Reference types ?</li>
<li> What is boxing and unboxing ?</li>
<li> Can you explain ASP.NET application and Page life cycle ?</li>
<li> What is Authentication, Authorization, Principal & Identity objects? </li>
<li> How can we do Inproc and outProc session management ?</li>
<li> How can we windows , forms and passport authentication and authorization in ASP.NET ?</li>
<li> In a parent child relationship which constructor fires first ?</li>
</ul><div style="font-family: Arial,Helvetica,sans-serif; font-size: 12px; line-height: 25px; padding: 10px;"><strong>MVC ASP.NET Q & A series</strong></div><ul style="font-size: 12px; font-weight: normal; line-height: 25px; margin-left: 15px; padding-left: 15px; width: 650px;"><li> How to create a simple "Hello World" using ASP.NET MVC template? - Lab 1</li>
<li> How to pass data from controller to views? - Lab 2</li>
<li>Can we see a simple sample of model using MVC template? - Lab 3</li>
<li> How can we create simple input screens using MVC template? - Lab 4</li>
<li>How can we create MVC views faster and make them strong typed by using HTML helper? - Lab 5</li>
<li>Can we see how easy it is do unit testing for MVC application? - Lab 6</li>
<li> What is MVC routing? - Lab 7</li>
<li>How can we set default values & validate MVC routes? - Lab 8</li>
<li> How we can define actions & navigate from one page to other page? - Lab 9</li>
</ul><div style="font-family: Arial,Helvetica,sans-serif; font-size: 12px; line-height: 25px; padding: 10px;"><strong>WCF, WPF, Silverlight, LINQ, Azure and EF 4.0 interview question and answers</strong></div><ul style="font-size: 12px; font-weight: normal; line-height: 25px; margin-left: 15px; padding-left: 15px; width: 650px;"><li> What is SOA, Services and Messages ?</li>
<li> What is the difference between Service and Component? </li>
<li> What are basic steps to create a WCF service ?</li>
<li> What are endpoints, address, contracts and bindings? </li>
<li> What are various ways of hosting WCF service? </li>
<li> What is the difference of hosting a WCF service on IIS and Self hosting?</li>
<li> What is the difference between BasicHttpBinding and WsHttpBinding?</li>
<li> How can we do debugging and tracing in WCF?</li>
<li> Can you explain transactions in WCF (theory)?</li>
<li> How can we self host WCF service ?</li>
<li> What are the different ways of implementing WCF Security?</li>
<li> How can we implement SSL security on WCF(Transport Security)?</li>
<li> How can we implement transport security plus message security in WCF ?</li>
<li> How can we do WCF instancing ?</li>
<li> How Can we do WCF Concurency and throttling?</li>
<li> Can you explain the architecture of Silverlight ?</li>
<li> What are the basic things needed to make a silverlight application ?</li>
<li> How can we do transformations in SilverLight ?</li>
<li> Can you explain animation fundamentals in SilverLight?</li>
<li> What are the different layout methodologies in SilverLight?</li>
<li> Can you explain one way , two way and one time bindings?</li>
<li> How can we consume WCF service in SilverLight?</li>
<li> How can we connect databases using SilverLight?</li>
<li> What is LINQ and can you explain same with example?</li>
<li> Can you explain a simple example of LINQ to SQL?</li>
<li> How can we define relationships using LINQ to SQL?</li>
<li> How can we optimize LINQ relationships queries using ‘DataLoadOptions’?</li>
<li> Can we see a simple example of how we can do CRUD using LINQ to SQL?</li>
<li> How can we call a stored procedure using LINQ?</li>
<li> What is the need of WPF when we had GDI, GDI+ and DirectX?</li>
<li> Can you explain how we can make a simple WPF application?</li>
<li> Can you explain the three rendering modes i.e. Tier 0 , Tier 1 and Tier 2? </li>
<li> Can you explain the Architecture of WPF? </li>
<li> What is Azure?</li>
<li> Can you explain Azure Costing?</li>
<li> Can we see a simple Azure sample program?</li>
<li> What are the different steps to create a simple Worker application?</li>
<li> Can we understand Blobs in steps, Tables & Queues ?</li>
<li> Can we see a simple example for Azure tables?</li>
<li> What is Package and One click deploy(Deployment Part - 1) ?</li>
<li> What is Web.config transformation (Deployment Part-2)?</li>
<li> What is MEF and how can we implement the same?</li>
<li> How is MEF different from DIIOC?</li>
<li> Can you show us a simple implementation of MEF in Silverlight ?</li>
</ul><div style="font-family: Arial,Helvetica,sans-serif; font-size: 12px; font-weight: bold; line-height: 25px; padding: 10px;">Design pattern, Estimation, VSTS, Project management interview questions and answers <br />
<br />
<strong> Design Pattern Training / Interview Questions and Answers</strong></div><ul style="font-size: 12px; font-weight: normal; line-height: 25px; margin-left: 15px; padding-left: 15px; width: 650px;"><li> Introduction </li>
<li> Factory Design Pattern </li>
<li> Abstract Factory Design Pattern</li>
<li> Builder Design Pattern</li>
<li> Prototype Design Pattern</li>
<li> Singleton Design Pattern</li>
<li> Adapter Design Pattern</li>
<li> Bridge Design Pattern</li>
<li> Composite Design Pattern</li>
<li> Decorator Design Pattern</li>
<li> Facade Design Pattern</li>
<li> Flyweight Design Pattern</li>
<li> Proxy Design Pattern</li>
<li> Mediator Design Pattern</li>
<li> Memento Design Pattern</li>
<li> Interpreter Design Pattern</li>
<li> Iterator Design Pattern</li>
<li> COR Design Pattern</li>
<li> Command Design Pattren</li>
<li> State Design Pattern</li>
<li> Strategy Design Pattern</li>
<li> Observer Design Pattern</li>
<li> Template Design Pattern</li>
<li> Visitor Design Pattern </li>
<li> Dependency IOC Design pattern</li>
<li> MVC , MVP , DI IOC and MVVM Training / Interview Questions and Answers</li>
</ul><br />
<div style="font-family: Arial,Helvetica,sans-serif; font-size: 12px; font-weight: bold; line-height: 25px; padding: 10px;">UML Training / Interview Questions and Answers</div><ul style="font-size: 12px; font-weight: normal; line-height: 25px; margin-left: 15px; margin-top: 15px; padding-left: 15px; width: 650px;"><li> Introduction</li>
<li> Use Case Diagrams</li>
<li> Class Digrams</li>
<li> Object Diagrams</li>
<li> Sequence Digrams</li>
<li> Collaboration Diagrams</li>
<li> Activity Diagram</li>
<li> State chart Diagrams</li>
<li> Component Diagrams</li>
<li> Deployment Diagrams</li>
<li> Stereo Types Diagrams</li>
<li> Package Diagram and UML Project Flow.</li>
</ul><div style="font-family: Arial,Helvetica,sans-serif; font-size: 12px; font-weight: bold; line-height: 25px; padding: 10px;">Function points Training / Interview Questions and Answers</div><ul style="font-size: 12px; font-weight: normal; line-height: 25px; margin-left: 15px; margin-top: 15px; padding-left: 15px; width: 650px;"><li> Introduction</li>
<li> Application Boundary</li>
<li> EI Fundamentals</li>
<li> EO Fundamentals</li>
<li> EQ Fundamentals</li>
<li> EIF</li>
<li> Fundamentals</li>
<li> ILF Fundamentals</li>
<li> GSC Fundamentals</li>
<li> Productivity Factor</li>
<li> Costing and a complete estimation of customer screen using function points.</li>
<li> FXCOP and Stylecop Training / Interview Questions and Answers</li>
</ul><br />
<div style="font-family: Arial,Helvetica,sans-serif; font-size: 12px; font-weight: bold; line-height: 25px; padding: 10px;">VSTS Training / Interview Questions and Answers</div><ul style="font-size: 12px; font-weight: normal; line-height: 25px; margin-left: 15px; margin-top: 15px; padding-left: 15px; width: 650px;"><li> VSTS questions and answer videos</li>
<li> What is Unit Testing & can we see an example of the same?</li>
<li> How can we write data driven test using NUNIT & VS Test?</li>
<li> Can we see simple example of a unit test for database operation?</li>
<li> How can we do automated testing using Visual Studio Test?</li>
<li> How can we do Load Testing using VSTS test?</li>
<li> Can you explain database unit testing?</li>
<li> How can we do test coverage using VSTS system?</li>
<li> How can we do manual Testing using VSTS?</li>
<li> What is Ordered Test in VSTS test?</li>
</ul><br />
<br />
<div style="font-family: Arial,Helvetica,sans-serif; font-size: 12px; font-weight: bold; line-height: 25px; padding: 10px;">Enterprise Application Blocks Training</div><ul style="font-size: 12px; font-weight: normal; line-height: 25px; margin-left: 15px; margin-top: 15px; padding-left: 15px; width: 650px;"><li> Introduction</li>
<li> Validation Application Block</li>
<li> Logging Application Block</li>
<li> Exception error Handling</li>
<li> Data Application Block</li>
<li> Caching Application Block</li>
<li> Security Application Block</li>
<li> Policy Injection Application Block and</li>
<li> Unity Application Block</li>
</ul><br />
<div style="font-family: Arial,Helvetica,sans-serif; font-size: 12px; font-weight: bold; line-height: 25px; padding: 10px;">Complete .NET invoicing project end to end</div><ul style="font-size: 12px; font-weight: normal; line-height: 25px; margin-left: 15px; margin-top: 15px; padding-left: 15px; width: 650px;"><li> Introduction to .NET Projects </li>
<li> Different levels of Programming </li>
<li> Necessary Tools </li>
<li> What should we learn ? </li>
<li> The IIS </li>
<li> Making UI using .net IDE </li>
<li> Database, The SQL Server </li>
<li> Connecting ASP.net with Database </li>
<li> Loading the Data Grid </li>
<li> Update and Delete </li>
<li> Validations </li>
<li> Issue with the Code </li>
<li> Two Tier Architecture </li>
<li> Three Tier Architecture </li>
<li> Database Normalization </li>
<li> Session and State Management </li>
<li> Using Enterprise Application Block </li>
<li> Aggregation and Composition </li>
<li> Implementing Interfaces and Factory</li>
<li> Inheritance relationship </li>
<li> Abstract Class Implementation</li>
</ul><br />
<div style="font-family: Arial,Helvetica,sans-serif; font-size: 12px; font-weight: bold; line-height: 25px; padding: 10px;">Share point interview Training / Interview Questions and Answers videos</div><ul style="font-size: 12px; font-weight: normal; line-height: 25px; margin-left: 15px; margin-top: 15px; padding-left: 15px; width: 650px;"><li> What is SharePoint, WSS and MOSS? </li>
<li> How does WSS actually work? </li>
<li> What is Site and SiteCollection?</li>
<li> What is the use of SQL server in SharePoint & use of Virtual path provider?</li>
<li> What is Ghosting and UnGhosting in SharePoint?</li>
<li> How can we create a site in SharePoint?</li>
<li> How can we Customize a SharePoint Site?</li>
<li> What kind of readymade functional modules exists collaboration?</li>
<li> Can you display a simple Custom Page in SharePoint?</li>
<li> How can we implement behind code ASPX pages in SharePoint?</li>
<li> What is the concept of features in SharePoint?</li>
<li> I want a feature to be only displayed to admin?</li>
<li> How do we debug SharePoint error’s? </li>
<li> Why customized pages are parsed using no-compile mode?</li>
<li> Can you explain WSS model? </li>
<li> How can we use custom controls in SharePoint? </li>
<li> How can we display ASCX control in SharePoint pages?</li>
<li> What are Web Parts?</li>
<li> How can we deploy a simple Webpart in SharePoint?</li>
<li> How can we achieve customization and personalization using WebParts?</li>
<li> How can we create custom editor for WebPart?</li>
<li> SharePoint is about centralizing documents, how similar is to the windows folder?</li>
<li> What are custom fields and content types?</li>
<li> Can you explain SharePoint Workflows?</li>
<li> What is a three-state Workflow in SharePoint?</li>
<li> How can we create sharepoint workflow using sharepoint designer?</li>
</ul><br />
<div style="font-family: Arial,Helvetica,sans-serif; font-size: 12px; font-weight: bold; line-height: 25px; padding: 10px;">.NET best practices and SQL Server Training / Interview Questions and Answers</div><ul style="font-size: 12px; font-weight: normal; line-height: 25px; margin-left: 15px; margin-top: 15px; padding-left: 15px; width: 650px;"><li> Basics :- Query plan, Logical operators and Logical reads</li>
<li> Point 1 :- Unique keys improve table scan performance.</li>
<li> Point 2 :- Choose Table scan for small & Seek scan for large records</li>
<li> Point 3 :- Use Covering index to reduce RID (Row Identifier) lookup</li>
<li> Point4:- Keep index size as small as possible.</li>
<li> Point5:- use numeric as compared to text data type.</li>
<li> Point6:- use indexed view for aggregated SQL Queries </li>
<li> Finding high memory consuming functions </li>
<li> Improve garbage collector performance using finalize/dispose pattern</li>
<li> How to use performance counters to gather performance data</li>
</ul></div>harish chandnahttp://www.blogger.com/profile/06099169032804747646noreply@blogger.com0tag:blogger.com,1999:blog-8207114327320008493.post-85017316104239912942011-11-25T03:55:00.000-08:002011-11-25T03:55:22.896-08:00Asp.Net Interview Questions<div dir="ltr" style="text-align: left;" trbidi="on"><h1 class="entry-title">ASP.NET interview questions and answers</h1><div class="entry-meta"><span class="author vcard">By <a class="url fn n" href="http://www.techinterviews.com/author/admin/" title="View all posts by admin">admin</a></span><span class="meta-sep"> | </span><span class="entry-date"><abbr class="published" title="2005-04-17T02:45:52-0400">April 17, 2005</abbr></span></div><ol><li>Describe the difference between a Thread and a Process?</li>
<li>What is a Windows Service and how does its lifecycle differ from a “standard†EXE?</li>
<li>What is the maximum amount of memory any single process on Windows can address? Is this different than the maximum virtual memory for the system? How would this affect a system design?</li>
<li>What is the difference between an EXE and a DLL?</li>
<li>What is strong-typing versus weak-typing? Which is preferred? Why?</li>
<span id="more-193"></span>
<li>What’s wrong with a line like this? DateTime.Parse(myString</li>
<li>What are PDBs? Where must they be located for debugging to work?</li>
<li>What is cyclomatic complexity and why is it important?</li>
<li>Write a standard lock() plus double check to create a critical section around a variable access.</li>
<li>What is FullTrust? Do GAC’ed assemblies have FullTrust?</li>
<li>What benefit does your code receive if you decorate it with attributes demanding specific Security permissions?</li>
<li>What does this do? gacutil /l | find /i “about”</li>
<li>What does this do? sn -t foo.dll</li>
<li>What ports must be open for DCOM over a firewall? What is the purpose of Port 135?</li>
<li>Contrast OOP and SOA. What are tenets of each</li>
<li>How does the XmlSerializer work? What ACL permissions does a process using it require?</li>
<li>Why is catch(Exception) almost always a bad idea?</li>
<li>What is the difference between Debug.Write and Trace.Write? When should each be used?</li>
<li>What is the difference between a Debug and Release build? Is there a significant speed difference? Why or why not?</li>
<li>Does JITting occur per-assembly or per-method? How does this affect the working set?</li>
<li>Contrast the use of an abstract base class against an interface?</li>
<li>What is the difference between a.Equals(b) and a == b?</li>
<li>In the context of a comparison, what is object identity versus object equivalence?</li>
<li>How would one do a deep copy in .NET?</li>
<li>Explain current thinking around IClonable.</li>
<li>What is boxing?</li>
<li>Is string a value type or a reference type?</li>
</ol></div>harish chandnahttp://www.blogger.com/profile/06099169032804747646noreply@blogger.com0tag:blogger.com,1999:blog-8207114327320008493.post-36272336663796769022011-11-11T04:13:00.001-08:002011-11-11T04:13:51.000-08:00Dot net Interview Questions Companywise<div dir="ltr" style="text-align: left;" trbidi="on"><span style="font-size: x-small;"><span style="text-decoration: underline;"><strong>Common Questions</strong></span></span><br />
Difference between asp and asp.net<br />
- How do you do exception management<br />
- If you are using components in your application, how can you handle exceptions raised in a component<br />
- Can we throw exception from catch block<br />
- How do you relate an aspx page with its code behind page<br />
- What are the types of assemblies and where can u store them and how<br />
- What is difference between value and reference types<br />
- Is array reference type / value type<br />
- Is string reference type / value type<br />
- What is web.config. How many web.config files can be allowed to use in an application<br />
- What is differnce between machine.config and web.config<br />
- What is shared and private assembly<br />
- What are asynchronous callbacks<br />
- How to write unmanaged code and how to identify whether the code is managed / unmanaged.<br />
- How to authenticate users using web.config<br />
- What is strong name and which tool is used for this<br />
- What is gacutil.exe. Where do we store assemblies<br />
- Should sn.exe be used before gacutil.exe<br />
- What does assemblyinfo.cs file consists of<br />
- What is boxing and unboxing<br />
- Types of authentications in ASP.NET<br />
- difference between Trace and Debug<br />
- Difference between Dataset and DataReader<br />
- What is custom tag in web.config<br />
- How do you define authentication in web.Config<br />
- What is sequence of code in retrieving data from database<br />
- About DTS package<br />
- What provider ADO.net use by default<br />
- Where does web.config info stored? Will this be stored in the registry?<br />
- How do you register the dotnet component or assembly?<br />
- Difference between asp and asp.net<br />
- Whis is stateless asp or asp.net?<br />
- Authentication mechanism in dotnet<br />
- State management in asp.net<br />
- Types of values mode can hold session state in web.config<br />
- About WebService<br />
- What are Http handler<br />
- What is view state and how this can be done and was this there in asp?<br />
- Types of optimization and name a few and how do u do?<br />
- About DataAdapters<br />
- Features of a dataset<br />
- How do you do role based security<br />
- Difference between Response.Expires and Expires.Absolute<br />
- Types of object in asp<br />
- About duration in caching technique<br />
- Types of configuration files and ther differences<br />
- Difference between ADO and ADO.net<br />
- About Postback<br />
- If you are calling three SPs from a window application how do u check for the performance of the SPS<br />
<br />
#61607; Database<br />
<br />
- What is normalization<br />
- What is an index and types of indexes. How many number of indexes can be used per table<br />
- What is a constraint. Types of constraints<br />
- What are code pages<br />
- What is referential integrity<br />
- What is a trigger<br />
- What are different types of joins<br />
- What is a self join<br />
- Authentication mechanisms in Sql Server<br />
- What are user defined stored procedures.<br />
- What is INSTEAD OF trigger<br />
- Difference between SQL server 7.0 and 2000<br />
- How to optimize a query that retrieves data by joining 4 tables<br />
- Usage of DTS<br />
- How to disable an index using select query<br />
- Is non-clustered index faster than clustered index<br />
- Types of optimization in querries<br />
- Difference between ISQL and OSQL<br />
- How you log an exception directly into sql server what is used for this<br />
- About Replication in Database<br />
- What is the default optimization done in oracle and sql server<br />
- How can i make a coulmn as unique<br />
- How many no of tables can be joined in same sql server<br />
- How many coulmns can exist per table<br />
- About Sql Profiler usage<br />
<br />
• HR & Project<br />
<br />
- About yourself<br />
- About work experience<br />
- How long you are working on .NET<br />
- Are you willing to relocate <br />
- When will you join <br />
- Why do u what to change from current organization<br />
- Why do you want to join Accenture<br />
- What are your weaknesses / areas of improvement<br />
- What is your current project and your responsibilities<br />
- Have you done database design / development<br />
- What is D in ACID <br />
<br />
<span style="font-size: x-small;"><span style="text-decoration: underline;"><strong>#61656; Microsoft </strong></span></span><br />
<br />
• HR (Screening)<br />
- Tell about yourself<br />
- Tell about your work experience<br />
- Tell about projects<br />
- Tell about your current project and your role in it<br />
- What is your current salary p.a.<br />
<br />
• Technical<br />
<br />
#61607; .NET<br />
- How do you manage session in ASP and ASP.NET<br />
- How do you handle session management in ASP.NET and how do you implement them. How do you handle in case of SQLServer mode.<br />
- What are different authentication types. How do you retreive user id in case of windows authentication<br />
- For a server control, you need to have same properties like color maxlength, size, and allowed character throughout the application. How do you handle this. <br />
- What is custom control. What is the difference between custom control and user control<br />
- What is the syntax for datagrid and specifying columns<br />
- How do you add a javascript function for a link button in a datagrid.<br />
- Does C# supports multi-dimensional arrays<br />
- How to transpose rows into columns and columns into rows in a multi-dimensional array<br />
- What are object oriented concepts<br />
- How do you create multiple inheritance in C#<br />
- ADO and ADO.NET differences<br />
- Features and disadvantages of dataset<br />
- What is the difference between and ActiveX dll and control<br />
- How do you perform validations<br />
- What is reflection and disadvantages of reflection<br />
- What is boxing and how it is done internally<br />
- Types of authentications in IIS<br />
- What are the security issues if we send a query from the application<br />
- Difference between ByVal and ByRef<br />
- Disadvantages of COM components<br />
<br />
- How do we invoke queries from the application<br />
- What is the provider and namespaces being used to access oracle database<br />
- How do you load XML document and perform validation of the document<br />
- How do you access elements in XML document<br />
- What is ODP.NET<br />
- Types of session management in ASP.NET<br />
- Difference between datareader and dataset<br />
- What are the steps in connecting to database<br />
- How do you register a .NET assembly<br />
- Usage of web.config<br />
- About remoting and web services. Difference between them<br />
- Caching techniques in .NET<br />
- About CLS and CTS<br />
- Is overloading possible in web services<br />
- Difference between .NET and previous version<br />
- Types of chaching. How to implement caching<br />
- Features in ASP.NET<br />
- How do you do validations. Whether client-side or server-side validations are better<br />
- How do you implement multiple inheritance in .NET<br />
- Difference between multi-level and multiple inheritance<br />
- Difference between dataset and datareader<br />
- What are runtime hosts<br />
- What is an application domain<br />
- What is viewstate<br />
- About CLR, reflection and assemblies<br />
- Difference between .NET components and COM components<br />
- What does assemblyinfo.cs consists<br />
- Types of objects in ASP<br />
<br />
#61607; Database<br />
<br />
- What are the blocks in stored procedure<br />
- How do you handle exceptions. Give the syntax for it<br />
- What is normalization and types of normalization<br />
- When would you denormalize<br />
- Difference between a query and strored procedure<br />
- What is clustered and non-clustered indexes<br />
- Types of joins<br />
- How do you get all records from 2 tables. Which join do you use<br />
- Types of optimization<br />
- Difference between inline query and stored procedure<br />
<br />
#61607; Project related<br />
- Tell about your current project<br />
- Tell about your role<br />
- What is the toughest situation you faced in the development<br />
- How often you communicate with the client<br />
- For what purposes, you communicate with the client<br />
- What is the process followed<br />
- Explain complete process followed for the development<br />
- What is the life cycle model used for the development<br />
- How do communicate with team members<br />
- How do you say you are having excellent team management skills<br />
- If your client gives a change and asks for early delivery. How will you manage.<br />
- How will gather requirements and where do you record. Is it in word / Excel or do you have any tool for that<br />
- What is the stage when code is delivered to the client and he is testing it.<br />
- What are the different phases of SDLC<br />
- How do you handle change requests<br />
- How do you perform impact analysis<br />
- How do you write unit test cases.<br />
- About current project architecture<br />
<br />
#61656; Keane on 12th October 2003 <br />
<br />
• Technical<br />
<br />
#61607; .NET<br />
- Write steps of retrieving data using ado.net<br />
- Call a stored procedure from ado.net and pass parameter to it<br />
- Different type of validation controls in asp.net<br />
- Difference between server.Execute and response.redirect<br />
- What is Response.Flush method<br />
- How Response.flush works in server.Execute<br />
- What is the need of clinet side and server side validation<br />
- Tell About Global.asax<br />
- What is application variable and when it is initialized<br />
- Tell About Web.config<br />
- Can we write one page in c# and other in <acronym title="vBulletin">vb</acronym> in one application<br />
- When web.config is called<br />
- How many web.config a application can have<br />
- How do you set language in web.cofig<br />
<br />
<br />
#61607; Database<br />
- How do you rate yourrself in oracle and sql server <br />
- What is E-R diagram<br />
- Draw E-R diagram for many to many relationship<br />
- Design databaseraw er diagram for a certain scenario(many author many books)<br />
- Diff between primary key and unique key<br />
- What is Normalization<br />
- Difference between sub query and nested query<br />
- Indexes in oracle<br />
- Querry to retrieve record for a many to many relationship<br />
- Querry to get max and second max in oracle in one querry<br />
- Write a simple Store procedure and pass parameter to it<br />
<br />
<span style="font-size: x-small;"><span style="text-decoration: underline;"><strong>#61656; Digital Globalsoft</strong></span></span><br />
<br />
• Technical<br />
<br />
#61607; .NET<br />
- Difference between <acronym title="vBulletin">VB</acronym> dll and assemblies in .NET<br />
- What is machine.config and web.config<br />
- Tell about WSDL<br />
- About web methods and its various attributes<br />
- What is manifest<br />
- Types of caching<br />
- What does connection string consists of<br />
- Where do you store connection string<br />
- What is the difference between session state and session variables<br />
- How do you pass session values from one page to another<br />
- What are WSDL ports<br />
- What is dataset and tell about its features. What are equivalent methods of previous, next etc. Of ADO in ADO.NET<br />
- What is abstract class<br />
- What is difference between interface inheritance and class inheritance<br />
- What are the collection classes <br />
- Which namespace is used for encryption<br />
- What are the various authentication mechanisms in ASP.NET<br />
- What is the difference between authentication and autherization<br />
- What are the types of threading models<br />
- How do you send an XML document from client to server<br />
- How do you create dlls in .NET<br />
- What is inetermediate language in .NET<br />
- What is CLR and how it generates native code<br />
- Can we store PROGID informatoin in database and dynamically load the component<br />
- Is <acronym title="vBulletin">VB</acronym>.NET object oriented? What are the inheritances does <acronym title="vBulletin">VB</acronym>.NET support.<br />
- What is strong name and what is the need of it<br />
- Any disadvantages in Dataset and in reflection<br />
- Advantage of <acronym title="vBulletin">vb</acronym>.net over <acronym title="vBulletin">vb</acronym><br />
- What is runtime host<br />
- How to send a DataReader as a parameter to a remote client<br />
- How do you consume a webservice<br />
- What happens when a reference to webservice is added<br />
- How do you reference to a private & shared assembly<br />
- What is the purpose of System.EnterpriseServices namespace<br />
- About .Net remoting<br />
- Difference between remoting and webservice<br />
- Types of statemanagement techniques<br />
- How to register a shared assembly<br />
- About stateless and statefull webservice<br />
- How to invoke .net components from com components,give the sequence<br />
- How to check null values in dataset<br />
- About how soap messages are sent and received in webservice<br />
- Error handling and how this is done<br />
- Features in .net framework 1.1<br />
- Any problem found in vs.et<br />
- Optimization technique description<br />
- About disco and uddi<br />
- What providers does ado.net uses internally<br />
- Oops concepts<br />
- Disadvantages of <acronym title="vBulletin">vb</acronym><br />
- XML serialization<br />
- What providers do you use to connect to oracle database?<br />
<br />
#61607; Database<br />
- Types of joins<br />
<br />
#61607; General<br />
- What are various life cycle model in S/W development<br />
<br />
<span style="font-size: x-small;"><span style="text-decoration: underline;"><strong>#61656; Infosys</strong></span></span><br />
<br />
• Technical<br />
<br />
#61607; .NET<br />
- How do you rate yourself in .NET<br />
- What is caching and types of caching<br />
- What does VS.NET contains<br />
- What is JIT, what are types of JITS and their pupose<br />
- What is SOAP, UDDI and WSDL<br />
- What is dataset<br />
<br />
#61607; Database<br />
- How do you optimize SQL queries<br />
<br />
#61607; General<br />
- Tell about yourself and job<br />
- Tell about current project<br />
- What are sequence diagrams, collaboration diagrams and difference between them<br />
- What is your role in the current project and what kinds of responsibilites you are handling<br />
- What is the team size and how do you ensure quality of code<br />
- What is the S/W model used in the project. What are the optimization techniques used. Give examples.<br />
- What are the SDLC phases you have invloved<br />
<br />
#61656; Satyam<br />
<br />
• Technical<br />
<br />
#61607; .NET<br />
- Types of threading models in <acronym title="vBulletin">VB</acronym>.net<br />
- Types of compatability in <acronym title="vBulletin">VB</acronym> and their usage<br />
- Difference between CDATA and PCDATA in XML<br />
- What is Assync in XML api which version of XML parser u worked with<br />
- Types of ASP objects<br />
- Difference between application and session<br />
- What is web application virtual directory<br />
- Can two web application share a session and application variable<br />
- If i have a page where i create an instance of a dll and without invoking any method can I send values to next page<br />
- Diffeernce between Active Exe and /Dll<br />
- Can the dictionary object be created in client’s ccope?<br />
- About MTS and it’s purpose<br />
- About writting a query and SP which is better<br />
- I have a component with 3 parameter and deployed to client side now i changed my dll method which takes 4 parameter.How can i deploy this without affecting the clent’s code<br />
- How do you do multithreading application in <acronym title="vBulletin">VB</acronym><br />
- About Global .asax<br />
- Connection pooling in MTS<br />
- If cookies is disabled in clinet browser will session work<br />
- About XLST<br />
- How do you attach an XSL to an XML in presenting output<br />
- What is XML<br />
- How do you make your site SSL enabled<br />
- Did you work on IIS adminisdtration<br />
- <br />
#61607; Database<br />
- dd<br />
#61607; General<br />
- dd<br />
• HR<br />
- About educational background<br />
- About work experience<br />
- About area of work<br />
- Current salary, why are looking for a change and about notice period<br />
- About company strength, verticals, clients, domains etc.<br />
- Rate yourself in different areas of .NET and SQL<br />
<br />
<span style="font-size: x-small;"><span style="text-decoration: underline;"><strong>#61656; Cognizent</strong></span></span><br />
<br />
• Technical<br />
<br />
#61607; .NET<br />
- About response.buffer and repsonse.flush<br />
- About dataset and data mining<br />
- About SOAP<br />
- Usage of htmlencode and urlencode<br />
- Usage of server variables<br />
- How to find the client browser type<br />
- How do you trap errors in ASP and how do you invoke a component in ASP<br />
#61607; Database<br />
- About types of indexes in SQL server<br />
- Difference between writing SQL query and stored procedure<br />
- About DTS usage<br />
- How do you optimize Sql queries<br />
<br />
#61607; General<br />
- Dfs<br />
- Rate yourself in .NET and SQL<br />
- About 5 processes <br />
- About current project and your role<br />
• HR<br />
- About educational background, work experience, and area of work<br />
- <br />
<br />
<br />
<span style="font-size: x-small;"><span style="text-decoration: underline;"><strong>#61656; TCS</strong></span></span><br />
<br />
• Technical<br />
<br />
#61607; .NET<br />
- Define .NET architecture<br />
- Where does ADO.NET and XML web services come in the architecture<br />
- What is MSIL code<br />
- Types of JIT and what is econo-JIT<br />
- What is CTS, CLS and CLR<br />
- Uses of CLR<br />
- Difference between ASP and ASP.NET<br />
- What are webservices, its attributes. Where they are available<br />
- What is UDDI and how to register a web service<br />
- Without UDDI, is it possible to access a remote web service<br />
- How a web service is exposed to outside world<br />
- What is boxing and unboxing<br />
- What is WSDL and disco file<br />
- What is web.config and machine.config<br />
- What is difference between ASP and ASP.NET<br />
- What is dataset and uses of dataset<br />
- What does ADO.NET consists of?<br />
- What are various authentication mechanisms in ASP.NET<br />
- What do you mean by passport authentication and windows authentication<br />
- What is an assembly and what does manifest consists<br />
- What is strong name and what is the purpose of strong name<br />
- What are various types of assemblies<br />
- Difference between <acronym title="vBulletin">VB</acronym>.NET and C#. Which is faster<br />
- Types of caching<br />
- How WSDL is stored<br />
- What is the key feature of ADO.NET compared to ADO<br />
- How does dataset acts in a disconnected fashion<br />
- Does the following statement executes successfully:<br />
Response.Write(“value of i = ” + i);<br />
- What is ODP.NET<br />
- What are the providers available with VS.NET<br />
- What is a process<br />
- What is binding in web service<br />
- How a proxy is generated for a web service<br />
- About delegates<br />
- What are static assemblies and dynamic assemlies. Differences between them<br />
<br />
#61607; Database<br />
- What are the types of triggers<br />
- Types of locks in database<br />
- Types of indexes. What is the default key created when a primary key is created in a table<br />
- What is clustered, non-clustured and unique index. How many indexes can be created on a table<br />
- Can we create non-clustured index on a clustered index<br />
- Types of backups<br />
- What is INSTEAD OF trigger<br />
- What is difference between triggers and stored procedures. And advantages of SP over triggers<br />
- What is DTS and purpose of DTS<br />
- Write a query to get 2nd maximum salary in an employee table<br />
- Types of joins.<br />
- What is currency type in database<br />
- What are nested triggers<br />
- What is a heap related to database<br />
<br />
<span style="font-size: x-small;"><span style="text-decoration: underline;"><strong>#61607; General</strong></span></span><br />
<br />
• HR<br />
- About yourdelf<br />
- About procsses followed<br />
- Notice period<br />
- Appraisal process<br />
- What is SOAP and why it is required<br />
- About effort estimation<br />
- Whether salary negotiable<br />
- Why are looking for a change<br />
- How fo you appraise a person<br />
- Do you think CMM process takes time<br />
- About peer reviews<br />
- How do you communicate with TL / PM / Onsite team<br />
<br />
<span style="font-size: x-small;"><span style="text-decoration: underline;"><strong>#61656; DELL </strong> </span></span><br />
• Technical<br />
<br />
#61607; .NET<br />
- Any disadvantages in Dataset and in reflection<br />
- Difference between Active Exe and Activex dll<br />
- Can we make activex dll also ti execute in some process as that of client ? How can we do?<br />
- Types of compatabilities and explain them<br />
- Types of instancing properties and explain each. Tell the difference between multiuse,singleuse and globalmultiuse and which is default<br />
- What is assembly?<br />
- Difference between COM and .NET component<br />
- What is early binding and Late binding. Difference which is better<br />
- What happens when we instantiate a COM component<br />
- What happens when we instantiate a .NET component<br />
- Are you aware of containment and Aggregation<br />
- What is UUID and GUID what is the size of this ID?<br />
- About Iunknown interface Queue ,its methods Querry Interface Addref,Release and Explane each<br />
- What ‘ll u do in early and late binding<br />
- In early binding will the method invoked on com component will verify it’s existance in the system or not?<br />
- Difference between dynamic query and static query<br />
- About performance issues on retrieving records<br />
- About ADO and its objects<br />
- What is unmannaged code and will CLR handle this kind of code or not .<br />
- Garbage collector’s functionality on unmanaged code<br />
- If Instancing = Single use for ActiveX Exe, how will this be executed if there are 2 consecutive client requests ?<br />
- Threading Types.<br />
- How about the security in Activex DLL and Activex EXE<br />
<br />
#61607; Database<br />
- Types of cursors and explanation each of them<br />
- Types of cursor locations and explanation on each of them<br />
- Types of cursor locks and explanation each of them<br />
- How do you retrieve set of records from database server.{Set max records = 100 & use paging where pager page no or records = 10 & after displaying 100 records again connect to database retrieve next 100 }<br />
<br />
• HR & Project<br />
<br />
- Rate yourself in <acronym title="vBulletin">vb</acronym> and com<br />
- Whether I have any specific technology in mind to work on.<br />
<br />
<br />
<span style="font-size: x-small;"><span style="text-decoration: underline;"><strong>#61656; MMTTS </strong></span></span><br />
<br />
• Technical<br />
<br />
#61607; .NET<br />
- About .NET Framework<br />
- About Assembly in .NET, types of assemblies, their difference, How to register into GAC. How to generate the strong names & its use.<br />
- What is side by side Execution?<br />
- What is serialization?<br />
- Life cycle of ASP.NET page when a request is made.<br />
- If there is submit button in a from tell us the sequence what happens if submit is clicked and in form action is specified as some other page.<br />
- About a class access specifiers and method access specifiers.<br />
- What is overloading and how can this be done.<br />
- How to you declare connection strings and how to you make use of web.config.<br />
- How many web.copnfig can exists in a web application & which will be used.<br />
- About .NET Remoting and types of remoting<br />
- About Virtual functions and their use.<br />
- How do you implement Inheritance in dot net<br />
- About ado.net components/objects. Usage of data adapters and tell the steps to retrieve data.<br />
- What does CLR do as soon as an assembly is created<br />
- How do you retrieve information from web.config.<br />
- How do you declare delegates and are delegates and events one and the same and explain how do you declare delegates and invoke them.<br />
- If I want to override a method 1 of class A and in class b then how do you declare?<br />
- What does CLR do after the IL is generated and machine language is generated .Will it look for main method<br />
- About friend and Protected friend<br />
- About multi level and multiple inheritance how to achieve in .net<br />
- Sequence to connect and retrieve data from database useig dataset<br />
- About sn.exe<br />
- What was the problem in traditional component why side by side execution is supported in .net<br />
- How .net assemblies are registred as private and shared assembly<br />
- All kind of access specifiers for a class and for methods<br />
- On ODP.net<br />
- Types of assemblies that can be created in dotnet <br />
- About namespaces<br />
- OOPs concept<br />
- More on CLR<br />
<br />
• HR & Project<br />
- About yourself <br />
- About the current employer<br />
- About expertise<br />
- What type of job you are expecting<br />
- What is current and expected is it negotiable<br />
- Can you justify why r you expecting more in professional terms<br />
- What are you looking for in Dell<br />
<br />
</div>harish chandnahttp://www.blogger.com/profile/06099169032804747646noreply@blogger.com0tag:blogger.com,1999:blog-8207114327320008493.post-80375061023431680532011-11-07T00:40:00.000-08:002011-11-07T00:44:06.707-08:00Create Crystal Report (with sub report) In ASP.NET<div dir="ltr" style="text-align: left;" trbidi="on"><b>Step1- </b>Register the Crstal Report DLL (Not Need to include the DLL In Bin Folder) by using the following lines<br />
<br />
<%@ Register Assembly="CrystalDecisions.Web, Version=10.5.3700.0, Culture=neutral, PublicKeyToken=692fbea5521e1304"<br />
Namespace="CrystalDecisions.Web" TagPrefix="CR" %> <br />
<b>Step2-</b> Take the Crystal Report Viewer control onto the page Like this<br />
<CR:CrystalReportViewer ID="Crv" runat="server" AutoDataBind="true" /><br />
<b>Step-3- </b><u>Create Report</u>: first of Create an XSD then bind the report with the XSD (here not need to create a new connection)<br />
<b>Step-4</b> <u>Use these function to bind the report</u><br />
private DataSet GetReportData()<br />
{<br />
try<br />
{<br />
DataSet dsReport = new DataSet();<br />
DataTable dtParent = new DataTable();<br />
dtParent.Columns.Add("ParentID");<br />
dtParent.Columns.Add("ParentName");<br />
for (int i = 1; i <= 3; i++)<br />
{<br />
dtParent.Rows.Add(i, "Parent " + i.ToString());<br />
}<br />
dsReport.Tables.Add(dtParent);<br />
<br />
DataTable dtChild = new DataTable();<br />
DataTable dtSubReport = new DataTable();<br />
dtChild.Columns.Add("ParentID");<br />
dtChild.Columns.Add("ClientID");<br />
dtChild.Columns.Add("ClientName");<br />
dtChild.Columns.Add("ClientAddress");<br />
dtChild.Columns.Add("DOB");<br />
dtSubReport.Columns.Add("ClientID");<br />
dtSubReport.Columns.Add("ProductDetails");<br />
for (int j = 1; j <= 3; j++)<br />
{<br />
for (int i = 21; i <= 23; i++)<br />
{<br />
dtChild.Rows.Add(j, j.ToString() + i.ToString(), "ClientName " + i.ToString(), "ClientAddress " + i.ToString(), "DOB " + i.ToString());<br />
dtSubReport.Rows.Add(j.ToString() + i.ToString(), "ProductDetails " + i.ToString());<br />
}<br />
}<br />
dsReport.Tables.Add(dtChild);<br />
dsReport.Tables.Add(dtSubReport);<br />
<br />
return dsReport;<br />
}<br />
catch <br />
{<br />
<br />
throw;<br />
}<br />
}<br />
<br />
private void ShowReport()<br />
{<br />
try<br />
{<br />
string ReportName = string.Empty;<br />
this.Title = "MMNDY:RMSC Medicines List";<br />
DataSet dsReport = new DataSet();<br />
dsReport = GetReportData();<br />
<br />
ReportDocument rpt = new ReportDocument();<br />
string path = Server.MapPath("") + "\\Reports\\GroupBylReport.rpt";<br />
rpt.Load(path);<br />
rpt.Database.Tables[0].SetDataSource(dsReport);<br />
rpt.SetParameterValue("Title", "My Test Report");<br />
rpt.SetParameterValue("DesignedBy", "Harish & Asvini");<br />
Crv.ReportSource = rpt;<br />
Crv.DataBind();<br />
}<br />
catch <br />
{<br />
<br />
throw;<br />
}<br />
}<br />
<br />
This will show the report on the page.<br />
<br />
<br />
</div>harish chandnahttp://www.blogger.com/profile/06099169032804747646noreply@blogger.com0tag:blogger.com,1999:blog-8207114327320008493.post-72532517391203519132011-11-04T04:43:00.001-07:002011-11-04T04:43:13.467-07:00Create Set Up for Simple Web Application<div dir="ltr" style="text-align: left;" trbidi="on"><img height="407" src="http://www.codeproject.com/KB/dotnet/Win_App_Setup_Project/Win_App_Setup_Project.gif" width="503" /><br />
<h2>Introduction</h2>I noticed that there are several articles on using Web <span class="search-highlight">Set</span>up projects, but no articles could be found for <span class="search-highlight">Window</span>s <span class="search-highlight">Set</span>up projects. So I decided to share what I know about the VS <span class="search-highlight">Window</span>s <span class="search-highlight">Set</span>up Projects. I will be using the <i>RunOnlyOnceCS.exe</i> demo <span class="search-highlight">app</span> I <span class="search-highlight">create</span>d for another CodeProject article, as the <span class="search-highlight">app</span>lication we are creating the <span class="search-highlight">set</span>up for.<br />
<h2>Background</h2>Sooner or later, you need to <span class="search-highlight">create</span> a <span class="search-highlight">set</span>up project for an <span class="search-highlight">app</span>lication. Personally, I am not a big fan of this type of distribution for an <span class="search-highlight">app</span>lication. Still it has its uses. Using a <span class="search-highlight">set</span>up project can be a good solution for a <span class="search-highlight">Window</span>s <span class="search-highlight">app</span>lication that has many dependencies on other assemblies / DLLs. The <span class="search-highlight">set</span>up will figure out what the dependencies are for the <span class="search-highlight">app</span>lication and automatically include them.<br />
<b>Note</b>: This does not include the .NET framework.<br />
<h2>Creating a <span class="search-highlight">Set</span>up Project</h2>This article is going to rely on screen prints since there really isn�t any code for this. The output will be a <i>*.msi</i> file that will install the <span class="search-highlight">app</span>lication file(s), and add a shortcut to the desktop and to the Programs menu.<br />
<b>Note</b>: if the user does not have admin rights to their box, they will not be able to run the MSI script or install new <span class="search-highlight">app</span>lications on their box.<br />
<img height="364" src="http://www.codeproject.com/KB/dotnet/Win_App_Setup_Project/setup1.GIF" width="531" /><br />
After you have <span class="search-highlight">create</span>d a new <span class="search-highlight">set</span>up project, the first thing you will want to do is change the <code>ProductName</code> property on the <span class="search-highlight">set</span>up project to match the <span class="search-highlight">app</span>lication you are creating the <span class="search-highlight">set</span>up for. I would also suggest changing the <code>RemovePreviousVersion</code> property to true. This is helpful when you want to release your next version of your <span class="search-highlight">app</span> through this <span class="search-highlight">set</span>up project.<br />
<img height="529" src="http://www.codeproject.com/KB/dotnet/Win_App_Setup_Project/setup2.GIF" width="214" /><br />
Next, click on the "<span class="search-highlight">App</span>lication folder", then right click, and click on Add/File. At this point, you will be able to add the Exe you are trying to <span class="search-highlight">create</span> the <span class="search-highlight">set</span>up for.<br />
<b>Note</b>: if you make changes to the Exe, you will need to re-compile the <span class="search-highlight">set</span>up project as well. It might be a good choice to add a <span class="search-highlight">set</span>up project to your <span class="search-highlight">Window</span>s project solution. Then you can choose the project output option instead of the file.<br />
<b>Note</b>: if you know what a merge module is and want to add one to the <span class="search-highlight">set</span>up project, you need to right click on the <span class="search-highlight">set</span>up project and click Add Merge Module.<br />
<b>Note</b>: you must also add any config or icon files you may need for this solution, here:<br />
<img height="253" src="http://www.codeproject.com/KB/dotnet/Win_App_Setup_Project/setup3.GIF" width="499" /><br />
Next, I always <span class="search-highlight">set</span> the Always <span class="search-highlight">Create</span> for the Program Directory to true. This is done by clicking on the "<span class="search-highlight">App</span>lication Folder" and then going to the properties.<br />
<b>Note</b>: the <code>DefaultLocation</code> property will always be: [ProgramFilesFolder] [Manufacturer]\[ProductName]. If you want it to be something else, this is where to change it. Notice that the solution explorer has recognized the dependency or need for the .NET Framework for this <span class="search-highlight">app</span> to run.<br />
<b>Note</b>: this does not mean that the <span class="search-highlight">set</span>up will install the .NET re-distributable framework. That is its own <span class="search-highlight">set</span>up. The <span class="search-highlight">set</span>up file is around 24 MB in size and can be downloaded from <a href="http://www.microsoft.com/downloads/details.aspx?FamilyID=262d25e3-f589-4842-8157-034d1e7cf3a3&displaylang=en" target="_blank">here</a>.<br />
<b>Note</b>: the <span class="search-highlight">set</span>up can not install a .NET <span class="search-highlight">app</span>lication without the .NET Framework already installed.<br />
<img height="361" src="http://www.codeproject.com/KB/dotnet/Win_App_Setup_Project/setup4.GIF" width="491" /><br />
Next, we want to <span class="search-highlight">create</span> a shortcut to our <span class="search-highlight">app</span>lication on the desktop. First, click on the "User's desktop" folder. Then right click and click on "<span class="search-highlight">Create</span> New Shortcut".<br />
<img height="243" src="http://www.codeproject.com/KB/dotnet/Win_App_Setup_Project/setup5.GIF" width="365" /><br />
Next, you will see a dialog box to choose the <span class="search-highlight">app</span>lication you want to <span class="search-highlight">create</span> a shortcut to. Go to "<span class="search-highlight">App</span>lication folder" and add the exe you added in the previous step.<br />
<img height="327" src="http://www.codeproject.com/KB/dotnet/Win_App_Setup_Project/setup6.GIF" width="459" /><br />
If you click on the "User's desktop" and go to the Properties <span class="search-highlight">window</span>, you will see some options. Something I normally add to the shortcut is a check to see if it already exists. This is an example of what little coding you can do in a <span class="search-highlight">set</span>up project. I have turned on Always<span class="search-highlight">Create</span> on the shortcut property. In doing this, I need to have a condition or I will multiply my desktop shortcuts with every new release. So I <span class="search-highlight">set</span> the Transitive property to <b>True</b> and I <span class="search-highlight">set</span> the condition to <b>FILEEXISTS1<>"Shortcut to <i>RunOnceOnlyCS.exe</i>"</b>, where what is in the "" needs to match the name of the shortcut.<br />
<img height="181" src="http://www.codeproject.com/KB/dotnet/Win_App_Setup_Project/setup7.GIF" width="365" /><br />
<b>Note</b>: if you want your shortcut to have your <span class="search-highlight">app</span>lication's icon, you need to add your icon file to the "<span class="search-highlight">App</span>lication folder". Next, click on the shortcut you just <span class="search-highlight">create</span>d in your "User's desktop". There is an icon property. Click the down arrow to get the dialog box. Navigate to the "<span class="search-highlight">App</span>lication folder" and select the icon file you just added.<br />
Next, if you want to <span class="search-highlight">create</span> a shortcut in the Start/All Programs menu, it is very similar to creating a shortcut on the "User's desktop". First, click on the "User's programs menu", then right click and add a folder. Name the folder the same as whatever your company or manufacturer name would be. Then, click on that newly <span class="search-highlight">create</span>d folder and add a shortcut just like we did in the step above.<br />
<img height="195" src="http://www.codeproject.com/KB/dotnet/Win_App_Setup_Project/setup8.GIF" width="341" /><br />
Finally, when you need to <span class="search-highlight">create</span> a new <span class="search-highlight">set</span>up for the next release of your <span class="search-highlight">app</span>lication, you need to go to the <span class="search-highlight">set</span>up project properties and change the version before you re-compile the <span class="search-highlight">set</span>up project.<br />
<img height="90" src="http://www.codeproject.com/KB/dotnet/Win_App_Setup_Project/setup85.GIF" width="258" /><br />
Once you click off the version property, you will get a prompt to update the GUID for the ProductCode.<br />
<b>Note</b>: if you do not click the Yes button in the dialog, you must manually get a new GUID for the ProductCode for the <span class="search-highlight">set</span>up to properly remove the old program and install the new program.<br />
<img height="90" src="http://www.codeproject.com/KB/dotnet/Win_App_Setup_Project/setup9.GIF" width="499" /><br />
<b>Note Do Not</b>: change the UpgradeCode GUID. If you do, the user will have to uninstall the old program manually before the new version can be installed.</div>harish chandnahttp://www.blogger.com/profile/06099169032804747646noreply@blogger.com0