tag:blogger.com,1999:blog-76561144448576835992024-02-18T17:37:56.784-08:00Happy ProgrammingTargeting programmers who using asp.net(c#)/ sql server and many more, Keep in touch friends...kasunhttp://www.blogger.com/profile/17340599678468268127noreply@blogger.comBlogger111125tag:blogger.com,1999:blog-7656114444857683599.post-70228797374827850652017-07-21T22:13:00.001-07:002017-07-21T22:13:11.777-07:00E-money exchangers rating<div dir="ltr" style="text-align: left;" trbidi="on">
<a href="https://www.bestchange.com/?p=218801" target="_blank">E-money exchangers rating</a></div>
kasunhttp://www.blogger.com/profile/17340599678468268127noreply@blogger.com0tag:blogger.com,1999:blog-7656114444857683599.post-43738396181978366982011-11-23T09:35:00.001-08:002011-11-23T09:35:20.474-08:00gridview stuffprotected void QtyTextBox_TextChanged(object sender, EventArgs e)<div> {</div><div> var txt = (TextBox)sender;</div><div> var container = (GridViewRow)txt.NamingContainer;</div><div> decimal? invAmount = Convert.ToDecimal(grvProductsList.Rows[container.RowIndex].Cells[3].Text.Trim());</div><div><br /></div><div> Label label =</div><div> (Label)grvProductsList.Rows[container.RowIndex].Cells[5].FindControl("lblRecQtyError");</div><div><br /></div><div> if (invAmount < Convert.ToDecimal(txt.Text.Trim()))</div><div> {</div><div> label.Text = "*";</div><div> }</div><div> else</div><div> {</div><div> label.Text = "";</div><div> }</div><div><br /></div><div> //VR003 Start</div><div> DataTable dataTable = (DataTable)Session["VRTRN26_GridSelected"];</div><div> DataRow dataRow = dataTable.Rows[container.RowIndex];</div><div> Decimal orderQty = Decimal.Parse(dataRow["OrderQtyU1"].ToString().Trim());</div><div> Decimal invoiceQty = Decimal.Parse(dataRow["InvoiceQtyU1"].ToString().Trim());</div><div> Decimal DistOrderQty = Decimal.Parse(dataRow["DistributorQty"].ToString().Trim());</div><div><br /></div><div> if (Convert.ToDecimal(txt.Text.Trim()) != invoiceQty)</div><div> {</div><div> grvProductsList.Rows[container.RowIndex].ForeColor = Color.Blue;</div><div> }</div><div> else</div><div> {</div><div> string ProStatus = dataRow["PromotionalFlag"].ToString().Trim();</div><div> string newItems = dataRow["NewItems"].ToString().Trim();</div><div> </div><div> if (ProStatus == "1")</div><div> {</div><div> grvProductsList.Rows[container.RowIndex].ForeColor = Color.Green;</div><div> }</div><div> else if (newItems == "1")</div><div> {</div><div> grvProductsList.Rows[container.RowIndex].ForeColor = Color.DeepPink;</div><div> }</div><div> else</div><div> {</div><div> grvProductsList.Rows[container.RowIndex].ForeColor = grvProductsList.ForeColor;</div><div> }</div><div> }</div><div><br /></div><div> if (orderQty != DistOrderQty)</div><div> {</div><div> grvProductsList.Rows[container.RowIndex].ForeColor = Color.Orange;</div><div> }</div><div> </div><div> if (orderQty > 0 && DistOrderQty==0)</div><div> {</div><div> grvProductsList.Rows[container.RowIndex].ForeColor = Color.Maroon;</div><div> }</div><div> //VR003 End</div><div> }</div>kasunhttp://www.blogger.com/profile/17340599678468268127noreply@blogger.com0tag:blogger.com,1999:blog-7656114444857683599.post-59201276514834013772011-11-23T09:31:00.001-08:002011-11-23T09:31:56.949-08:00gridview paging<div>protected void grvLoadGrid_PageIndexChanging(object sender, GridViewPageEventArgs e)</div><div> {</div><div> grvLoadGrid.SelectedIndex = -1;</div><div> grvLoadGrid.PageIndex = e.NewPageIndex;</div><div> DataTable dataTable = Session["VRTRN26_GridList"] as DataTable;</div><div> dataTable = (DataTable)Session["VRTRN26_GridList"];</div><div><br /></div><div> grvLoadGrid.DataSource = dataTable;</div><div> grvLoadGrid.DataBind();</div><div> chkSelectValGrid.Value = "";</div><div> }</div>kasunhttp://www.blogger.com/profile/17340599678468268127noreply@blogger.com0tag:blogger.com,1999:blog-7656114444857683599.post-19637773598087599152011-05-22T11:09:00.000-07:002011-05-22T11:14:33.785-07:00Exact purpose of http handlers<span class="Apple-style-span" style="color: rgb(65, 65, 65); font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 13px; "><p style="margin-top: 0px; margin-right: 0px; margin-bottom: 1.5em; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; line-height: 1.65em; text-align: justify; ">ASP.NET maps HTTP requests to HttpHandlers. Each HttpHandler enables processing of individual HTTP URLs or groups of URL extensions within an application. HttpHandlers have the same functionality as <b>ISAPI extensions </b>with a much simpler programming model</p><p style="margin-top: 0px; margin-right: 0px; margin-bottom: 1.5em; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; line-height: 1.65em; text-align: justify; ">Ex<br />1.Default HttpHandler for all ASP.NET pages ->ASP.NET Page Handler (*.aspx)<br />2.Default HttpHandler for all ASP.NET service pages->ASP.NET Service Handler (*.asmx)</p><p style="margin-top: 0px; margin-right: 0px; margin-bottom: 1.5em; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; line-height: 1.65em; text-align: justify; ">An <b>HttpHandler </b>can be either <b>synchronous or asynchronous</b>. A synchronous handler does not return until it finishes processing the HTTP request for which it is called. </p><p style="margin-top: 0px; margin-right: 0px; margin-bottom: 1.5em; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; line-height: 1.65em; text-align: justify; ">An asynchronous handler usually launches a process that can be lengthy and returns before that process finishes<br />After writing and compiling the code to implement an HttpHandler you must register the handler using your application's Web.config file.</p></span>kasunhttp://www.blogger.com/profile/17340599678468268127noreply@blogger.com0tag:blogger.com,1999:blog-7656114444857683599.post-51666553162931018212011-05-22T11:03:00.000-07:002011-05-22T11:08:47.779-07:00Different types of caching & Web farm and Web Garden concept in ASP.NET<span class="Apple-style-span" ><span class="Apple-style-span" style="line-height: 21px;"><span class="Apple-style-span" style="font-size: 13px; ">Caching is a technique of persisting the data in memory for immediate access to requesting program calls. This is considered as the best way to enhance <span id="IL_AD4" style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; ">the performance</span> of the application.<br /><br />Caching is of 3 types:<br />Output Caching - Caches the whole page.<br />Fragment Caching - Caches a part of the page<br />Data Caching - Caches the data </span></span></span><div><span class="Apple-style-span" ><span class="Apple-style-span" style="line-height: 21px;"><span class="Apple-style-span" style="font-size: 13px; "><br /></span></span></span></div><div><span class="Apple-style-span" ><span class="Apple-style-span" style="line-height: 21px;"><span class="Apple-style-span" style="font-size: 13px; ">------------------------------------------------------------</span></span></span></div><div><span class="Apple-style-span" ><span class="Apple-style-span" style="line-height: 21px;"><span class="Apple-style-span" style="font-size: 13px; "><br /></span></span></span></div><div><span class="Apple-style-span" ><span class="Apple-style-span" style="line-height: 21px;"><span class="Apple-style-span" style="font-size: 13px; ">A <b>web farm</b> is a <b>multi-server scenario</b>. So we may have a server in each state of US. If the load on one server is in excess then the other servers step in to bear the brunt.<br />How they bear it is based on various models.</span></span></span></div><div><span class="Apple-style-span" ><span class="Apple-style-span" style="line-height: 21px;"><span class="Apple-style-span" style="font-size: 13px; "><br />1. RoundRobin. (All servers share load equally)<br />2. NLB (economical)<br />3. HLB (expensive but can scale up to 8192 servers)<br />4. Hybrid (of 2 and 3).<br />5. CLB (Component load balancer).<br /><br /></span></span></span></div><div><span class="Apple-style-span" ><span class="Apple-style-span" style="line-height: 21px;"><span class="Apple-style-span" style="font-size: 13px; ">A <b>web garden</b> is a <b>multi-processor setup</b>. i.e. a single server (not like the multi server above).<br />How to implement webfarms in .Net:<br />Go to web.config and<br />Here for mode you have 4 options.</span></span></span></div><div><span class="Apple-style-span" ><span class="Apple-style-span" style="line-height: 21px;"><span class="Apple-style-span" style="font-size: 13px; "><br />a) Say mode inproc (non web farm but fast when you have very few customers).<br />b) Say mode StateServer (for webfarm)<br />c) Say mode SqlServer (for webfarm)<br />Whether to use option b or c depends on situation. StateServer is faster but SqlServer is more reliable and used for mission critical applications.<br />How to use webgardens in .Net:<br />Go to web.config and<br />Change the false to true. You have one more attribute that is related to webgarden in the same tag called cpuMask.</span></span></span></div>kasunhttp://www.blogger.com/profile/17340599678468268127noreply@blogger.com0tag:blogger.com,1999:blog-7656114444857683599.post-52369728310117751792011-05-22T10:58:00.000-07:002011-05-22T11:02:41.821-07:00Design a web site with multilingual support in ASP.NET<span class="Apple-style-span" style="color: rgb(65, 65, 65); font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 13px; "><p style="margin-top: 0px; margin-right: 0px; margin-bottom: 1.5em; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; line-height: 1.65em; text-align: justify; ">Multilingual website can be created using <b>Globalization </b>and <b>Localization</b>.</p><p style="margin-top: 0px; margin-right: 0px; margin-bottom: 1.5em; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; line-height: 1.65em; text-align: justify; ">Using <b>Globalization </b>we change the <i><b>Currency Date Numbers</b></i> etc to <i><b>Language Specific Format</b></i>.</p><p style="margin-top: 0px; margin-right: 0px; margin-bottom: 1.5em; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; line-height: 1.65em; text-align: justify; ">To change the string which is there in the<i><b> label button etc to language specific string we use </b></i><b>Localization</b>.</p><p style="margin-top: 0px; margin-right: 0px; margin-bottom: 1.5em; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; line-height: 1.65em; text-align: justify; ">In Localization we have to create different <b>Resource </b>files for different languages.</p><p style="margin-top: 0px; margin-right: 0px; margin-bottom: 1.5em; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; line-height: 1.65em; text-align: justify; ">During this process we use some classes present in System.Resources/ System.Globalization System.Threading namespaces.</p></span>kasunhttp://www.blogger.com/profile/17340599678468268127noreply@blogger.com0tag:blogger.com,1999:blog-7656114444857683599.post-9718920497776506372011-05-22T10:56:00.000-07:002011-05-22T10:58:23.506-07:00About Session State<span class="Apple-style-span" style="color: rgb(65, 65, 65); font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 13px; "><p style="margin-top: 0px; margin-right: 0px; margin-bottom: 1.5em; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; line-height: 1.65em; text-align: justify; "><span class="Apple-style-span" style="line-height: normal; "></span></p><p style="margin-top: 0px; margin-right: 0px; margin-bottom: 1.5em; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; line-height: 1.65em; text-align: justify; ">Coming to Session State<br />As we know for every process some default space will be allocated by OS.</p><p style="margin-top: 0px; margin-right: 0px; margin-bottom: 1.5em; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; line-height: 1.65em; text-align: justify; ">In case of InProc Session Info will be stored inside the process where our <br />application is running.<br />In case of StateServer Session Info will be stored using ASP.NET State Service.<br />In case of SQLServer Session info will be stored inside Database. Default DB <br />which will be created after running InstallSQLState Script is ASPState.</p></span><p></p><p style="margin-top: 0px; margin-right: 0px; margin-bottom: 1.5em; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; line-height: 1.65em; text-align: justify; ">Session Management can be achieved in two ways<br /><br />1)InProc<br />2)OutProc<br /><br />OutProc is again two types<br />1)State Server<br />2)SQL Server<br /><br /><strong style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; ">InProc<br /></strong>Adv.:<br />1) Faster as session resides in the same process as the application<br />2) No need to serialize the data</p><p style="margin-top: 0px; margin-right: 0px; margin-bottom: 1.5em; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; line-height: 1.65em; text-align: justify; ">DisAdv.:<br />1) Will degrade the performance of the application if large chunk of data is stored<br />2) On restart of IIS all the Session info will be lost</p><p style="margin-top: 0px; margin-right: 0px; margin-bottom: 1.5em; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; line-height: 1.65em; text-align: justify; "><strong style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; ">State Server<br /></strong>Adv.:<br />1) Faster then SQL Server session management <br />2) Safer then InProc. As IIS restart <br />won't effect the session data</p><p style="margin-top: 0px; margin-right: 0px; margin-bottom: 1.5em; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; line-height: 1.65em; text-align: justify; ">DisAdv.:<br />1) Data need to be serialized<br />2) On restart of ASP.NET State Service session info will be lost<br />3)Slower as compared to InProc</p><p style="margin-top: 0px; margin-right: 0px; margin-bottom: 1.5em; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; line-height: 1.65em; text-align: justify; "><strong style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; ">SQL Server<br /></strong>Adv.:<br />1) Reliable and Durable<br />2) IIS and ASP.NET State Service <br />restart won't effect the session data<br />3) Good place for storing large chunk of data</p><p style="margin-top: 0px; margin-right: 0px; margin-bottom: 1.5em; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; line-height: 1.65em; text-align: justify; ">DisAdv.:<br />1) Data need to be serialized<br />2) Slower as compare to InProc and State Server<br />3)Need to purchase Licensed <br />version of SQL Serve </p>kasunhttp://www.blogger.com/profile/17340599678468268127noreply@blogger.com0tag:blogger.com,1999:blog-7656114444857683599.post-43313645294852864802011-04-28T21:57:00.000-07:002011-04-28T22:20:46.678-07:00Useful lamda exp<span class="Apple-style-span" style="font-size: 12px; line-height: 14px; color: rgb(51, 51, 51); font-family: Verdana, Arial, Helvetica, sans-serif; "><span ><div><span class="Apple-style-span" style="font-size: 12px; line-height: 14px; color: rgb(51, 51, 51); font-family: Verdana, Arial, Helvetica, sans-serif; "><span >1)...</span></span></div>Customer foundCustomer = null;<br />foundCustomer = custList.FirstOrDefault(c =><br /> c.CustomerId == 4);<br />Debug.WriteLine(foundCustomer);</span><p style="margin-top: 1em; margin-right: 0px; margin-bottom: 1em; margin-left: 0px; ">The lambda expression syntax in C# looks like this:</p>c => c.CustomerId == 4<p style="margin-top: 1em; margin-right: 0px; margin-bottom: 1em; margin-left: 0px; ">The code begins with the set of parameters to the lambda expression. The => is the “goes to” or lambda operator. The remainder of the code is the expression itself. In this case, checking for the item in the list where CustomerId is 4.</p><p style="margin-top: 1em; margin-right: 0px; margin-bottom: 1em; margin-left: 0px; "><br /></p><p style="margin-top: 1em; margin-right: 0px; margin-bottom: 1em; margin-left: 0px; ">2)...</p><p style="margin-top: 1em; margin-right: 0px; margin-bottom: 1em; margin-left: 0px; "><span class="Apple-style-span" style="color: rgb(101, 64, 46); font-family: Consolas; ">Customer foundCustomer = null;<br />var query = from c in custList<br /> where c.CustomerId == 4<br /> select c;<br />foundCustomer = query.FirstOrDefault();<br />Debug.WriteLine(foundCustomer);</span></p><p style="margin-top: 1em; margin-right: 0px; margin-bottom: 1em; margin-left: 0px; "><span class="Apple-style-span" style="color: rgb(101, 64, 46); font-family: Consolas; "><br /></span></p><p style="margin-top: 1em; margin-right: 0px; margin-bottom: 1em; margin-left: 0px; "><span class="Apple-style-span" style="color: rgb(101, 64, 46); font-family: Consolas; ">3)...</span></p><p style="margin-top: 1em; margin-right: 0px; margin-bottom: 1em; margin-left: 0px; "><span class="Apple-style-span" style="color: rgb(101, 64, 46); font-family: Consolas; ">Customer foundCustomer = null;<br />foreach (var c in custList)<br />{<br /> if (c.CustomerId == 4)<br /> {<br /> foundCustomer = c;<br /> break;<br /> }<br />}<br />Debug.WriteLine(foundCustomer);</span></p></span>kasunhttp://www.blogger.com/profile/17340599678468268127noreply@blogger.com0tag:blogger.com,1999:blog-7656114444857683599.post-13758178804160662962011-04-26T22:22:00.000-07:002011-04-26T23:17:54.203-07:00Useful regular expressions<span class="Apple-style-span" style="color: rgb(51, 51, 51); font-size: 13px; "><p style="margin-top: 0px; margin-right: 0px; margin-bottom: 0.75em; margin-left: 0px; line-height: 1.6em; ">Regex syntax is :</p><p style="margin-top: 0px; margin-right: 0px; margin-bottom: 0.75em; margin-left: 0px; line-height: 1.6em; ">Regex re = new Regex("Regular Expression string",Regular Expression Options);</p><p style="margin-top: 0px; margin-right: 0px; margin-bottom: 0.75em; margin-left: 0px; line-height: 1.6em; ">Regular Expression Options are options that we can use along with regular expression like RegexOptions.IgnoreCase or RegexOptions.Compiled</p><p style="margin-top: 0px; margin-right: 0px; margin-bottom: 0.75em; margin-left: 0px; line-height: 1.6em; ">Here I am lisitng some Regular Expressions:</p><p style="margin-top: 0px; margin-right: 0px; margin-bottom: 0.75em; margin-left: 0px; line-height: 1.6em; ">[a-zA-Z]* - Regular Expression to allow only charactors</p><p style="margin-top: 0px; margin-right: 0px; margin-bottom: 0.75em; margin-left: 0px; line-height: 1.6em; ">[0-9]* - Regular Expression to allow only numbers</p><p style="margin-top: 0px; margin-right: 0px; margin-bottom: 0.75em; margin-left: 0px; line-height: 1.6em; ">[a-zA-Z0-9]* - Regular Expression to allow only alphanumeric charactors</p><p style="margin-top: 0px; margin-right: 0px; margin-bottom: 0.75em; margin-left: 0px; line-height: 1.6em; ">[0-9]*(\.[0-9]{1,2})? - Regular Expression to validate a float number with 1 or 2 decimal points</p></span>kasunhttp://www.blogger.com/profile/17340599678468268127noreply@blogger.com0tag:blogger.com,1999:blog-7656114444857683599.post-176959181285859962011-04-24T08:15:00.000-07:002011-04-24T08:20:49.858-07:00XAML Overview (WPF)<span class="Apple-style-span" style="font-family: 'Segoe UI', Verdana, Arial; font-size: 13px; ">XAML itself is a larger language concept than WPF.</span><div><span class="Apple-style-span" ><br /></span></div><div><span class="Apple-style-span" ><span class="Apple-style-span" style="font-size: 13px; "><a href="http://msdn.microsoft.com/en-us/library/ms752059.aspx#what_is_xaml" style="color: rgb(19, 100, 196); text-decoration: none; ">What is XAML?</a></span></span></div><div><span class="Apple-style-span" style="font-family: 'Segoe UI', Verdana, Arial; font-size: 13px; "><br /></span></div><div><span class="Apple-style-span" style="font-family: 'Segoe UI', Verdana, Arial; font-size: 13px; ">XAML is a declarative markup language. As applied to the .NET Framework programming model, XAML simplifies creating a UI for a .NET Framework application. </span></div><div><span class="Apple-style-span" style="font-family: 'Segoe UI', Verdana, Arial; font-size: 13px; ">You can create visible UI elements in the declarative XAML markup, and then separate the UI definition from the run-time logic by using code-behind files, joined to the markup through partial class definitions. XAML directly represents the instantiation of objects in a specific set of backing types defined in assemblies. This is unlike most other markup languages, which are typically an interpreted language without such a direct tie to a backing type system. XAML enables a workflow where separate parties can work on the UI and the logic of an application, using potentially different tools.</span></div><div><span class="Apple-style-span" ><span class="Apple-style-span" ><span class="Apple-style-span" style="font-size: 13px; "><p xmlns="http://www.w3.org/1999/xhtml">When represented as text, XAML files are XML files that generally have the <span class="code">.xaml</span> extension. The files can be encoded by any XML encoding, but encoding as UTF-8 is typical.</p><p xmlns="http://www.w3.org/1999/xhtml">The following example shows how you might create a button as part of a UI. This example is just intended to give you a flavor of how XAML represents common UI programming metaphors.</p></span></span></span><div><span class="Apple-style-span" style="font-family: 'Segoe UI', Verdana, Arial; font-size: 13px; "><br /></span></div></div>kasunhttp://www.blogger.com/profile/17340599678468268127noreply@blogger.com0tag:blogger.com,1999:blog-7656114444857683599.post-85763678005242560912011-04-23T06:35:00.000-07:002011-04-23T06:36:07.315-07:00Design Patterns in .net<span class="Apple-style-span" style="font-family: Arial, Helvetica, sans-serif; font-size: 13px; line-height: 21px; "><table bgcolor="white" cellpadding="1" cellspacing="1" width="100%"><tbody><tr><td colspan="2" bgcolor="beige" height="14" align="left" style="font-family: Arial, Helvetica, sans-serif; font-size: 10pt; line-height: 1.6em; "> <b>Creational Patterns</b></td></tr><tr><td bgcolor="#ffffff" align="left" width="120" style="font-family: Arial, Helvetica, sans-serif; font-size: 10pt; line-height: 1.6em; "> <a href="http://www.dofactory.com/Patterns/PatternAbstract.aspx" class="alwayson" style="text-decoration: underline; color: rgb(153, 0, 0); font-weight: normal; font-size: 10pt; font-family: Arial, Helvetica, sans-serif; ">Abstract Factory</a></td><td bgcolor="#ffffff" align="left" height="14" style="font-family: Arial, Helvetica, sans-serif; font-size: 10pt; line-height: 1.6em; "> Creates an instance of several families of classes</td></tr><tr><td bgcolor="#ffffff" align="left" width="120" style="font-family: Arial, Helvetica, sans-serif; font-size: 10pt; line-height: 1.6em; "> <a href="http://www.dofactory.com/Patterns/PatternBuilder.aspx" class="alwayson" style="text-decoration: underline; color: rgb(153, 0, 0); font-weight: normal; font-size: 10pt; font-family: Arial, Helvetica, sans-serif; ">Builder</a></td><td bgcolor="#ffffff" align="left" height="14" style="font-family: Arial, Helvetica, sans-serif; font-size: 10pt; line-height: 1.6em; "> Separates object construction from its representation</td></tr><tr><td bgcolor="#ffffff" align="left" width="120" style="font-family: Arial, Helvetica, sans-serif; font-size: 10pt; line-height: 1.6em; "> <a href="http://www.dofactory.com/Patterns/PatternFactory.aspx" class="alwayson" style="text-decoration: underline; color: rgb(153, 0, 0); font-weight: normal; font-size: 10pt; font-family: Arial, Helvetica, sans-serif; ">Factory Method</a></td><td bgcolor="#ffffff" align="left" height="14" style="font-family: Arial, Helvetica, sans-serif; font-size: 10pt; line-height: 1.6em; "> Creates an instance of several derived classes</td></tr><tr><td bgcolor="#ffffff" align="left" width="120" style="font-family: Arial, Helvetica, sans-serif; font-size: 10pt; line-height: 1.6em; "> <a href="http://www.dofactory.com/Patterns/PatternPrototype.aspx" class="alwayson" style="text-decoration: underline; color: rgb(153, 0, 0); font-weight: normal; font-size: 10pt; font-family: Arial, Helvetica, sans-serif; ">Prototype</a></td><td bgcolor="#ffffff" align="left" height="14" style="font-family: Arial, Helvetica, sans-serif; font-size: 10pt; line-height: 1.6em; "> A fully initialized instance to be copied or cloned</td></tr><tr><td bgcolor="#ffffff" align="left" width="120" style="font-family: Arial, Helvetica, sans-serif; font-size: 10pt; line-height: 1.6em; "> <a href="http://www.dofactory.com/Patterns/PatternSingleton.aspx" class="alwayson" style="text-decoration: underline; color: rgb(153, 0, 0); font-weight: normal; font-size: 10pt; font-family: Arial, Helvetica, sans-serif; ">Singleton</a></td><td bgcolor="#ffffff" align="left" height="14" style="font-family: Arial, Helvetica, sans-serif; font-size: 10pt; line-height: 1.6em; "> A class of which only a single instance can exist</td></tr></tbody></table><br /><table bgcolor="#ffffff" cellpadding="1" cellspacing="1" width="100%"><tbody><tr><td colspan="2" bgcolor="beige" height="14" align="left" style="font-family: Arial, Helvetica, sans-serif; font-size: 10pt; line-height: 1.6em; "> <b>Structural Patterns</b></td></tr><tr><td bgcolor="#ffffff" align="left" width="120" style="font-family: Arial, Helvetica, sans-serif; font-size: 10pt; line-height: 1.6em; "> <a href="http://www.dofactory.com/Patterns/PatternAdapter.aspx" class="alwayson" style="text-decoration: underline; color: rgb(153, 0, 0); font-weight: normal; font-size: 10pt; font-family: Arial, Helvetica, sans-serif; ">Adapter</a></td><td bgcolor="#ffffff" align="left" height="14" style="font-family: Arial, Helvetica, sans-serif; font-size: 10pt; line-height: 1.6em; "> Match interfaces of different classes</td></tr><tr><td bgcolor="#ffffff" align="left" width="120" style="font-family: Arial, Helvetica, sans-serif; font-size: 10pt; line-height: 1.6em; "> <a href="http://www.dofactory.com/Patterns/PatternBridge.aspx" class="alwayson" style="text-decoration: underline; color: rgb(153, 0, 0); font-weight: normal; font-size: 10pt; font-family: Arial, Helvetica, sans-serif; ">Bridge</a></td><td bgcolor="#ffffff" align="left" height="14" style="font-family: Arial, Helvetica, sans-serif; font-size: 10pt; line-height: 1.6em; "> Separates an object’s interface from its implementation</td></tr><tr><td bgcolor="#ffffff" align="left" width="120" style="font-family: Arial, Helvetica, sans-serif; font-size: 10pt; line-height: 1.6em; "> <a href="http://www.dofactory.com/Patterns/PatternComposite.aspx" class="alwayson" style="text-decoration: underline; color: rgb(153, 0, 0); font-weight: normal; font-size: 10pt; font-family: Arial, Helvetica, sans-serif; ">Composite</a></td><td bgcolor="#ffffff" align="left" height="14" style="font-family: Arial, Helvetica, sans-serif; font-size: 10pt; line-height: 1.6em; "> A tree structure of simple and composite objects</td></tr><tr><td bgcolor="#ffffff" align="left" width="120" style="font-family: Arial, Helvetica, sans-serif; font-size: 10pt; line-height: 1.6em; "> <a href="http://www.dofactory.com/Patterns/PatternDecorator.aspx" class="alwayson" style="text-decoration: underline; color: rgb(153, 0, 0); font-weight: normal; font-size: 10pt; font-family: Arial, Helvetica, sans-serif; ">Decorator</a></td><td bgcolor="#ffffff" align="left" height="14" style="font-family: Arial, Helvetica, sans-serif; font-size: 10pt; line-height: 1.6em; "> Add responsibilities to objects dynamically</td></tr><tr><td bgcolor="#ffffff" align="left" width="120" style="font-family: Arial, Helvetica, sans-serif; font-size: 10pt; line-height: 1.6em; "> <a href="http://www.dofactory.com/Patterns/PatternFacade.aspx" class="alwayson" style="text-decoration: underline; color: rgb(153, 0, 0); font-weight: normal; font-size: 10pt; font-family: Arial, Helvetica, sans-serif; ">Facade</a></td><td bgcolor="#ffffff" align="left" height="14" style="font-family: Arial, Helvetica, sans-serif; font-size: 10pt; line-height: 1.6em; "> A single class that represents an entire subsystem</td></tr><tr><td bgcolor="#ffffff" align="left" width="120" style="font-family: Arial, Helvetica, sans-serif; font-size: 10pt; line-height: 1.6em; "> <a href="http://www.dofactory.com/Patterns/PatternFlyweight.aspx" class="alwayson" style="text-decoration: underline; color: rgb(153, 0, 0); font-weight: normal; font-size: 10pt; font-family: Arial, Helvetica, sans-serif; ">Flyweight</a></td><td bgcolor="#ffffff" align="left" height="14" style="font-family: Arial, Helvetica, sans-serif; font-size: 10pt; line-height: 1.6em; "> A fine-grained instance used for efficient sharing</td></tr><tr><td bgcolor="#ffffff" align="left" width="120" style="font-family: Arial, Helvetica, sans-serif; font-size: 10pt; line-height: 1.6em; "> <a href="http://www.dofactory.com/Patterns/PatternProxy.aspx" class="alwayson" style="text-decoration: underline; color: rgb(153, 0, 0); font-weight: normal; font-size: 10pt; font-family: Arial, Helvetica, sans-serif; ">Proxy</a></td><td bgcolor="#ffffff" align="left" height="14" style="font-family: Arial, Helvetica, sans-serif; font-size: 10pt; line-height: 1.6em; "> An object representing another object</td></tr></tbody></table><br /><table bgcolor="white" cellpadding="1" cellspacing="1" width="100%"><tbody><tr><td colspan="2" bgcolor="beige" height="14" align="left" style="font-family: Arial, Helvetica, sans-serif; font-size: 10pt; line-height: 1.6em; "> <b>Behavioral Patterns</b></td></tr><tr><td bgcolor="#ffffff" align="left" width="120" style="font-family: Arial, Helvetica, sans-serif; font-size: 10pt; line-height: 1.6em; "> <a href="http://www.dofactory.com/Patterns/PatternChain.aspx" class="alwayson" style="text-decoration: underline; color: rgb(153, 0, 0); font-weight: normal; font-size: 10pt; font-family: Arial, Helvetica, sans-serif; ">Chain of Resp.</a></td><td bgcolor="#ffffff" align="left" height="14" style="font-family: Arial, Helvetica, sans-serif; font-size: 10pt; line-height: 1.6em; "> A way of passing a request between a chain of objects</td></tr><tr><td bgcolor="#ffffff" align="left" width="120" style="font-family: Arial, Helvetica, sans-serif; font-size: 10pt; line-height: 1.6em; "> <a href="http://www.dofactory.com/Patterns/PatternCommand.aspx" class="alwayson" style="text-decoration: underline; color: rgb(153, 0, 0); font-weight: normal; font-size: 10pt; font-family: Arial, Helvetica, sans-serif; ">Command</a></td><td bgcolor="#ffffff" align="left" height="14" style="font-family: Arial, Helvetica, sans-serif; font-size: 10pt; line-height: 1.6em; "> Encapsulate a command request as an object</td></tr><tr><td bgcolor="#ffffff" align="left" width="120" style="font-family: Arial, Helvetica, sans-serif; font-size: 10pt; line-height: 1.6em; "> <a href="http://www.dofactory.com/Patterns/PatternInterpreter.aspx" class="alwayson" style="text-decoration: underline; color: rgb(153, 0, 0); font-weight: normal; font-size: 10pt; font-family: Arial, Helvetica, sans-serif; ">Interpreter</a></td><td bgcolor="#ffffff" align="left" height="14" style="font-family: Arial, Helvetica, sans-serif; font-size: 10pt; line-height: 1.6em; "> A way to include language elements in a program</td></tr><tr><td bgcolor="#ffffff" align="left" width="120" style="font-family: Arial, Helvetica, sans-serif; font-size: 10pt; line-height: 1.6em; "> <a href="http://www.dofactory.com/Patterns/PatternIterator.aspx" class="alwayson" style="text-decoration: underline; color: rgb(153, 0, 0); font-weight: normal; font-size: 10pt; font-family: Arial, Helvetica, sans-serif; ">Iterator</a></td><td bgcolor="#ffffff" align="left" height="14" style="font-family: Arial, Helvetica, sans-serif; font-size: 10pt; line-height: 1.6em; "> Sequentially access the elements of a collection</td></tr><tr><td bgcolor="#ffffff" align="left" width="120" style="font-family: Arial, Helvetica, sans-serif; font-size: 10pt; line-height: 1.6em; "> <a href="http://www.dofactory.com/Patterns/PatternMediator.aspx" class="alwayson" style="text-decoration: underline; color: rgb(153, 0, 0); font-weight: normal; font-size: 10pt; font-family: Arial, Helvetica, sans-serif; ">Mediator</a></td><td bgcolor="#ffffff" align="left" height="14" style="font-family: Arial, Helvetica, sans-serif; font-size: 10pt; line-height: 1.6em; "> Defines simplified communication between classes</td></tr><tr><td bgcolor="#ffffff" align="left" width="120" style="font-family: Arial, Helvetica, sans-serif; font-size: 10pt; line-height: 1.6em; "> <a href="http://www.dofactory.com/Patterns/PatternMemento.aspx" class="alwayson" style="text-decoration: underline; color: rgb(153, 0, 0); font-weight: normal; font-size: 10pt; font-family: Arial, Helvetica, sans-serif; ">Memento</a></td><td bgcolor="#ffffff" align="left" height="14" style="font-family: Arial, Helvetica, sans-serif; font-size: 10pt; line-height: 1.6em; "> Capture and restore an object's internal state</td></tr><tr><td bgcolor="#ffffff" align="left" width="120" style="font-family: Arial, Helvetica, sans-serif; font-size: 10pt; line-height: 1.6em; "> <a href="http://www.dofactory.com/Patterns/PatternObserver.aspx" class="alwayson" style="text-decoration: underline; color: rgb(153, 0, 0); font-weight: normal; font-size: 10pt; font-family: Arial, Helvetica, sans-serif; ">Observer</a></td><td bgcolor="#ffffff" align="left" height="14" style="font-family: Arial, Helvetica, sans-serif; font-size: 10pt; line-height: 1.6em; "> A way of notifying change to a number of classes</td></tr><tr><td bgcolor="#ffffff" align="left" width="120" style="font-family: Arial, Helvetica, sans-serif; font-size: 10pt; line-height: 1.6em; "> <a href="http://www.dofactory.com/Patterns/PatternState.aspx" class="alwayson" style="text-decoration: underline; color: rgb(153, 0, 0); font-weight: normal; font-size: 10pt; font-family: Arial, Helvetica, sans-serif; ">State</a></td><td bgcolor="#ffffff" align="left" height="14" style="font-family: Arial, Helvetica, sans-serif; font-size: 10pt; line-height: 1.6em; "> Alter an object's behavior when its state changes</td></tr><tr><td bgcolor="#ffffff" align="left" width="120" style="font-family: Arial, Helvetica, sans-serif; font-size: 10pt; line-height: 1.6em; "> <a href="http://www.dofactory.com/Patterns/PatternStrategy.aspx" class="alwayson" style="text-decoration: underline; color: rgb(153, 0, 0); font-weight: normal; font-size: 10pt; font-family: Arial, Helvetica, sans-serif; ">Strategy</a></td><td bgcolor="#ffffff" align="left" height="14" style="font-family: Arial, Helvetica, sans-serif; font-size: 10pt; line-height: 1.6em; "> Encapsulates an algorithm inside a class</td></tr><tr><td bgcolor="#ffffff" align="left" width="120" style="font-family: Arial, Helvetica, sans-serif; font-size: 10pt; line-height: 1.6em; "> <a href="http://www.dofactory.com/Patterns/PatternTemplate.aspx" class="alwayson" style="text-decoration: underline; color: rgb(153, 0, 0); font-weight: normal; font-size: 10pt; font-family: Arial, Helvetica, sans-serif; ">Template Method</a></td><td bgcolor="#ffffff" align="left" height="14" style="font-family: Arial, Helvetica, sans-serif; font-size: 10pt; line-height: 1.6em; "> Defer the exact steps of an algorithm to a subclass</td></tr><tr><td bgcolor="#ffffff" align="left" width="120" style="font-family: Arial, Helvetica, sans-serif; font-size: 10pt; line-height: 1.6em; "> <a href="http://www.dofactory.com/Patterns/PatternVisitor.aspx" class="alwayson" style="text-decoration: underline; color: rgb(153, 0, 0); font-weight: normal; font-size: 10pt; font-family: Arial, Helvetica, sans-serif; ">Visitor</a></td><td bgcolor="#ffffff" align="left" height="14" style="font-family: Arial, Helvetica, sans-serif; font-size: 10pt; line-height: 1.6em; "> Defines a new operation to a class without change</td></tr></tbody></table></span>kasunhttp://www.blogger.com/profile/17340599678468268127noreply@blogger.com0tag:blogger.com,1999:blog-7656114444857683599.post-67159419782730072992011-04-23T05:23:00.001-07:002011-04-23T06:25:17.202-07:00<span class="Apple-style-span" style="font-family: 'Segoe UI', 'Lucida Grande', Verdana, Arial, Helvetica, sans-serif; line-height: 16px; font-size: 14px;"><p style="border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; font-weight: inherit; font-style: inherit; font-family: inherit; margin-top: 0px; margin-right: 0px; margin-bottom: 12px; margin-left: 0px; outline-width: 0px; outline-style: initial; outline-color: initial; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; "><span class="Apple-style-span" ><br /></span></p></span>kasunhttp://www.blogger.com/profile/17340599678468268127noreply@blogger.com0tag:blogger.com,1999:blog-7656114444857683599.post-78900285409148387912011-04-13T07:53:00.001-07:002011-04-13T07:54:52.683-07:00Path<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgycv5Zumphbl9pKB4TlLWREDvDOR-pdAg7MWl5bErG1dQwMKOLJf5NrSFkFnkLofVuAj0Sb-2hDqAJl_9anvA2uiAwTOAkne0_Rfkm8bzVtogz2BuJ6wGT6XTDRQPiZj6tPa_HzohKBtZk/s1600/ScreenShot001.jpg" onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}"><img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;width: 400px; height: 221px;" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgycv5Zumphbl9pKB4TlLWREDvDOR-pdAg7MWl5bErG1dQwMKOLJf5NrSFkFnkLofVuAj0Sb-2hDqAJl_9anvA2uiAwTOAkne0_Rfkm8bzVtogz2BuJ6wGT6XTDRQPiZj6tPa_HzohKBtZk/s400/ScreenShot001.jpg" border="0" alt="" id="BLOGGER_PHOTO_ID_5595081751136423490" /></a><br /><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj76tOjbmn-5hcBk4ks9mX3sfXO7R9Pv8aegWze2fe5yYFJGZqcMjEfMHbAAmF70LglBSMxp2z24_o7QOxaRSpFqU8fowKdl91HRGhravMhV1TqZCj-h-YtKKel-j2iQqCr_VRHID7NdzvD/s1600/ScreenShot002.jpg" onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}"><img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;width: 400px; height: 231px;" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj76tOjbmn-5hcBk4ks9mX3sfXO7R9Pv8aegWze2fe5yYFJGZqcMjEfMHbAAmF70LglBSMxp2z24_o7QOxaRSpFqU8fowKdl91HRGhravMhV1TqZCj-h-YtKKel-j2iQqCr_VRHID7NdzvD/s400/ScreenShot002.jpg" border="0" alt="" id="BLOGGER_PHOTO_ID_5595081673578035586" /></a>kasunhttp://www.blogger.com/profile/17340599678468268127noreply@blogger.com0tag:blogger.com,1999:blog-7656114444857683599.post-30822651188172367582011-02-24T09:04:00.000-08:002011-02-24T09:05:11.226-08:00What is FILESTREAM<span class="Apple-style-span" style="color: rgb(51, 51, 51); font-family: verdana, tahoma, arial, sans-serif; font-size: 12px; line-height: 19px; "><h2 style="padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; margin-top: 1em; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font-family: Georgia, Verdana, Arial, serif; font-size: 1.4em; letter-spacing: 1px; font-weight: normal; text-align: justify; ">What is FILESTREAM?</h2><p style="padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; margin-top: 0.7em; margin-right: 0px; margin-bottom: 0.7em; margin-left: 0px; line-height: 1.6em; text-align: justify; ">FILESTREAM is a new feature introduced in SQL Server 2008 which provides an efficient storage and management option for BLOB data.</p><p style="padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; margin-top: 0.7em; margin-right: 0px; margin-bottom: 0.7em; margin-left: 0px; line-height: 1.6em; text-align: justify; ">Many applications that deal with BLOB data today stores them in the file system and stores the path to the file in the relational tables. Storing BLOB data in the file system is more efficient that storing them in the database. However, this brings up a few disadvantages as well. When the BLOB data is stored in the file system, it is hard to ensure transactional consistency between the file system data and relational data.</p><p style="padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; margin-top: 0.7em; margin-right: 0px; margin-bottom: 0.7em; margin-left: 0px; line-height: 1.6em; text-align: justify; ">Some applications store the BLOB data within the database to overcome the limitations mentioned earlier. This approach ensures transactional consistency between the relational data and BLOB data, but is very bad in terms of performance.</p><p style="padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; margin-top: 0.7em; margin-right: 0px; margin-bottom: 0.7em; margin-left: 0px; line-height: 1.6em; text-align: justify; ">FILESTREAM combines the benefits of both approaches mentioned above without the disadvantages we examined. FILESTREAM stores the BLOB data in the file system (thus takes advantage of the IO Streaming capabilities of NTFS) and ensures transactional consistency between the BLOB data in the file system and the relational data in the database.</p></span>kasunhttp://www.blogger.com/profile/17340599678468268127noreply@blogger.com0tag:blogger.com,1999:blog-7656114444857683599.post-69526487377269530422011-02-16T08:00:00.000-08:002011-02-24T08:59:56.693-08:00Best Picks...<span class="Apple-style-span" style="font-family: Verdana, Calibri, Arial, serif; font-size: 12px; "><div align="justify" style="margin-top: 10pt; margin-right: 0in; margin-bottom: 0pt; margin-left: 0in; "><b><span><span>What role does the ScriptManager play?</span></span></b></div><div align="justify" style="margin-top: 10pt; margin-right: 0in; margin-bottom: 0pt; margin-left: 0in; "><b><span><span><br /></span></span></b></div><div align="justify" style="margin-top: 0in; margin-right: 0in; margin-bottom: 10pt; margin-left: 0in; "><span>The ScriptManager manages all ASP.NET AJAX resources on a page and renders the links for the ASP.NET AJAX client libraries, which lets you use AJAX functionality like PageMethods, UpdatePanels etc. It creates the PageRequestManager and Application objects, which are prominent in raising events during the client life cycle of an ASP.NET AJAX Web page. It also helps you create proxies to call web services asynchronously.</span></div></span>kasunhttp://www.blogger.com/profile/17340599678468268127noreply@blogger.com0tag:blogger.com,1999:blog-7656114444857683599.post-85151559396283682602011-02-13T07:42:00.000-08:002011-02-13T07:52:16.141-08:00Design PatternsThere are three basic classification of patterns Creational, Structural, Behavioral patterns.<div><br /></div><div>Creational Patterns</div><div>==============</div><div><br /></div><div>Abstract Factory:- Creates an instance of several families of classes</div><div>Builder :- Separates object construction from its representation</div><div>Factory Method:- Creates an instance of several derived classes</div><div>Prototype:- A fully initialized instance to be copied or cloned</div><div>Singleton:- A class in which only a single instance can exist</div><div><br /></div><div>Structural Patterns</div><div>==============</div><div><br /></div><div>Adapter:-Match interfaces of different classes.</div><div>Bridge:-Separates an object’s interface from its implementation.</div><div>Composite:-A tree structure of simple and composite objects.</div><div>Decorator :-Add responsibilities to objects dynamically.</div><div>Façade:-A single class that represents an entire subsystem.</div><div>Flyweight:-A fine-grained instance used for efficient sharing.</div><div>Proxy:-An object representing another object.</div><div><br /></div><div>Behavioral Patterns</div><div>===============</div><div><br /></div><div>Mediator:-Defines simplified communication between classes.</div><div>Memento:-Capture and restore an object's internal state.</div><div>Interpreter:-A way to include language elements in a program.</div><div>Iterator:-Sequentially access the elements of a collection.</div><div>Chain of Resp:-A way of passing a request between a chain of objects.</div><div>Command:-Encapsulate a command request as an object.</div><div>State:-Alter an object's behavior when its state changes.</div><div>Strategy:-Encapsulates an algorithm inside a class.</div><div>Observer:-A way of notifying change to a number of classes.</div><div>Template Method:-Defer the exact steps of an algorithm to a subclass.</div><div>Visitor:-Defines a new operation to a class without change.</div><div><br /></div><div><br /></div><div><br /></div><div><br /></div>kasunhttp://www.blogger.com/profile/17340599678468268127noreply@blogger.com0tag:blogger.com,1999:blog-7656114444857683599.post-58487921769637957762011-02-11T08:35:00.000-08:002011-02-11T08:36:27.710-08:00TSQL: Concatenate Multiple Rows into String<span class="Apple-style-span" style="font-family: arial, helvetica, clean, sans-serif; font-size: 13px; line-height: 15px; "><p style="margin-top: 0in; margin-right: 0in; margin-bottom: 0.0001pt; margin-left: 0in; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; line-height: 15.75pt; outline-style: none; outline-width: initial; outline-color: initial; display: block; font-size: 12pt; font-family: serif; "><span style="line-height: 1.2em; outline-style: none; outline-width: initial; outline-color: initial; font-size: 11.5pt; font-family: serif; color: black; ">use Northwind</span></p><p style="margin-top: 0in; margin-right: 0in; margin-bottom: 0.0001pt; margin-left: 0in; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; line-height: 15.75pt; outline-style: none; outline-width: initial; outline-color: initial; display: block; font-size: 12pt; font-family: serif; "><span style="line-height: 1.2em; outline-style: none; outline-width: initial; outline-color: initial; font-size: 11.5pt; font-family: serif; color: black; "> </span></p><p style="margin-top: 0in; margin-right: 0in; margin-bottom: 0.0001pt; margin-left: 0in; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; line-height: 15.75pt; outline-style: none; outline-width: initial; outline-color: initial; display: block; font-size: 12pt; font-family: serif; "><span style="line-height: 1.2em; outline-style: none; outline-width: initial; outline-color: initial; font-size: 11.5pt; font-family: serif; color: black; ">declare @CategoryList varchar(1000)<br />select @CategoryList = coalesce(@CategoryList + ‘, ‘, ”) + CategoryName from Categories</span></p><p style="margin-top: 0in; margin-right: 0in; margin-bottom: 0.0001pt; margin-left: 0in; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; line-height: 15.75pt; outline-style: none; outline-width: initial; outline-color: initial; display: block; font-size: 12pt; font-family: serif; "><span style="line-height: 1.2em; outline-style: none; outline-width: initial; outline-color: initial; font-size: 11.5pt; font-family: serif; color: black; ">select ‘Results = ‘ + @CategoryList</span></p></span>kasunhttp://www.blogger.com/profile/17340599678468268127noreply@blogger.com0tag:blogger.com,1999:blog-7656114444857683599.post-47234622950771522332011-01-26T20:54:00.000-08:002011-01-26T20:59:07.389-08:00datatable grouping<div>Ex : var masterGroups = (from row in dtRetCls.AsEnumerable()</div><div> group row by row["GroupDescription"] into groupedTable </div><div> select new</div><div> {</div><div> x = groupedTable.Key </div><div> } </div><div> ).ToList();</div><div><br /></div><div>Select data rows</div><div><br /></div><div>DataRow[] drx = dtRetCls.Select("GroupDescription= '" + item.x + "' "); </div>kasunhttp://www.blogger.com/profile/17340599678468268127noreply@blogger.com0tag:blogger.com,1999:blog-7656114444857683599.post-24442092613311813802011-01-26T20:52:00.000-08:002011-01-26T20:54:37.102-08:00Computed Column SpecificationEx : <div>(((isnull([AuthorizedQtyU1],isnull([InvoiceQtyU1],(0)))-isnull([ReceivedQtyU1],(0)))-isnull([DamagedQtyU1],(0)))-isnull([MissingQtyU1],(0)))</div><div><br /></div><div>Is Persisted = no</div><div><br /></div><div>(datediff(minute,[StartTime],[EndTime]))</div><div><br /></div><div><div>Is Persisted = no</div></div><div><br /></div>kasunhttp://www.blogger.com/profile/17340599678468268127noreply@blogger.com0tag:blogger.com,1999:blog-7656114444857683599.post-75207316113155670032011-01-13T02:23:00.000-08:002011-01-13T04:19:11.196-08:00filter generic list itemsBatchExeProduct batchExeProductObject = batchExeProducts.Find(delegate(BatchExeProduct ep) {return ep.ExecutiveCode == exeCode; });kasunhttp://www.blogger.com/profile/17340599678468268127noreply@blogger.com0tag:blogger.com,1999:blog-7656114444857683599.post-82890957440846710312011-01-09T20:24:00.000-08:002011-01-09T20:26:47.392-08:00Remove cache in asp.net page<span class="Apple-style-span" style="font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 12px; "><p style="font-size: 11px; margin-top: 0cm; margin-right: 0cm; margin-bottom: 0pt; margin-left: 0cm; "><span style="font-size: 10pt; font-family: Arial; "> So far I've tried the page directive:<o:p></o:p></span></p><p style="font-size: 11px; margin-top: 0cm; margin-right: 0cm; margin-bottom: 0pt; margin-left: 0cm; "><span style="font-size: 10pt; font-family: Arial; "><span> </span><span style="color: blue; ">@</span> <span style="color: maroon; ">OutputCache</span> <span style="color: red; ">Duration</span><span style="color: blue; ">="1"</span> <span style="color: red; ">Location</span><span style="color: blue; ">="None"</span> <o:p></o:p></span></p><p style="font-size: 11px; margin-top: 0cm; margin-right: 0cm; margin-bottom: 0pt; margin-left: 0cm; "><span style="font-size: 10pt; font-family: Arial; "><o:p> </o:p></span></p><p style="font-size: 11px; margin-top: 0cm; margin-right: 0cm; margin-bottom: 0pt; margin-left: 0cm; "><span style="font-size: 10pt; font-family: Arial; ">The Meta tags:<o:p></o:p></span></p><p style="font-size: 11px; margin-top: 0cm; margin-right: 0cm; margin-bottom: 0pt; margin-left: 0cm; "><span style="font-size: 10pt; color: blue; font-family: Arial; "><</span><span style="font-size: 10pt; color: maroon; font-family: Arial; ">meta</span><span style="font-size: 10pt; font-family: Arial; "> <span style="color: red; ">http-equiv</span><span style="color: blue; ">="Expires"</span> <span style="color: red; ">CONTENT</span><span style="color: blue; ">="0"><o:p></o:p></span></span></p><p style="font-size: 11px; margin-top: 0cm; margin-right: 0cm; margin-bottom: 0pt; margin-left: 0cm; "><span style="font-size: 10pt; color: blue; font-family: Arial; "><</span><span style="font-size: 10pt; color: maroon; font-family: Arial; ">meta</span><span style="font-size: 10pt; color: blue; font-family: Arial; "> </span><span style="font-size: 10pt; color: red; font-family: Arial; ">http-equiv</span><span style="font-size: 10pt; color: blue; font-family: Arial; ">="Cache-Control" </span><span style="font-size: 10pt; color: red; font-family: Arial; ">CONTENT</span><span style="font-size: 10pt; color: blue; font-family: Arial; ">="no-cache"><o:p></o:p></span></p><p style="font-size: 11px; margin-top: 0cm; margin-right: 0cm; margin-bottom: 0pt; margin-left: 0cm; "><span style="font-size: 10pt; color: blue; font-family: Arial; "><</span><span style="font-size: 10pt; color: maroon; font-family: Arial; ">meta</span><span style="font-size: 10pt; color: blue; font-family: Arial; "> </span><span style="font-size: 10pt; color: red; font-family: Arial; ">http-equiv</span><span style="font-size: 10pt; color: blue; font-family: Arial; ">="Pragma" </span><span style="font-size: 10pt; color: red; font-family: Arial; ">CONTENT</span><span style="font-size: 10pt; color: blue; font-family: Arial; ">="no-cache"><o:p></o:p></span></p><p style="font-size: 11px; margin-top: 0cm; margin-right: 0cm; margin-bottom: 0pt; margin-left: 0cm; "><span style="font-size: 10pt; font-family: Arial; "><o:p> </o:p></span></p><p style="font-size: 11px; margin-top: 0cm; margin-right: 0cm; margin-bottom: 0pt; margin-left: 0cm; "><span style="font-size: 10pt; font-family: Arial; ">And the code:<o:p></o:p></span></p><p class="MsoNormal" style="font-size: 11px; margin-top: 0cm; margin-right: 0cm; margin-bottom: 0pt; margin-left: 0cm; "><span style="font-size: 10pt; font-family: 'Courier New'; "><span> </span>Response.ExpiresAbsolute = DateTime.Now<o:p></o:p></span></p><p class="MsoNormal" style="font-size: 11px; margin-top: 0cm; margin-right: 0cm; margin-bottom: 0pt; margin-left: 0cm; "><span style="font-size: 10pt; font-family: 'Courier New'; "><span> </span>Response.Expires = -1441<o:p></o:p></span></p><p class="MsoNormal" style="font-size: 11px; margin-top: 0cm; margin-right: 0cm; margin-bottom: 0pt; margin-left: 0cm; "><span style="font-size: 10pt; font-family: 'Courier New'; "><span> </span>Response.CacheControl = <span style="color: maroon; ">"no-cache"<o:p></o:p></span></span></p><p class="MsoNormal" style="font-size: 11px; margin-top: 0cm; margin-right: 0cm; margin-bottom: 0pt; margin-left: 0cm; "><span style="font-size: 10pt; font-family: 'Courier New'; "><span> </span>Response.AddHeader(<span style="color: maroon; ">"Pragma"</span>, <span style="color: maroon; ">"no-cache"</span>)<o:p></o:p></span></p><p class="MsoNormal" style="font-size: 11px; margin-top: 0cm; margin-right: 0cm; margin-bottom: 0pt; margin-left: 0cm; "><span style="font-size: 10pt; font-family: 'Courier New'; "><span> </span>Response.AddHeader(<span style="color: maroon; ">"Pragma"</span>, <span style="color: maroon; ">"no-store"</span>)<o:p></o:p></span></p><p style="font-size: 11px; margin-top: 0cm; margin-right: 0cm; margin-bottom: 0pt; margin-left: 0cm; "><span style="font-size: 10pt; font-family: 'Courier New'; "><span> </span>Response.AddHeader(<span style="color: maroon; ">"cache-control"</span>, <span style="color: maroon; ">"no-cache"</span>)</span><span style="font-size: 10pt; font-family: Arial; "><o:p></o:p></span></p><p class="MsoNormal" style="font-size: 11px; margin-top: 0cm; margin-right: 0cm; margin-bottom: 0pt; margin-left: 0cm; "><span style="font-size: 10pt; font-family: 'Courier New'; "><span> </span>Response.Cache.SetCacheability(HttpCacheability.NoCache)<o:p></o:p></span></p><p class="MsoNormal" style="font-size: 11px; margin-top: 0cm; margin-right: 0cm; margin-bottom: 0pt; margin-left: 0cm; "><span style="font-size: 10pt; font-family: 'Courier New'; "><span> </span>Response.Cache.SetNoServerCaching()</span></p></span>kasunhttp://www.blogger.com/profile/17340599678468268127noreply@blogger.com0tag:blogger.com,1999:blog-7656114444857683599.post-21402617450412574772011-01-07T21:31:00.001-08:002011-01-07T21:31:47.913-08:00filter sql<span class="Apple-style-span" style="font-family: verdana, geneva, lucida, 'lucida grande', arial, helvetica, sans-serif; font-size: 13px; -webkit-border-horizontal-spacing: 1px; -webkit-border-vertical-spacing: 1px; ">WHERE convert (datetime, convert (varchar, datecol, 101), 101) = @yourdate</span>kasunhttp://www.blogger.com/profile/17340599678468268127noreply@blogger.com0tag:blogger.com,1999:blog-7656114444857683599.post-50185631802713441882010-12-24T21:47:00.000-08:002010-12-24T22:54:32.029-08:00Best Interview Picks...The Common Language Runtime<br /><br />The CLR is a runtime execution engine of .NET that provides an environment to execute programs that are targeted at the .NET platform. It provides memory allocation, security, code verification, type verification, exception handling and garbage collection in the managed environment.<br /><br />Strong Name<br /><br />A Strong Name is a unique identifier given to an assembly using cryptography and a digital signature that is used to identify a particular assembly. An assembly is provided a strong name using the utility called sn.exe.<br /><br />A strong name consists of the following.<br /><br />· Name of the Assembly<br /><br />· Digital Signature<br /><br />· Version Number<br /><br />· Culture Information<br /><br /><br />Global Assembly Cache<br /><br />The Global Assembly Cache is a system wide storage of shared assemblies. Assemblies can be stored or moved to and from the Global Assembly Cache using a tool called <b>GacUtil</b>.<br /><br /><br />Satellite Assembly<br /><br />When you wish to localize the application, it can be written in culture-neutral code and can distribute the localized modules in separate assemblies called satellite assemblies.<div><br /></div><div><span class="Apple-style-span" style="font-family: Verdana, sans-serif; font-size: 13px; color: rgb(206, 0, 0); font-weight: bold; -webkit-border-horizontal-spacing: 2px; -webkit-border-vertical-spacing: 2px; ">Assembly Manifest</span></div><div><span class="Apple-style-span" style="font-family: Verdana, sans-serif; font-size: 13px; color: rgb(206, 0, 0); font-weight: bold; -webkit-border-horizontal-spacing: 2px; -webkit-border-vertical-spacing: 2px; "><br /></span></div><div><span class="Apple-style-span" style="font-family: Verdana, sans-serif; font-size: 13px; color: rgb(206, 0, 0); font-weight: bold; -webkit-border-horizontal-spacing: 2px; -webkit-border-vertical-spacing: 2px; "><span class="Apple-style-span" style="color: rgb(0, 0, 0); font-weight: normal; ">The Assembly Manifest contains the information about an assembly. This includes the version number of the assembly, the list of the files that comprise the assembly, etc. An assembly manifest is contained in the dll file or the exe file itself.</span></span></div><div><span class="Apple-style-span" style="font-family: Verdana, sans-serif; font-size: 13px; color: rgb(206, 0, 0); font-weight: bold; -webkit-border-horizontal-spacing: 2px; -webkit-border-vertical-spacing: 2px; "><span class="Apple-style-span" style="color: rgb(0, 0, 0); font-weight: normal; "><br /></span></span></div><div><span class="Apple-style-span" style="font-size: 13px; color: rgb(206, 0, 0); font-weight: bold; -webkit-border-horizontal-spacing: 2px; -webkit-border-vertical-spacing: 2px; font-family: Verdana, sans-serif; "><span class="Apple-style-span" style="color: rgb(0, 0, 0); font-weight: normal; "><p class="SectionHeading" style="margin-top: 0in; margin-right: 0in; margin-bottom: 6pt; margin-left: 0in; font-size: 10pt; font-family: Verdana, sans-serif; color: rgb(206, 0, 0); font-weight: bold; ">Caching</p><p class="MsoNormal" style="margin-top: 0in; margin-right: 0in; margin-bottom: 6pt; margin-left: 0in; ">Caching is a feature that stores the data in the memory for serving the incoming requests from the memory itself. Caching in ASP.NET can be of three types.</p><p class="MsoListBullet" style="margin-top: 0in; margin-right: 0in; margin-bottom: 6pt; margin-left: 0.25in; text-indent: -0.25in; font-size: 10pt; font-family: Verdana; "><span style="font-family: Symbol; ">·<span style="font: normal normal normal 7pt/normal 'Times New Roman'; "> </span></span>Page Output Caching</p><p class="MsoListBullet" style="margin-top: 0in; margin-right: 0in; margin-bottom: 6pt; margin-left: 0.25in; text-indent: -0.25in; font-size: 10pt; font-family: Verdana; "><span style="font-family: Symbol; ">·<span style="font: normal normal normal 7pt/normal 'Times New Roman'; "> </span></span>Page Fragment Caching</p><p class="MsoListBullet" style="margin-top: 0in; margin-right: 0in; margin-bottom: 6pt; margin-left: 0.25in; text-indent: -0.25in; font-size: 10pt; font-family: Verdana; "><span style="font-family: Symbol; ">·<span style="font: normal normal normal 7pt/normal 'Times New Roman'; "> </span></span>Data Caching</p><p class="MsoListBullet" style="margin-top: 0in; margin-right: 0in; margin-bottom: 6pt; margin-left: 0.25in; text-indent: -0.25in; font-size: 10pt; font-family: Verdana; "><br /></p><p class="MsoListBullet" style="margin-top: 0in; margin-right: 0in; margin-bottom: 6pt; margin-left: 0.25in; text-indent: -0.25in; font-size: 10pt; font-family: Verdana; "><span class="Apple-style-span" style="font-family: Verdana, sans-serif; "></span></p><p class="SectionHeading" style="margin-top: 0in; margin-right: 0in; margin-bottom: 6pt; margin-left: 0in; font-size: 10pt; font-family: Verdana, sans-serif; color: rgb(206, 0, 0); font-weight: bold; ">Session State</p><p class="MsoNormal" style="margin-top: 0in; margin-right: 0in; margin-bottom: 6pt; margin-left: 0in; ">A session is the period of a connection between a server and a client. The Session State allows storage of objects in a user’s session. A session can be stored in one of the following ways.</p><p class="MsoListBullet" style="margin-top: 0in; margin-right: 0in; margin-bottom: 6pt; margin-left: 0.25in; text-indent: -0.25in; font-size: 10pt; font-family: Verdana; "><span style="font-family: Symbol; ">·<span style="font: normal normal normal 7pt/normal 'Times New Roman'; "> </span></span>InProc</p><p class="MsoListBullet" style="margin-top: 0in; margin-right: 0in; margin-bottom: 6pt; margin-left: 0.25in; text-indent: -0.25in; font-size: 10pt; font-family: Verdana; "><span style="font-family: Symbol; ">·<span style="font: normal normal normal 7pt/normal 'Times New Roman'; "> </span></span>State Server</p><p class="MsoListBullet" style="margin-top: 0in; margin-right: 0in; margin-bottom: 6pt; margin-left: 0.25in; text-indent: -0.25in; font-size: 10pt; font-family: Verdana; "><span style="font-family: Symbol; ">·<span style="font: normal normal normal 7pt/normal 'Times New Roman'; "> </span></span>SQL Server</p><p class="MsoListBullet" style="margin-top: 0in; margin-right: 0in; margin-bottom: 6pt; margin-left: 0.25in; text-indent: -0.25in; font-size: 10pt; font-family: Verdana; "><br /></p><p class="MsoListBullet" style="margin-top: 0in; margin-right: 0in; margin-bottom: 6pt; margin-left: 0.25in; text-indent: -0.25in; font-size: 10pt; font-family: Verdana; "><br /></p><p class="MsoListBullet" style="margin-top: 0in; margin-right: 0in; margin-bottom: 6pt; margin-left: 0.25in; text-indent: -0.25in; font-size: 10pt; font-family: Verdana; "><br /></p><p class="MsoListBullet" style="margin-top: 0in; margin-right: 0in; margin-bottom: 6pt; margin-left: 0.25in; text-indent: -0.25in; font-size: 10pt; font-family: Verdana; "><span class="Apple-style-span" style="font-family: Verdana, sans-serif; "></span></p><p class="SectionHeading" style="margin-top: 0in; margin-right: 0in; margin-bottom: 6pt; margin-left: 0in; font-size: 10pt; font-family: Verdana, sans-serif; color: rgb(206, 0, 0); font-weight: bold; ">Remoting</p><p class="MsoNormal" style="margin-top: 0in; margin-right: 0in; margin-bottom: 6pt; margin-left: 0in; ">Remoting allows two processes, a Server and a Client, to inter-communicate in the same system, the same network or across networks. In Remoting, a server and client communicate using a Channel.</p></span><p></p><p class="MsoListBullet" style="margin-top: 0in; margin-right: 0in; margin-bottom: 6pt; margin-left: 0.25in; text-indent: -0.25in; font-size: 10pt; font-family: Verdana; "><br /></p><p class="MsoListBullet" style="margin-top: 0in; margin-right: 0in; margin-bottom: 6pt; margin-left: 0.25in; text-indent: -0.25in; font-size: 10pt; font-family: Verdana; "><span class="Apple-style-span" style="font-family: Verdana, sans-serif; "></span></p><p class="SectionHeading" style="margin-top: 0in; margin-right: 0in; margin-bottom: 6pt; margin-left: 0in; font-size: 10pt; font-family: Verdana, sans-serif; color: rgb(206, 0, 0); font-weight: bold; ">Biztalk Server</p><p class="MsoNormal" style="margin-top: 0in; margin-right: 0in; margin-bottom: 6pt; margin-left: 0in; ">This is a set of Microsoft Server Applications that allow integration, automation and management of different server applications.</p></span><p></p><p class="MsoListBullet" style="margin-top: 0in; margin-right: 0in; margin-bottom: 6pt; margin-left: 0.25in; text-indent: -0.25in; font-size: 10pt; font-family: Verdana; "><br /></p><p class="MsoListBullet" style="text-align: left;margin-top: 0in; margin-right: 0in; margin-bottom: 6pt; margin-left: 0.25in; text-indent: -0.25in; font-size: 10pt; font-family: Verdana; "><br /></p><p></p><p class="MsoListBullet" style="margin-top: 0in; margin-right: 0in; margin-bottom: 6pt; margin-left: 0.25in; text-indent: -0.25in; font-size: 10pt; font-family: Verdana; "><br /></p></div>kasunhttp://www.blogger.com/profile/17340599678468268127noreply@blogger.com0tag:blogger.com,1999:blog-7656114444857683599.post-57190800562125990322010-12-05T08:43:00.000-08:002010-12-05T08:45:06.050-08:00::: SharePoint Concepts :::What is the concept of ghosting and unghosting in SharePoint?<br /><br />ghosted pages :::<br />In SharePoint most of the site pages derive from templates. The custom pages only store the difference between them. The template is loaded in memory and applied to the custom pages on fly. In other words the template is stored in a cache. This definitely brings in performance and flexibility. Flexibility is in terms that when we change the template page it's applied to all custom pages. These pages are loaded from the file system. So <span style="font-weight:bold;">pages which are loaded from the file system are termed as ghosted pages.</span><br /><br />If the page data is loaded from the content database it's termed as <span style="font-weight:bold;">unghosted </span>pages.kasunhttp://www.blogger.com/profile/17340599678468268127noreply@blogger.com0tag:blogger.com,1999:blog-7656114444857683599.post-66247891314242970692010-10-22T21:15:00.000-07:002010-10-22T21:19:26.854-07:00Steps to building custom service applicationDevelopment tasks<br /><br />create service application <br />create service application endpoint(WCF)<br />create service application installers<br />create service application proxy<br />create service application proxy installers<br />create service application consumerskasunhttp://www.blogger.com/profile/17340599678468268127noreply@blogger.com0