Thursday, November 27, 2008

Copy Database to another database in Sql server 2000

Copy all tables/structures,views,functions,stored procedures..etc
Using DTS Import/Export wizard.

Wednesday, November 26, 2008

Cheat Sheets

.NET Format String Quick Reference
http://john-sheehan.com/blog/wp-content/uploads/msnet-formatting-strings.pdf

ASP.NET 2.0 Page Life Cycle & Common Events
http://john-sheehan.com/blog/wp-content/uploads/aspnet-life-cycles-events.pdf

Visual Studio 2005 Built-in Code Snippets (C#)
http://john-sheehan.com/blog/wp-content/uploads/vs2005-code-snippets.pdf

Asp.net Runtime cheat sheet
http://duartes.org/gustavo/articles/Asp.net-Runtime-Cheat-Sheet-HttpRequest-HttpRuntime.aspx

.Net Cheat sheets
http://john-sheehan.com/blog/index.php/net-cheat-sheets/

C# & Vb comparison sheet
http://aspalliance.com/625

CSS sheet
http://www.addedbytes.com/cheat-sheets/css-cheat-sheet/

Javascript sheet
http://www.addedbytes.com/download/javascript-cheat-sheet-v1/png/

RGB Hex Colour Chart
http://www.addedbytes.com/cheat-sheets/colour-chart/

HTML Character Entities Cheat Sheet
http://www.addedbytes.com/cheat-sheets/html-character-entities-cheat-sheet/

LINQ Cheat sheet
http://weblogs.asp.net/bradvincent/archive/2008/11/01/linq-cheat-sheet.aspx

VC# 2005 sheet
http://download.microsoft.com/download/e/7/9/e79cce22-b196-4b9f-9ea7-b1a21f5342e9/VCSharp_2005_color.pdf

Asp/Vbscript sheet
http://www.addedbytes.com/cheat-sheets/asp-vbscript-cheat-sheet/

Backup sql server 2000 database in BAK

Using Backup Database Wizard
============================
http://articles.techrepublic.com.com/5100-10878_11-1043671.html
http://www.hostmysite.com/support/sql/backup2000/
http://www.dbarecovery.com/completebkup.html

Using Database Maintenance Plan Wizard
======================================
http://www.databasedesign-resource.com/sql-server-maintenance-plan.html
http://www.databasejournal.com/features/mssql/article.php/3530486/Working-with-the-SQL-Server-2000-Maintenance-Plan-Wizard.htm
http://www.mssqltips.com/tip.asp?tip=1016

Monday, November 10, 2008

How do i set Authentication - Windows Server 2003

I have website configured on windows 2003 server. I will be accessing the site by
typing http://machinename/sitename, here authentication screen comes but I don't need this authentication screen. These are the steps I gave:

Go to Internet Information services, point to your virtual folder. Go to Property page. Click on authentication tab and in the edit mode change the authentication mode to "Anonymous" and give userid and password. Then you will not be asked for authentication.

Friday, October 31, 2008

Complete Example for Error Handlers

http://msdn.microsoft.com/en-us/library/bb397417.aspx

Wednesday, October 8, 2008

Constructors- private vs static

http://www.codeproject.com/KB/dotnet/ConstructorsInCSharp.aspx
http://aspalliance.com/770_Constructors_in_C

Wednesday, October 1, 2008

Value type vs Reference types

http://en.csharp-online.net/Value_vs_Reference

Monday, September 29, 2008

System.Web.UI.Statebag class

Manages the view state of ASP.NET server controls, including pages. This class cannot be inherited.

http://authors.aspalliance.com/aspxtreme/sys/web/ui/StateBagClass.aspx

Monday, September 22, 2008

Client Callback

This feature allows you to programmatically call server-side methods through client-side JavaScript code without the need for posting back the page.

Types of Assembly

Private Assembly: This type of assembly is used by a single application. It is stored in the application's directory or the applications sub-directory. There is no version
constraint in a private assembly.

Shared or Public Assemlby: A shared assembly has version constraint. It is stored in the Global Assembly Cache (GAC). GAC is a repository of shared assemblies maintained by the .NET runtime. It is located at C:\Windows\Assembly OR C:\Winnt\Assembly. The shared assemblies may be used by many applications. To make an assembly a shared assembly, it has to be strongly named. In order to share an assembly with many applications, it must have a strong name.

Tuesday, September 16, 2008

Connection Pooling

Connection pooling being normally used in web-based and enterprise applications is usually handled by an application server. Any dynamic web page can be coded to open a connection and close it normally but behind the scenes when a new connection is requested, one is returned from the connection pool maintained by the application server. Similarly, when a connection is closed it is actually returned to the connection pool. Connection pooling was first introduced in Microsoft Internet Information Server 3,[citation needed] the idea was soon after incorporated into other software vendors web server products.

http://www.15seconds.com/issue/040830.htm
http://www.ondotnet.com/pub/a/dotnet/2004/02/09/connpool.html

Monday, September 15, 2008

GC.SuppressFinalize()

Requests that the system not call the finalizer for the specified object.

Web Services ( WSDL, SOAP & UDDI)

http://www.w3schools.com/webservices/default.asp

Wednesday, September 10, 2008

Finalize vs Dispose

Finalize :
1.Finalize() is called by the runtime
2.Is a destructor, called by Garbage Collector when the object goes out of scope.
3.Implement it when you have unmanaged resources in your code, and want to make sure that these resources are freed when the Garbage collection happens.

Dispose :
1.Dispose() is called by the user
2.Same purpose as finalize, to free unmanaged resources. However, implement this when you are writing a custom class, that will be used by other users.
3.Overriding Dispose() provides a way for the user code to free the unmanaged objects in your custom class.

http://msdn.microsoft.com/en-us/library/fs2xkftw.aspx
http://www.devx.com/dotnet/Article/33167/0/page/1

Saturday, September 6, 2008

Class Modifiers

abstract: An instance of the class cannot be created.Usually this means the class is intended to serve as a base class.

sealed: The class cannot serve as a base class for another class (it can't be derived from). A class cannot be both abstract and sealed.

internal: The class is only accessible from other classes in the same assembly. This is the default access for non-nested types. If no modifier is specified, the class has internal access.

new: Used only with nested classes. "New" indicates that the class hides an inherited member of the same name.

private: A nested class that can only be accessed inside the class in which it is defined.

public: Instances of this class are available to any class that wants to access it.

Serialisation vs De-Serialisation

Serialization is the process of saving the state of an object in a persistent storage media by converting the object to a linear stream of bytes.

The reverse process of serialization is known as de-serialization and enables us to re-construct the object from the previously serialized instance of the same in the persistent or non-persistent storage media.

Globalisation vs Localisation

Globalization is the process of designing and developing applications that function for multiple cultures.

Localization is the process of customizing your application for a given culture and locale.

Round trip vs Postback

Round trip means the form goes to the server and take the
response from the server and it may redirect to the other
form or same form according to the request
where as Postback means the form goes to the server and
loads the same page

Thursday, September 4, 2008

Web Farm Vs Web Garden

A Web farm allows you to expand a Web Site across multiple servers.

A Web garden allows you to expand a Web Site across multiple CPUs within a single server.

Assembly - Metadata - Manifest

An assembly is a file that is automatically generated by the compiler upon successful compilation of every .NET application

Metadata is the complete way of describing what is in a .NET assembly. Digging into the metadata yields the types available in that assembly, viz. classes, interfaces, enums, structs, etc., and their containing namespaces, the name of each type, its visibility/scope, its base class, the interfaces it implemented, its methods and their scope, and each method’s parameters, type’s properties, and so on

Metadata describes the contents in an assembly, whereas the manifest describes the assembly itself. The manifest contains the assembly name, version number, locale and an optional strong name that uniquely identifying the assembly. This manifest information is used by the CLR.

CLS and CTS

The Common Type System (CTS) defines how types are declared, used, and managed in the runtime, and is also an important part of the runtime's support for cross-language integration.

CTS Provides the data types, values, object types. This helps developers to develop applications in different languages, where .NET languages share CTS means all the types used in applications share the same types defined under CLI.

Common Language Specification (CLS) defines a subset of Common Type System, which all language compilers targeting CLR must adhere to. CLS is a subset of CTS.


http://aspalliance.com/1530_Understanding_Common_Type_System_in_NET.all

Triggers & its types

A trigger is a database object that is bind to a table. In many aspects it is similar to a stored procedure and are often referred to as a "special kind of stored procedure".

After Trigger - For insert, For update, For delete
Multiple After Triggers
Instead Of Triggers
Mixing Triggers Type

Sunday, August 31, 2008

Display Specific Block while printing

link href="styles/PrintStyle.css" rel="stylesheet" type="text/css" media="print"

Server.Transfer vs Response.Redirect vs Server.Execute

Server.Transfer conserves server resources. Instead of telling the browser to redirect, it simply changes the "focus" on the Web server and transfers the request. And it can be used to transfer to the page which is in the same site or webserver.

Server.Execute inserts the form output in the current form.

Response.Redirect is also used to redirect the page to some other webserver whereas server.transfer won't do this. when the statement Response.Redirect() is executed, the current page is immediately unloaded and the identified page is loaded.

RegisterStartupScript vs RegisterClientScriptBlock

Both of them emits a client-side script block in the page response.

Page.RegisterStartupScript - puts script before the end of Form tag whereas
Page.RegisterClientScriptBlock - puts script after the beginning of Form tag.

Friday, August 22, 2008

URL Rewriting

http://msdn.microsoft.com/en-us/library/ms972974.aspx
http://ruslany.net/2009/04/10-url-rewriting-tips-and-tricks/

Thursday, August 21, 2008

HttpHandler & HttpModule

HTTP modules differ from HTTP handlers. HTTP modules are called for all requests and responses, whereas HTTP handlers run only in response to specific requests

http://www.codeproject.com/KB/aspnet/http-module-ip-security.aspx
http://www.davidhayden.com/blog/dave/archive/2007/09/24/CreateHttpModulesASPNETPluggableFunctionality.aspx

http://www.worldofasp.net/tut/HttpHandlers/Using_HttpHandlers_and_HttpModules_in_your_ASPNET_Websites_90.aspx

Wednesday, August 20, 2008

.Net Technical

http://www.codeproject.com/KB/dotnet/dotnetinterviews.aspx
http://www.dotnetuncle.com/Framework/33_CLI_CTS_Metadata_CLS_IL_VES.aspx
http://www.dotnetcurry.com/ShowArticle.aspx?ID=70
http://www.careerride.com/ASP-NET-Life-Cycle.aspx
http://www.go4expert.com/forums/showthread.php?t=3158

Download Larger File in Chunks

code is available in
http://support.microsoft.com/kb/812406/
http://www.gridviewguy.com/ArticleDetails.aspx?articleID=196

Tuesday, August 19, 2008

Datagrid vs Datalist vs Repeater

http://aspnet.4guysfromrolla.com/articles/052103-1.aspx

asp.dll, aspnet_isapi.dll and aspnet_wp.exe

For example, a Web site that serves up classic ASP pages has the .asp extension mapped to the asp.dll ISAPI extension. The asp.dll ISAPI extension executes the requested ASP page and returns its generated HTML markup.

When an ASP.NET request is received (usually a file with .aspx extension),the ISAPI filter aspnet_isapi.dll takes care of it by passing the request to the actual worker process aspnet_wp.exe.

http://www.codersource.net/aspnet_compilation_execution.html
http://aspnet.4guysfromrolla.com/articles/020404-1.aspx
http://www.eggheadcafe.com/community/aspnet/17/10040175/check-this-to-download-la.aspx

Protecting(Securing) Files with ASP.NET (using HttpHandler)

http://aspnet.4guysfromrolla.com/articles/020404-1.aspx
http://msdn.microsoft.com/en-us/library/f3ff8w4a(VS.71).aspx
http://www.gridviewguy.com/ArticleDetails.aspx?articleID=196 (downloads small chunks of large file)

Monday, August 18, 2008

ViewState Vs Data Caching

http://www.codersource.net/asp_net_viewstate_versus_data_caching.aspx

Data Caching is the keeping of frequently used data in memory(RAM) for ready access by your ASP.NET. (Mostly used with frequent database access of huge number of records while paging)

Whereas Viewstate stores the page's controls data in hidden field in the page itself. ViewState also provides a StateBag, which is a special collection or dictionary, for each page that you can use to store any object or value, associated with a key, to retain across PostBacks. ViewState is by default serialized and passed across page PostBacks as a hidden form field, __VIEWSTATE, that is Base64 encoded so that it is not easily readable, but not encrypted.

Cache ASP.NET pages

To store the output cache for a specified duration

Declarative Approach:

<%@ OutputCache Duration="60" VaryByParam="None" %>


Programmatic Approach:

Response.Cache.SetExpires(DateTime.Now.AddSeconds(60));
Response.Cache.SetCacheability(HttpCacheability.Public);


For more...http://support.microsoft.com/kb/323290

Wednesday, July 2, 2008

Javascript Calender

http://www.mattkruse.com/javascript/calendarpopup/
http://www.javascriptkit.com/script/script2/tengcalendar.shtml

Friday, April 25, 2008

Tuesday, April 22, 2008

Sql Server 2000 & DTS

http://www.devarticles.com/c/a/ASP/Creating-DTS-Packages-With-SQL-Server-2000/
http://www.quackit.com/sql_server/tutorial/sql_server_dts.cfm

Saturday, March 29, 2008

Adding Code-Behind to Custom Pages in SharePoint 2007

http://farhanfaiz.wordpress.com/2008/01/
http://blogs.vertigo.com/personal/willa/Blog/Lists/Posts/Post.aspx?ID=4

Thursday, March 27, 2008

Auto-refreshing ASP.NET web pages

This can be done in either of 2  ways:

1. HTML header refresh tag

The most common and best known way - a tag of the following format is placed in the HEAD section (of  HTML section) of the page:

< meta equiv="refresh" content="8;url=some.aspx" >

2. Response.AppendHeader method

Response.AppendHeader("Refresh","1200;URL=default.aspx");


Reference: http://geekswithblogs.net/willemf/archive/2005/10/30/58563.aspx

Wednesday, February 20, 2008

Tab Control functionality in Html

http://www.thesug.org/blogs/kyles/Lists/Posts/Post.aspx?List=89c8858b%2D90d2%2D4750%2Da11a%2De599248e6c69&ID=8

Tuesday, February 19, 2008

Datagrid( with database retrieval ) as webpart sharepoint

I. Reference link
http://www.devx.com/dotnet/Article/26732/1954,
there u can download zip file and in that GetDataChildControl.cs
is taken and modified as follows

1. Use the STSDEV tool to creat a project.
2. Open the customwebpart1.cs and modify the page to look as follows:

using System.Data;
using System.Data.SqlClient;
using System.Xml.Serialization;
using Microsoft.SharePoint;
using Microsoft.SharePoint.Utilities;
using Microsoft.SharePoint.WebPartPages;
using System.ComponentModel;

namespace DbGridWebPart
{
[DefaultProperty("Text"),
ToolboxData("<{0}:GetData runat=server>"),
XmlRoot(Namespace = "WebParts")]
public class CustomWebPart1 : WebPart
{
private const string defaultConnection = "Server=server;database=pubs;Integrated Security=false;User Id=sa;Password=";

private string connectionString = defaultConnection;

[Browsable(true),
Category("Data"),
DefaultValue(defaultConnection),
WebPartStorage(Storage.Shared),
FriendlyName("Connection String"),
Description("Connection String")]
public string ConnectionString
{
get
{
return connectionString;
}

set
{
connectionString = value;
}
}

private const string defaultSQL = "SELECT TOP 2 au_lname, au_fname FROM Authors";
private string sqlString = defaultSQL;

[Browsable(true),
Category("Data"),
DefaultValue(defaultSQL),
WebPartStorage(Storage.Shared),
FriendlyName("SQL Command"),
Description("The SQL command, or stored procedure to execute")]
public string SQLString
{
get
{
return sqlString;
}
set
{
sqlString = value;
}
}
///
/// Constructor for GetDataChildControl
///

public CustomWebPart1()
{
try
{
}
catch (Exception excpt)
{
Label lbl = new Label();
lbl.Text = "An error occured : " + excpt.ToString();
Controls.Add(lbl);
}
}
private bool bDGAdded = false;
///
/// Render this Web Part to the output parameter specified.
///

/// The HTML writer to write out to
protected override void RenderWebPart(HtmlTextWriter output)
{
// If the data grid has not been added
if (!bDGAdded) AddDG();

base.RenderWebPart(output);
}

protected void AddDG()
{
System.Data.SqlClient.SqlConnection mySQLConnect = new SqlConnection(connectionString);

mySQLConnect.Open();

SqlCommand myCmd = new SqlCommand(sqlString, mySQLConnect);

System.Data.SqlClient.SqlDataAdapter myAdapter = new SqlDataAdapter(myCmd);
DataSet ds = new DataSet();

myAdapter.Fill(ds, "Test");

DataGrid dg = new DataGrid();
dg.DataSource = ds.Tables[0];
dg.DataBind();
Controls.Add(dg);
bDGAdded = true;
}
}
}


3. Then the rest are same as deployment to the server.

4. And if u want to change the query or server settings in sharepoint site, click the modify shared web part on the webpart menu and then point to Data setttings, there u can change those settings.



  

Wednesday, February 13, 2008

Creating Templates for sharepoint sites using Sharepoint solution Generator tool

References


1.  http://weblogs.asp.net/soever/archive/2006/11/11/SharePoint-Solution-Generator-_2D00_-part-1_3A00_-create-a-site-definition-from-an-existing-site.aspx


2. http://www.microsoft.com/downloads/details.aspx?FamilyId=C1039E13-94DA-4D7D-8CAE-3B96FA5A4045&displaylang=en

Creating and Deploying Webparts to Sharepoint site using STSDEV tool

1.  Download stsdev tool from the Net.
   (do it in your system)
2.  Open Visual Studio 2005,  point to Tools menu, and then External Tools... 
      and add name of the tool  as stsdev and in the next tab, locate the stsdev.exe file and click ok.
3. Now click on the Tools->stsdev
4.  Give Solution Name, then select parent directory for ex, f:\framework\examples, and in the next 
     tab such as signing key, f:\framework\examples\sn.snk and select the solution type as web part      solution(C# Assembly) and click the create solution button.
5. Open the Project .sln file and all the files will be created by default. Open Customwebpart1.cs and Customwebpart2.cs and change the codings whatever the control you need to add.

(do it in sharepoint server)
6. Upload project to sharepoint server and open the .sln file. select debugbuild and click build, then
    debugdeploy and click build.
7. Now open a new site and point to site actions -> site settings page.
8. Under Galleries section, click webpart  and then click new, select the newly added webparts and upload it. so that new webparts is displayed.
9. Now you create a blank web part page and click on it. you are willing to add the newly added webpart


Reference Links:

Tuesday, January 22, 2008

Working with Files,Directories asp.net 2.0

http://aspalliance.com/920_Working_with_Files_and_Directories_using_ASPNET.all
http://www.csharpfriends.com/Articles/getArticle.aspx?articleID=35

Saturday, January 19, 2008

Creating Webpart on Asp.Net 2.0 and Sharepoint

I. Steps

1. First Create a class library from asp.net 2.0

2. Modify assemblyInfo.cs under Properties by adding
[assembly: System.Security.AllowPartiallyTrustedCallers()]

3. rename the class from class1.cs to arunclass.cs. And then

namespace arunclasslibrary
{
public class ArunClass : using System.Web.UI.WebControls.WebParts.WebPart
{
private string dispString = "Arun's Site";

[WebBrowsable(true),Personalizable(true)]
public string DispString
{
set { dispString = value; }
get { return dispString; }
}

protected override void Render(System.Web.UI.HtmlTextWriter writer)
{
writer.Write(DispString);
}
}
}

4. click project properties and click signing tab, then select strong name ( with no password).

5. Build solution. And take the dll file and put into remote sharepoint site location such as
c:\inetpub\wwwroot\wss\virtualdirectories\anynumber\bin\arunclasslibrary.dll
and modify the web.config for adding safecontrol .

6. And then the rest are available in http://msdn2.microsoft.com/en-us/office/bb153523.aspx


II. http://www.c-sharpcorner.com/UploadFile/sarav82/webpartlifecycle01102008061313AM/webpartlifecycle.aspx

III. http://roddotnet.blogspot.com/2007/08/how-to-create-site-programmatically-in.html

IV. http://sorceresspy.wordpress.com/2008/03/29/wss-30-getting-started-site-provisioning/

Friday, January 18, 2008

S/W & Movies Downloads

http://www.phazeddl.com/
http://tamiltorrent.com/

Friday, January 11, 2008

Useful Html Controls

http://www.sitepoint.com/article/asp-web-forms-web-controls

Datagrid Paging

http://msdn2.microsoft.com/en-us/library/ms979197.aspx

Import Excel to DataTable

http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=911149&SiteID=1
http://support.microsoft.com/kb/815142/en-us
http://msdn2.microsoft.com/en-us/library/ms178685.aspx
http://support.microsoft.com/kb/306572/
http://samples.gotdotnet.com/quickstart/aspplus/doc/configformat.aspx
http://support.microsoft.com/kb/316675/en-us http://msdn.microsoft.com/library/default.asp?url=/library/en-

Master Page in 2.0

http://www.odetocode.com/Articles/450.aspx

Creating Controls Dynamically

http://www.singingeels.com/Articles/Dynamically_Created_Controls

N-Tier Web Applications using ASP.NET 2.0 and SQL Server 2005

http://www.15seconds.com/issue/050721.htm (part 1)
http://www.15seconds.com/issue/050728.htm (part 2)

Introducing .Net Generics

http://www.15seconds.com/issue/031024.htm

Asp.Net Ajax Dropdownlist

http://www.simple-talk.com/dotnet/asp.net/enhance-your-website-with-asp.net-ajax-extensions/
http://aspalliance.com/1054_Updating_a_Secondary_Data_Source_in_InfoPath_Using_AJAX
http://www.codeproject.com/aspnet/ajaxdropdownlist.asp

Asp.Net 3.5 Links

Gridview Edit,Delete,Update, Paging, Sorting using DLINQ
http://www.123aspx.com/redir.aspx?res=36538

Asp.net architecture

http://www.novicksoftware.com/coding-in-sql/Vol3/cis-v3-N13-dot-net-clr-in-sql-server.htm

JIT COMPILER -

http://www.dotnetspider.com/kb/Article2314.aspx

String.Format

string.Format("{0:##0.0}", (dblVal / ((dblTot == 0.0) ? 1 : dblTot)) * 100) + "%
" +String.Format("{0:0,0}", dblVal);
Composite formatting: http://msdn2.microsoft.com/en-us/library/txafckwd.aspx
Numbers, standard: http://msdn2.microsoft.com/en-us/library/dwhawy9k.aspx
Numbers, custom: http://msdn2.microsoft.com/en-us/library/0c899ak8.aspx
Datetime, standard: http://msdn2.microsoft.com/en-us/library/az4se3k1.aspx
Datetime, custom: http://msdn2.microsoft.com/en-us/library/8kb3ddd4.aspx http://msdn.microsoft.com/msdnmag/issues/06/01/ExtremeASPNET/def

MCP Exam Code

http://www.microsoft.com/learning/mcpexams/prepare/examresul

Asp.Net Ajax Dropdownlist

http://www.simple-talk.com/dotnet/asp.net/enhance-your-website-with-asp.net-ajax-extensions/
http://aspalliance.com/1054_Updating_a_Secondary_Data_Source_in_InfoPath_Using_AJAX
http://www.codeproject.com/aspnet/ajaxdropdownlist.asp

Animation Images

www.ajaxload.info

XML Links

http://www.xmlfiles.com/xsl/xsl_intro.asp
http://web.snowseed.com/intro_xml.htm
http://download-east.oracle.com/docs/cd/B19306_01/appdev.102/b14259/xdb03usg.htm#BABEHIJG
http://download-east.oracle.com/docs/cd/B19306_01/appdev.102/b14259/xdb04cre.htm#sthref511
http://www.orafaq.com/faqxml.htm
http://download-west.oracle.com/docs/cd/B19306_01/appdev.10

Favourite Icons

for displaying icon in the title of IE

http://www.chami.com/html-kit/services/favicon/