Posts

jQuery date picker

<style type="text/css">    .datepick {     background-color: #fff;     color: #222;     border: 1px solid #c4c4c4;     font-family: Arial,Helvetica,Sans-serif;     font-size: 90%; } .datepick-rtl {     direction: rtl; } .datepick-popup {     z-index: 1000; } .datepick-disable {     position: absolute;     z-index: 100;     background-color: white;     opacity: 0.5; } .datepick a {     color: #222;     text-decoration: none; } .datepick a.datepick-disabled {     color: #888;     cursor: auto; } .datepick button {     margin: 0.25em;     padding: 0.125em 0em;     background-color: #fcc;     border: none;     border-radius: 0.25em;     -moz-border-radius: 0.25em; ...

Triggers

A trigger is a special kind of stored procedure that automatically executes when an event occurs in the database server. DML triggers execute when a user tries to modify data through a data manipulation language (DML) event. DML events are INSERT, UPDATE, or DELETE statements on a table or view. These triggers fire when any valid event is fired, regardless of whether or not any table rows are affected. CREATE TRIGGER trgInsert ON [dbo].[Employee_Test] FOR INSERT AS declare @empid int; declare @empname varchar ( 100 ); declare @empsal decimal ( 10 , 2 ); declare @audit_action varchar ( 100 ); select @empid=i.Emp_ID from inserted i; select @empname=i.Emp_Name from inserted i; select @empsal=i.Emp_Sal from inserted i; set @audit_action= ' Inserted Record -- After Insert Trigger.' ; insert into Employee_Test_Audit (Emp_ID,Emp_Name,Emp_Sal,Audit_Action,Audit_Timestamp) values (@empid,@empname,@empsal,@audit_action,getdate()); P...

Difference Between Truncate and Delete

DELETE 1. DELETE is a DML Command. 2. DELETE statement is executed using a row lock, each row in the table is locked for deletion. 3. We can specify filters in where clause 4. It deletes specified data if where condition exists. 5. Delete activates a trigger because the operation are logged individually. 6. Slower than truncate because, it keeps logs. 7. Rollback is possible. TRUNCATE 1. TRUNCATE is a DDL command. 2. TRUNCATE TABLE always locks the table and page but not each row. 3. Cannot use Where Condition. 4. It Removes all the data. 5. TRUNCATE TABLE cannot activate a trigger because the operation does not log individual row deletions. 6. Faster in performance wise, because it doesn't keep any logs. 7. Rollback is not possible. DELETE and TRUNCATE both can be rolled back when used with TRANSACTION. If Transaction is done, means COMMITED, then we can not rollback TRUNCATE command, but we can still rollback DELETE command from LOG files, as DELETE write re...

Difference between Byte and Char in Oracle

If you define the field as VARCHAR2(11 BYTE), Oracle will allocate 11 bytes for storage, but you may not actually be able to store 11 characters in the field, because some of them take more than one byte to store, e.g. non-English characters. By defining the field as VARCHAR2(11 CHAR) you tell Oracle to allocate enough space to store 11 characters, no matter how many bytes it takes to store each one. I believe that in Oracle 10g, 3 bytes per character were used.

DATA TABLE BIND WITH GRIDVIEW

                                                  DATA TABLE BIND WITH GRIDVIEW DataTable TempTable = new DataTable();         TempTable.Columns.Add("Business_Place");         TempTable.Columns.Add("Within_State");         TempTable.Columns.Add("Outside_State");                DataRow dtrow;         dtrow = TempTable.NewRow();         dtrow["Business_Place"] = "Factories";         dtrow["Within_State"] = list[0].FACTORY_IN.ToString();      ...

Dictionary used for key value pair

       var dicQuarter = new Dictionary<List<Dealer>, int >();         dicQuarter.Add("-Select-", 0);             dicQuarter.Add("Quarter-I", 1);             dicQuarter.Add("Quarter-II", 2);             dicQuarter.Add("Quarter-III", 3);             dicQuarter.Add("Quarter-IV", 4);                                     ddlAuthorisedFullName.DataSource = dicQuarter;                     ddlAuthorisedFullName.DataTextField = "FULLNAME";    ...

How to Open PopUp Window

write this script on that aspx page from which the page is redirect to popup window   <script type="text/javascript">     function popup(url,width,height) {     var left = (screen.width - width) / 2;     var top = (screen.height - height) / 2;     var params = 'width=' + width + ', height=' + height;     params += ', top=' + top + ', left=' + left;     params += ', toolbar=no';     params += ', menubar=no';     params += ', resizable=yes';     params += ', directories=no';     params += ', scrollbars=yes';     params += ', status=no';     params += ', location=no';     newwin = window.open(url, 'd', params);     if (window.focus)     {         newwin.focus()     }     return false;  ...