Posts

Showing posts from March, 2012

Page Rendering

Pages are asked to render themselves only by IRequestTargets (see  Request targets ). So the initial message renderPage() comes from a target instance. Page render initiates render of all its subcomponents and is responsible for calling render related methods. Since page extends MarkupContainer most of its render logic is applicable to any MarkupContainer. Page rendering consists of the following steps: before render step rendering after render step It worth mentioning that before those steps page restores values of all form components which can be persisted (see FormComponent#supportsPersistence()). These values can be restored from anywhere (see IValuePersister interface). By default they are restored from cookies. ....................................................................................... The  renderNext()  method belongs to MarkupContainer class and it is not used exclusively by pages. This method gets current tag from markup stream and attempts to find component wh
1) Create Table query create table emp(eid number(20),ename varchar2(20),sal number(5)) 2) Display nth highest salary from table : SELECT DISTINCT (a.salary) FROM EMP A WHERE &N = (SELECT COUNT (DISTINCT (b.salary)) FROM EMP B WHERE a.salary<=b.salary); 3) Versioning select banner from v$version 4) Conversion : select salary "Character",(to_char(to_date(salary,'j'), 'jsp')) "SALARYY" from emp select ename "Name of Employees" from emp

JAVASCRIPT

Ways to implement JAVAScript 1 ) <script type="text/javascript" src="xxx.js"></script> 2 ) < script   type   ="text/javascript">      function  display() {         document.write( "<p>"  + Date() +  "</p>" );     } </ script >      < title ></ title > </ head > < body > < button   id    ="b1"   runat   ="server"   onclick   ="display()"   value   ="click"> Click </ button > 3) Semicolon is optional JavaScript Statements A JavaScript statement is a command to a browser. The purpose of the command is to tell the browser what to do. This JavaScript statement tells the browser to write "Hello Dolly" to the web page: document.write("Hello Dolly"); It is normal to add a semicolon at the end of each executable statement. Most people think this is a good programming practice, and most often you will see this in

Drop and Create to in SQL Server 2008

Image
How to use   : I will be writing about things I like from time to time. That is SQL Server things - other than beer, good books and company. For today, one small thing but how useful. In SQL Server Management Studio 2008 you can script objects as DROP and CREATE in one go: Why to use :     This is very useful for us, as we store all database objects in our SVN as DROP..CREATE scripts. Using this feature saves quite a bit of time each time we want to update the source control. I noticed an interesting behavior - if you script your table this way, all constraints defined in the table are scripted with drop statements before the actual DROP TABLE statement is included. This is quite handy as you can easily modify this script to change constraint names or definitions without having to script them separately. 

How to DEBUG the Code ??

Image
Basic steps   “ How to debug the code “ Steps : 1)       Put the breakpoint (Click on left-hand side of window ) Yellow colored line shows you are Compiling following line.Red Symbol showing your debugging started from that line  [Note : You can’t put breakpoint to GUI or presentation like .aspx file. Only in *.aspx.cs,*.cs etc   and you can’t put breakpoint for NAMESPACES ] 1)       For Debugging you have some Important   shortcut keys like F10 -   Start debugging F11 – Go inside to the   Particular method when that yellow color available on that line 2)       When you   move your curser through objects,variables , methods etc its show description of that . 3)       When you start debugging again and again then , no need to stop process .Only just right click from where you   want to start debugging and click “SET NEXT STATEMENT” That blue-mark …..  [These are basic steps of debugging .] If you want to delete all breakpoint then go to Debug -> Click on "Delete all br

Unable to evaluate expression because the code is optimized or a native frame is on top of the call stack

Actually we can't say that its a error .Its similar to exception that occured during URL Loading events. Solution : Write like ths......   Make second argument of response.redirect(url,false); Request . Redirect ( url , false );   Otherwise , no need to chnage in current scenario. It will not harm your code. Just put in Try...Catch . In Catch {Give name of Url you want to redirect...}  

Know the inside of the third party library

When you developed java application and used the third party library. You want to know the inside of the third party library. You should attach the source for it. So an eclipse plugin to help you. Use follwing plugins available on this link http://svn.codespot.com/a/eclipselabs.org/free-plugins/trunk/site/ Happy Coding !!!

Difference between Eval() And Bind() Methods

1 )  Eval is used for unidirectional (readonly) data binding, while Bind is for bi-directional (editable) databinding 2)  The Eval method is a static (read-only) method that takes the value of a data field and returns it as a string. The Bind method supports read/write functionality with the ability to retrieve the values of data-bound controls and submit any changes made back to the database. 3) If you bind a value using Eval, it is like a read only. You can only view the data. If you bind a value using Bind, and if you do some change on the value it will reflect on the database also 4)  The Eval method evaluates late-bound data expressions in the templates of data-bound controls such as the GridView, DetailsView, and FormView controls. At run time, the Eval method calls the Eval method of the DataBinder object, referencing the current data item of the naming container. The naming container is generally the smallest part of the data-bound control that contains a whole record, such as

SQL Connection Error 10053 : Event ID:17809 - Solution

Image
Error Message : A connection was successfully established with the server, but then an error occurred during the login process. (provider: TCP Provider, error: 0 - An established connection was aborted by the software in your host machine.) (Microsoft SQL Server, Error: 10053) For help, click: http://go.microsoft.com/fwlink?ProdName=Microsoft+SQL+Server&EvtSrc=MSSQLServer&EvtID=10053&LinkId=20476 Event Log : Could not connect because the maximum number of '2' user connections has already been reached. The system administrator can use sp_configure to increase the maximum value. The connection has been closed. For more information, see Help and Support Center at http://go.microsoft.com/fwlink/events.asp. First go to services and stop Service named SQL Server (MSSQLSERVER) Now Start both SQL Server (MSSQLSERVER) and SQL Server Agent (MSSQLSERVER) Now you can connect to your database Or you can increase the number of connections using sp_configure

Microsoft's Newly added Namespaces

Communications and Workflow System.ServiceModel.Syndication NEW Atom10FeedFormatter NEW Rss20FeedFormatter NEW SyndicationFeed NEW SyndicationItem NEW System.ServiceModel.Web NEW WebGetAttribute NEW WebInvokeAttribute NEW WebOperationContext NEW WebServiceHost NEW System.ServiceModel.Persistence NEW PersistenceProvider NEW PersistenceProviderFactory NEW SqlPersistenceProviderFactory NEW System.Net.PeerToPeer NEW Cloud NEW PeerName NEW PeerNameRecord NEW PeerNameResolver NEW System.Net.PeerToPeer.Collaboration NEW ContactManager NEW PeerApplication NEW PeerCollaboration NEW PeerContact NEW PeerNearMe NEW ------------------------------------------------------------------------------------ DATA, XML and LINQ System.Data.Linq NEW DataContext NEW EntityRef<T> NEW EntitySet<T> NEW Table<T> NEW System.Data.Linq.Mapping NEW AttributeMappingSource NEW Metamodel NEW XmlMappingSource NEW   System.Xml.Linq NEW XAttribute NEW XDocument NEW XElement NEW XName NEW XNamespac

Difference between an unsigned integer and signed integer (C Programming)?

Reserved word for integer is "int" in C programming, and reserved word for unsigned integer is "unsigned int". int has a range of -32768 - 32767 unsigned int has a range of 0 - 65535

Simple web application for System.Data.OracleClient

using System.Data; using System.Data.OracleClient; namespace { OracleWebConnectivity public partial class _Default : System.Web.UI. Page { { cmd.CommandType = protected void Page_Load( object sender, EventArgs e) OracleConnection conn = new OracleConnection ( "user id=xyz;password=****;data source=(DESCRIPTION =(ADDRESS = (PROTOCOL = TCP)(HOST = serverName)(PORT = portAdds))(CONNECT_DATA = (SID = hoststring)))" ); OracleCommand cmd = new OracleCommand ( "Select empname from emp1" , conn); CommandType .Text; //cmd.Parameters.AddWithValue("empname",empname); //cmd.Parameters.AddWithValue("empno",empno); conn.Open(); cmd.ExecuteNonQuery(); da.Fill(dt); OracleDataAdapter da = new OracleDataAdapter (cmd); DataTable dt = new DataTable (); foreach ( DataRow row in dt.Rows) //Console.WriteLine(row["empname"] + "; " + row["empno"]); // this row for Console application lbl1.Text = conn.C