Tuesday, October 25, 2005

Useful Suff

What is the use of the Web.config????
How to consume the web.config????
Database connection.
Authentication.
Role based authentication.

If web application doesn't have the web.config for that
particular application,IS it run??
Yes... It wil take from Machine.config.

What about httphandlers???
Diff b/w DataReader and DataAdaptor???
Diff b/w functions and Storedprocedure??

Encapsulation Example

Project Architecture

what about Sealed Class?

How to set the properties in C#??

How to access the properties in C#?

How to create the Shared Assembly ?

What about Assemblyinfo.cs?

Types of Triggers?

CLR Architecture ?

Delegates??? Real Example for Delegates

What is strong Name?

How many non cluster index available in SQL server?

Noncluster index -- 249
Cluster Index -- Only one

What is the Diff b/w Unique and Primary ??

How to create Cluster and Non Cluster index?

How to get the WEbservice through website?

Why we need web service??

How to access the nodes in XML??

What are all the classes used for Data Conncetivity??

I want to prevent the object access to particular class How to acheive it??

What is the main functionality of JIT Compiler??

What is unsafe code ?? Is it managed code or unmanaged code??

What about Boxing and Unboxing ??? Is there any special key word for that??

Diff b/w Protected and Protected Internal

Thursday, October 20, 2005

Monday, October 17, 2005

Array in Javascript


function Product(_headerName, _paramName) {
this.headerName = _headerName;
this.paramName = _paramName;
}


function pop()
{
var arrProduct = new Array();
arrProduct[0] = new Product("Product", "ProductFKID");
arrProduct[1] = new Product("Opening Stock", "OpeningStock");
arrProduct[2] = new Product("Stock Received", "StockReceived");
arrProduct[3] = new Product("Secondary Sale", "SecondarySale");
arrProduct[4] = new Product("Closing Stock", "ClosingStock");
arrProduct[5] = new Product("Stock in Transit", "StockinTransit");
arrProduct[6] = new Product("Damaged Stock", "DamagedStock");

for(var i = 0 ; i < arrProduct.length; i++)
{
alert(arrProduct[i].headerName +'-'+arrProduct[i].paramName);
}

}

Friday, October 14, 2005

Boxing and Unboxing



int i = 5;

object o = i; // Boxing Value ---> Reference (Implicit)

int j = (int)o; // UnBoxing Reference ---> value (Explicit)

MessageBox.Show(j.ToString());

Get the Schema Table

Get the Table's Column information using this code.Schema Table contains all the information about the Table's Column...........



using System;
using System.Data;
using System.Data.SqlClient;

namespace GetSchemaInfo
{
public class TableSchmea
{
string hi;
public string FindMaxLength(string tablename,string fieldname)
{
SqlConnection Conn = new SqlConnection("server=210.210.99.104;database=IndageLive;uid=shaw;pwd=shaw;");
SqlCommand Cmd = new SqlCommand("Select * from "+tablename,Conn);
Conn.Open();
SqlDataReader dr = Cmd.ExecuteReader();

DataTable SchemaTable = dr.GetSchemaTable();
foreach(DataRow drow in SchemaTable.Rows)
{
foreach(DataColumn dcol in SchemaTable.Columns)
{
if(dcol.ColumnName == "ColumnName" && drow[dcol].ToString()== fieldname)
{
hi = dcol.ColumnName +" = "+ drow[dcol] +" "+ "ColumnSize " + "=" + drow["ColumnSize"] ;

}
}
}
//Console.ReadLine();
dr.Close();
Conn.Close();
return hi;
}
}
}

Saturday, October 01, 2005

Dynamic XSLT


<root>

<Table Caption="Name" Field="Name"/>
<Table Caption="Age" Field="Age"/>
<Table Caption="Roll" Field="RollNo"/>

<row PKID="1" Name="sankar" Age="25" />
<row PKID="2" Name="Dinesh" Age="12" />
<row PKID="3" Name="ramu" Age="35" />
<row PKID="4" Name="ramesh" Age="30" />
<row PKID="5" Name="Ambrish" Age="30"/>

</root>






<xsl:stylesheet
version="2.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">

<xsl:template match="/">
<table border="1" width="80%">
<tr>
<xsl:for-each select="//@Caption">
<td><b><xsl:value-of select="."/></b></td>
</xsl:for-each>
</tr>
<xsl:apply-templates select="root/row"/>
</table>
</xsl:template>



<xsl:template match="row">
<xsl:variable name="node" select="."/>
<tr>
<xsl:for-each select="//@Field">
<xsl:variable name="temp" select="."/>
<td>
<xsl:value-of select="$node/@*[name()=$temp]/."/>
</td>
</xsl:for-each>
</tr>
</xsl:template>
</xsl:stylesheet>