Wednesday, January 27, 2010

Benefits of Stored Procedure

Benefits of Stored Procedures
Why should you use stored procedures?
Let's take a look at the key benefits of this technology:
Precompiled execution. SQL Server compiles each stored procedure once and then reutilizes the execution plan. This results in tremendous performance boosts when stored procedures are called repeatedly.
Reduced client/server traffic. If network bandwidth is a concern in your environment, you'll be happy to learn that stored procedures can reduce long
SQL queries to a single line that is transmitted over the wire.
Efficient reuse of code and programming abstraction.

Stored procedures can be used by multiple users and client programs. If you utilize them in a planned manner, you'll find the development cycle takes less time.
Enhanced security controls. You can grant users permission to execute a stored procedure independently of underlying
table permissions.

Delloite interview questions .net

Difference between datareader and Dataset
Difference between ADO.net and ADO
Page Life cycle
WCF Advantages
Ho do you create paging
Do paging have performance over head
What are master pages
What is Clusterd index
Differnce between primary and unique key
How do you trace information of non web components
Is Trace.axd is a page?
How do you declare a global variable?

Wipro Interview questions 2010

  1. What is assembly
  2. What are authentications ? (Mention IIS and .net authentications)
  3. What is singleton class
  4. What are access modifiers explain
  5. Public,private,protected,Protected internal
  6. What is shared assemblies
  7. What is versioning
  8. Difference between ASP and ASP.net
  9. Difference between WebServices and WCF
  10. What is use of Webservice when you have DCOM
  11. How do you retrieve hierarchical data from database
  12. What is static class
  13. difference between abstract class and static class
  14. difference between interface and abstract class
  15. Use of Interface and delegates
  16. How do you handle webservice event in the page
  17. Page Life cycle
  18. Application Life cycle
  19. Session Modes
  20. Five Modes of Trace Switches.

Monday, January 25, 2010

Advantages of using WCF over Web Services

WCF Supports Multiple Bindings like http,tcp,MSMQ etc where as web services uses only http
WCF can maintain transaction like com+ .
It can mainitain state .
It can be hosted on IIS,Selfhosting,Windows Servies(Windows Application Service) .
The development of webservice with ASP.net relies on defining data and relies on the XMLSerializer to transform datato or from a service.
Key Issues of XML Serailizer to serialize .net Types with XML.
-Only Public fields and Properties of .net types can be translated to XML
-Only the classes which implement IEnumerable Interface can be translated to XML.
-Classes implementing IDictionary Interface such as Hash table cannot be serialized.

WCF Uses DataContractAttribute and DataMember Attribute to Translate .net types to XMl.
-DataContract Attribute can be used for classes and structures-DataMember Attribute to Field or Property
Diference between DataContractSerailizer and XML Serializer is
-DCS has better performance over XML Serialization
-XML Serialization doesn't indicate which field or property of the type is serialized, DCS Explicitly shows which field or property is serialized
-DCS can serialize classes implementing IDictionary interface(Hash Table)

Exception Handling
In ASP.NET Web services, Unhandled exceptions are returned to the client as SOAP faults.
In WCF Services, unhandled exceptions are not returned to clients as SOAP faults. A configuration setting is provided to have the unhandled exceptions returned to clients for the purpose of debugging.

Monday, February 16, 2009

Toll free

Airlines
Indian Airlines - 1800 180 1407
Jet Airways - 1800 22 5522
SpiceJet - 1800 180 3333
Air India -- 1800 22 7722
KingFisher - 1800 180 0101
Banks
ABN AMRO - 1800 11 2224
Canara Bank - 1800 44 6000
Citibank - 1800 44 2265
Corporatin Bank - 1800 443 555
Development Credit Bank - 1800 22 5769
HDFC Bank - 1800 227 227
ICICI Bank - 1800 333 499
ICICI Bank NRI - 1800 22 4848
IDBI Bank - 1800 11 6999
Indian Bank - 1800 425 1400
ING Vysya - 1800 44 9900
Kotak Mahindra Bank - 1800 22 6022
Lord Krishna Bank - 1800 11 2300
Punjab National Bank - 1800 122 222
State Bank of India - 1800 44 1955
Syndicate Bank - 1800 44 6655
Automobiles
Mahindra Scorpio - 1800 22 6006
Maruti - 1800 111 515
Tata Motors - 1800 22 5552
Windshield Experts - 1800 11 3636
Computers/IT
Adrenalin - 1800 444 445
AMD - 1800 425 6664
Apple Computers - 1800 444 683
Canon - 1800 333 366
Cisco Systems - 1800 221 777
Compaq - HP - 1800 444 999
Data One Broadband - 1800 424 1800
Dell - 1800 444 026
Epson - 1800 44 0011
eSys - 3970 0011
Genesis Tally Academy - 1800 444 888
HCL - 1800 180 8080
IBM - 1800 443 333
Lexmark - 1800 22 4477
Marshal's Point - 1800 33 4488
Microsoft - 1800 111 100
Microsoft Virus Update - 1901 333 334
Seagate - 1800 180 1104
Symantec - 1800 44 5533
TVS Electronics - 1800 444 566
WeP Peripherals - 1800 44 6446
Wipro - 1800 333 312
xerox - 1800 180 1225
Zenith - 1800 222 004
Railways
Indian Railway General Enquiry 131
Indian Railway Central Enquiry 131
Indian Railway Reservation 131
Indian Railway All Enquiry 139
Indian Railway Railway Reservation Enquiry 1345,1335,1330
Indian Railway Centralised Railway Enquiry 1330/1/2/3/4/ 5/6/7/8/9
Couriers/Packers & Movers
ABT Courier - 1800 44 8585
AFL Wizz - 1800 22 9696
Agarwal Packers & Movers - 1800 11 4321
Associated Packers P Ltd - 1800 21 4560
DHL - 1800 111 345
FedEx - 1800 22 6161
Goel Packers & Movers - 1800 11 3456
UPS - 1800 22 7171
Home Appliances
·
· Aiwa/Sony - 1800 11 1188
· Anchor Switches - 1800 22 7979
· Blue Star - 1800 22 2200
· Bose Audio - 1800 11 2673
· Bru Coffee Vending Machines - 1800 44 7171
· Daikin Air Conditioners - 1800 444 222
· DishTV - 1800 12 3474
· Faber Chimneys - 1800 21 4595
· Godrej - 1800 22 5511
· Grundfos Pumps - 1800 33 4555
· LG - 1901 180 9999
· Philips - 1800 22 4422
· Samsung - 1800 113 444
· Sanyo - 1800 11 0101
· Voltas - 1800 33 4546
· WorldSpace Satellite Radio - 1800 44 5432
Investments/ Finance
CAMS - 1800 44 2267
Chola Mutual Fund - 1800 22 2300
Easy IPO's - 3030 5757
Fidelity Investments - 1800 180 8000
Franklin Templeton Fund - 1800 425 4255
J M Morgan Stanley - 1800 22 0004
Kotak Mutual Fund - 1800 222 626
LIC Housing Finance - 1800 44 0005
SBI Mutual Fund - 1800 22 3040
Sharekhan - 1800 22 7500
Tata Mutual Fund - 1800 22 0101
Travel
Club Mahindra Holidays - 1800 33 4539
Cox & Kings - 1800 22 1235
God TV Tours - 1800 442 777
Kerala Tourism - 1800 444 747
Kumarakom Lake Resort - 1800 44 5030
Raj Travels & Tours - 1800 22 9900
Sita Tours - 1800 111 911
SOTC Tours - 1800 22 3344
Healthcare
Best on Health - 1800 11 8899
Dr Batras - 1800 11 6767
GlaxoSmithKline - 1800 22 8797
Johnson & Johnson - 1800 22 8111
Kaya Skin Clinic - 1800 22 5292
LifeCell - 1800 44 5323
Manmar Technologies - 1800 33 4420
Pfizer - 1800 442 442
Roche Accu-Chek - 1800 11 45 46
Rudraksha - 1800 21 4708
Varilux Lenses - 1800 44 8383
VLCC - 1800 33 1262
Insurance
AMP Sanmar - 1800 44 2200
Aviva - 1800 33 2244
Bajaj Allianz - 1800 22 5858
Chola MS General Insurance - 1800 44 5544
HDFC Standard Life - 1800 227 227
LIC - 1800 33 4433
Max New York Life - 1800 33 5577
Royal Sundaram - 1800 33 8899
SBI Life Insurance - 1800 22 9090
Hotel Reservations
GRT Grand - 1800 44 5500
InterContinental Hotels Group - 1800 111 000
Marriott - 1800 22 0044
Sarovar Park Plaza - 1800 111 222
Taj Holidays - 1800 111 825
Teleshopping
Asian Sky Shop - 1800 22 1800
Jaipan Teleshoppe - 1800 11 5225
Tele Brands - 1800 11 8000
VMI Teleshopping - 1800 447 777
WWS Teleshopping - 1800 220 777
Others
Domino's Pizza - 1800 111 123
Cell Phones
·
· BenQ - 1800 22 08 08
· Bird CellPhones - 1800 11 7700
· Motorola MotoAssist - 1800 11 1211
· Nokia - 3030 3838
· Sony Ericsson - 3901 1111

Thursday, February 5, 2009

Script to query LDSI

I worked hard (hardly worked) to get his requirement done.. ...though to share the code ,might be useful ...hmm..

'On Error Resume Next
Dim fso
Const ForReading = 1, ForWriting = 2 , forAppend = 8

Set fso = CreateObject("Scripting.FileSystemObject")
Set f = fso.OpenTextFile("Members.txt", forAppend, True)

' Determine DNS domain name.
Set objRootDSE = GetObject("LDAP://RootDSE")
strDNSDomain = objRootDSE.Get("defaultNamingContext")

' Use ADO to search Active Directory.
Set objCommand = CreateObject("ADODB.Command")
Set objConnection = CreateObject("ADODB.Connection")
objConnection.Provider = "ADsDSOObject" objConnection.Open "Active Directory Provider" objCommand.ActiveConnection = objConnection

strBase = "<LDAP://" & strDNSDomain >"

' Filter on all user objects. strFilter = "(&(objectCategory=person)(objectClass=user))"
' Specify attribute values to retrieve.

strAttributes = "cn,distinguishedName,sAMAccountName,description,homeDirectory, mailnickName,mail,EmployeeNumber"

strQuery = strBase & ";" & strFilter & ";" & strAttributes & ";subtree" objCommand.CommandText = strQuery
objCommand.Properties("Page Size") = 100
objCommand.Properties("Timeout") = 30
objCommand.Properties("Cache Results") = False
Set objRecordSet = objCommand.Execute

Do Until objRecordSet.EOF
strFullName = objRecordSet.Fields("cn")
strDN = objRecordSet.Fields("distinguishedName")
strNTName = objRecordSet.Fields("sAMAccountName")
strAlias = objRecordSet.Fields("mailnickName")
strmail = objRecordSet.Fields("mail")
strId= objRecordSet.Fields("EmployeeNumber")
strHomeDir = objRecordSet.Fields("homeDirectory")


If IsNull(strHomeDir) Then
strHomeDir = "None"
Else
strHomeDir = strHomeDir
End If

f.writeline strFullName & vbtab & strDN & vbtab & strNTName & vbtab & strHomeDir & vbtab & strAlias & vbtab & strmail & vbtab & strID
objRecordSet.MoveNext

Loop

MsgBox "Done"


Work is donee :0)


Acessing Data Using Data Repeater

Accessing Data Using Data Repeater:

Data Repeater repeats the specified data-bound templates without applying any sort of additional formatting. For example, the Repeater doesn't create a table or a vertical or horizontal list of data by default. You determine the final layout of the generated markup by creating ASP.NET templates and explicitly adding markup that separates one row from the next.

HTML File


<asp:repeater id="Repeater1" runat="server">
<ItemTemplate>
<%# DataBinder.Eval(Container.DataItem,"AssetType")%>
</ItemTemplate>
<SeparatorTemplate>
</br>
</SeparatorTemplate>
</asp:repeater>

DataBinder.Eval method is used to declare which members of the DataItem to use in the output. The Eval method uses reflection to get the second parameter from the first. This approach typically has Container.DataItem as the first parameter, which yields a DataRowView. The second parameter is the name of the data field within the DataRowView



Code behind (Using Data Reader)

Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load


Dim Objconn As New OleDbConnection
Dim objreader As OleDbDataReader
Dim strsql As String
Dim strconnection As String


''Connection String from web.config file

strconnection = ConfigurationSettings.AppSettings("Dbconn")
Objconn = New OleDb.OleDbConnection(strconnection)
Objconn.Open()
Dim ds As DataSet = New DataSet

strsql = " Select distinct AssetType as AssetType from AM_AssetType order by assettype"

Dim objcommand As New OleDbCommand(strsql, Objconn)

objreader = objcommand.ExecuteReader

Repeater1.DataSource = objreader
Repeater1.DataBind()



End Sub

Code behind (Using Data Adapter)

Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load


Dim Objconn As New OleDbConnection
Dim Objadapter As New OleDbDataAdapter
Dim Objds As New DataSet
Dim strsql As String


''Connection String from web.config file

strconnection = ConfigurationSettings.AppSettings("Dbconn")
Objconn = New OleDb.OleDbConnection(strconnection)
Objconn.Open()
Dim ds As DataSet = New DataSet

strsql = " Select distinct AssetType as AssetType from AM_AssetType order by assettype"

Objadapter = New OleDbDataAdapter(strsql, Objconn)
Objadapter.SelectCommand.CommandTimeout = 50000
Objadapter.Fill(ds)

Repeater1.DataSource = objreader
Repeater1.DataBind()
End Sub

Is Data Reader Disconnected ?

DataReader is connected. However, DataTable and DataSet are disconnected (in-memory).you can't have a new DataReader for a connection if there is another one already active.