MS SQL: import records and maintain Identity records


set identity_insert [target_table] on

 Insert into target_table (column1, column2, column3)
 select (column1, column2, column3) from source_table

set identity_insert [target_table] off




.NET Disable Server Button when processing

Somtimes after a server button is clicked,you want to disable this server button when process is running, to stop user clicking it again;

add below code (VB)  in page_load event:   for example, your button is called “btnSend”. This works for IE /FF.

btnSend.Attributes.Add(“onclick”, “this.disabled=true;this.value=’Sending…’; ” & ClientScript.GetPostBackEventReference(btnSend, Nothing) & “;”)


This works for IE /FF.