Knowledge Transfer

Monday, October 29, 2007

Interview Question in i3-Soft Solutions, Hyderabad.

Process Of Interview:
Machine Test (GridView+Stored Procedure)
Technical Round
Interview Questions :

1)ViewState
2)GridView Operations
3)web.Config
4)what is dataset?
5)Class and Encapsulation
6)Aunthetication and authorization....
7) Session states
8) Delegate and evets

Happy Coding

Friday, October 26, 2007

Function Members,Output,Reference parameters,reference Type,Varible,storage Location in C#.Net

Function member :
A function member is a method, property, event, indexer, user-defined operator, instance constructor, static constructor, or destructor.

Output parameter :
A parameter very similar to a reference parameter, but with different definite assignment rules.
Reference parameter (pass-by-reference semantics) :

A parameter which shares the storage location of the variable used in the function member invocation. As they share the same storage location, they always have the same value (so changing the parameter value changes the invocation variable value).

Reference type :

Type where the value of a variable/expression of that type is a reference to an object rather than the object itself.

Storage location :
A portion of memory holding the value of a variable.

Value parameter (the default semantics, which are pass-by-value) :
A value parameter that has its own storage location, and thus its own value. The initial value is the value of the expression used in the function member invocation.

Value type :

Type where the value of a variable/expression of that type is the object data itself.

Variable :

Name associated with a storage location and type. (Usually a single variable is associated with a storage location. The exceptions are for reference and output parameters.)

Happy Programming,

Ref Site : http://www.developerfusion.co.uk/show/4697/4/

Using Output Parameters in Stored Procedures?

One way to retrieve scalar data in addition to a standard resultset from a stored procedure is to use one or more output parameters. An output parameter is a parameter that is passed into the SQL stored procedure, but whose value can be set in the stored procedure. This assigned parameter, then, is readable back from the application that called the stored procedure.
To use an output parameter you need to indicate that the parameter is intended for output via the OUTPUT keyword. The following snippet shows a stored procedure that returns the set of inventory items through a SELECT statement and uses an output parameter to return the average price:

CREATE PROCEDURE store_GetInventoryWithAveragePrice
(
@AveragePrice money OUTPUT
)
AS
SET @AveragePrice = (SELECT AVG(Price) FROM store_Inventory)
SELECT InventoryID, ProductName, Price, UnitsOnStock
FROM store_Inventory

To access the value of an output parameter from your ASP.NET application you need to create a parameter object whose Direction property is set to Output. After you call the stored procedure the output parameter's value is accessible through the Value property, as the

following code illustrates:
Dim myConnection as New SqlConnection(connection string)
myConnection.Open()
Dim myCommand as New SqlCommand("store_GetInventoryWithAveragePrice", myConnection)
myCommand.CommandType = CommandType.StoredProcedure
'Create a SqlParameter object to hold the output parameter value
Dim avgPriceParam as New SqlParameter("@AveragePrice", SqlDbType.Money)
'IMPORTANT - must set Direction as Output
avgPriceParam.Direction = ParameterDirection.Output
'Finally, add the parameter to the Command's Parameters collection
myCommand.Parameters.Add(avgPriceParam)

'Call the sproc...
Dim reader as SqlDataReader = myCommand.ExecuteReader()
'Now you can grab the output parameter's value...
Dim avgPrice as Decimal = Convert.ToDecimal(avgPriceParam.Value)

(The same issue regarding NULLs applies here as in the previous example...)
You are not limited to a single output parameter; additionally, you can have stored procedures with both input and output parameters.


Refered Site : http://aspnet.4guysfromrolla.com/articles/062905-1.aspx

Thursday, October 25, 2007

Useful website links For MicroSoft Technologies , SqlServer.....

1)Sample Example For asp.net
http://aspnet101.com/aspnet101/tutorials.aspx?id=47

2)
This is for ASP.Net,Windows Application Samples....

http://msdn.microsoft.com/vstudio/tour/vs2005_guided_tour/VS2005pro/Smart_Client/DisplayBusObjectData.htm

3) Assemblies in C#.Net (Private and Shared Assemblies) Links :

http://www.akadia.com/services/dotnet_assemblies.html

4) Input and OutPut parameters in Stored Procedure

http://www.eggheadcafe.com/PrintSearchContent.asp?LINKID=624

5)Object oriented Concets(Encapsulation,Abstraction,Class,Object,Inheritance,Early binding,Late Binding,Interface,Inheritance)
Object oriented Concets(Encapsulation,Abstraction,Class,Object,Inheritance,Early binding,Late Binding,Interface,Inheritance)


6)Creating Class File in Asp.Net 2.0 for Database Manipulations

This tutorial explains the programming with class file in Asp.Net 2.0 and explains the simplest way to do database manipulations through the class file. Class files are used to write business logic of the web applications and sometime used to manipulate database records also. The main advantage of a class file is code reusability and ease of code management


http://www.aspdotnetcodes.com/Creating_Class_File_Asp.Net.aspx


7) Creating javascript MENU's

http://dhtml.discoveryvip.com/


8) Good Interview Questions and Faq's in asp.net,sessions,C#.Net and sql server

http://www.akaas.net/dot-net-faqs/session-state.htm

9) ASP.Net Page Life Cycle.
Page_Init ,LoadViewState ,LoadPostData ,Page_Load ,RaisePostDataChangedEvent ,RaisePostBackEvent ,Page_PreRender ,SaveViewState ,Page_Render ,Page_UnLoad

ASP.Net Page Life Cycle


Happy Coding

Wednesday, October 24, 2007

Inserting Data Into Two Tables in sql server Stored Procedures

CREATE PROCEDURE procInsSamples
@CategoryID int,
@Title varchar(100),
@Description text,
@Link varchar(150),
@Whatever
AS
Begin
Set NoCount on
DECLARE @WhateverID INT
Insert Table1(Title,Description,Link,Whatever)
Values
(@title,@description,@link,@Whatever)

Select @WhateverID=@@Identity

Insert into Table2
(CategoryID,WhateverID)
Values
(@CategoryID,@WhateverID)
End

this Data will Get from http://aspnet101.com/aspnet101/tutorials.aspx?id=13