15 January 2011

Asp.net Update Panel

Cool thing about the ASP.NET Ajax UpdatePanel is that its contents are updated asynchronously when an event that would normally generate a postback is raised.

UpdatePanel have two important properties
1.UpdateMode 2.ChildrenAsTrigger

1.UpdateMode
Has 2 possible values:

*Always(Default one)
 When set to Always, the UpdatePanel is updated on every postback(both full and partial) raised from anywhere in the page(may be from controls inside the panel, inside other panels  or just on the page).
*Conditional
 When set to Conditional, the UpdatePanel will be updated only on 
-->postback originated by controls inside the same panel
-->from the triggers specified 
-->when the parent get updated in case of nested update panels.

2.ChildrenAsTrgger

*Applicable only when UpdateMode is conditional.
*Attempting to do so without  UpdateMode is set  conditional  results in an InvalidOperationException being thrown by the ScriptManager during the page’s PreRender event.
*Possible values
 -->true  - Update Panel will be updated when the postback is
                generated by the controls inside the same panel.(Its the default one)
 -->false - Update Panel will not be updated when the postback is generated
                by the controls inside the same panel unless it is specified in             
                trigger, or Parent update panel is not getting updated

03 January 2011

Bulk insert From CSV file using Sql

BULK
INSERT 
CSVTest
FROM 'c:\csvtest.txt'
WITH
(
      FIELDTERMINATOR ',',
      ROWTERMINATOR '\n'
)

02 January 2011

Truncate Vs Delete

TRUNCATE

1. It is DDL Statement.
2. Faster in performance wise, because it doesn't keep any logs
3. Resets the Identity Column
4. Roll Back is not possible.
5. Can not use where clause
6. This operation will cause all DELETE triggers on the table to fire.


DELETE


1. It is a DML Statement
2. Slower than truncate because, it keeps logs
3. Delete retains the identity counter means it will not reset.
4. We can rollback .
5. User Where Clause
6. no triggers will be fired

Things are upgraded

My Dear readers, I am really thankful for being supportive all these years. This site was the first blog site I ever created in my life...