Sie sind auf Seite 1von 9

1.how to create components?and what is difference between assembly and component in dot net?

Components are packaged in assemblies. Assemblies are the reusable, versionable, selfdescribing building blocks of .NET applications. The simplest assembly is a single executable that contains all the information necessary for deployment and versioning. The metadata describing an assembly is called the manifest. In the most general case, an assembly can consist of a number of executable files and resource files. In that case, the manifest may be a separate file, or it may be included in one of the executable files. Assemblies enable the common language runtime to locate and securely execute code. In particular, the runtime uses assemblies for the following purposes:

Establishing security and version identity for code. Providing a scope for class and type resolution. Locating classes to load.

Assemblies and Versioning


One of the primary goals of assemblies is versioning. Specifically, assemblies provide a means for developers to specify version rules between different software components, and to have those rules enforced at run time. Because assemblies are the building blocks of applications, they are the logical point for specifying and enforcing version information. Each assembly has a specific version number as part of its identity. The version number is stored in the assembly's manifest along with other identity information, including the friendly name and supported locales. The fact that a version number is part of an assembly's identity is the key to versioning: AssemblyA, version 1 and AssemblyA, version 2 are two completely different entities, and are treated as such at run time.

For more general information on assemblies, see Assemblies in the .NET Framework documentation. 2. How to create a permenent cookie ? HttpCookie myCookie = new HttpCookie("uname","teak");myCookie.expiry = DateTime.Now.AddYear(1);Response.Cookie.Add(myCookie);
---

The permanent cookie is created the same way the normal cookie is created. To create a permanent cookie you have to specify a date in the future. Like,oHeader.AddCookie('userid',lcID,'/wconnect','NEVER') where NEVER is converted to a date in future. 3. i am handling an exception using catch block what will happen if there an error occur it in catch block ? There will be fatal error and program terminates execution 4.How can i decrypt a password that had already encrypted using MD5 format in ASP.NET?orHow can I compare ? Use System.Security.Cryptography namespace

Decalre an object of MD5CryptoServiceProvider and compute hash keys for the variable. 5.which method get called between a object is declared and it is collect by the garbage collector.A)DeleteB)Disposec)FinalizeD)Clo Finalize method is called ----Finalize method is called.when the process get starts it occupy some space in memory,where the objects resides.when no space is available and application has to create a new object,objects no longer used by appication is gabage collected,but if the obj is having a finilize function,it is called first and the object will not b garbaged(or it will not be destroyed),once the finilize function gets executed,the next time the garbage will run the object is garbaged and destroyed

6.difference between remoting and web service in .net?explain with an example ?

in web service when the function which resides in the server is called by client side,the message protocol used is soap and transfer protocol used is http.so all the message is first converted to xml format and serializes and use http transfer protocol for transfer to the server and again in server it gets deserialized and from the xml file it gets information about which fun ction is called by the client and what r the parameter.and agai return the value in xml format.As the message is passed in xml format,it is platform independent Remoting lets us enjoy the same power of web services,when the platform is same.we can connect to the server directly over TCP and send binary data without having to do lots of conversion. 7.How will you load dynamic assembly? How will create Assemblies at run time? 2)How to maintain View Hi...u Can Create and Load Assemblies dynamically by REFLECTION OR COREDOM namespace in .NET Library......Reflection provide u all the classes to load and Create the assemblies at run time........ 8. What Is The Difference Between ViewState and SessionState ViewState persist the values of controls of particular page in the client (browser) when post back operation done. When user requests another page previous page data no longer available. SessionState persist the data of particular user in the server. This data available till user close the browser or session time completes. 9. With respect to security ,which one is the better choice ,.Net or J2EE? Explain......... As per my knowledge J2EE is more features for security than DOTNET ----As per majority programmers .NET is the best one whch have single vendor compare to ,the eace of use,more use friendly,u can send any problem ,it'll be solved. -with resp to j2ee is more secured 10. what is the difference between webservice and webapplication? Keeping it simple a webapp wokrs between client and server but websevice helps communication between applications 11.How many data types are supported in Vbscript

VBScript consists of only one data type (Variant) 12.What are session variables?? Variabiles saved between the sessions (ASP, PHP etc.) Can be stored in server side or client side (with cookies). 13.How will you load dynamic assembly? How will create assesblies at run time? There are basically two methods in .Net to generate dynamic code through your program. One is to use CodeDom library while other is to use Reflection Emit library. The System.CodeDom library is used to generate the standard CLS (Common Language Specification) compliant code that can be emitted in any of .Net languages. On the other hand, the System.Reflection.Emit library is used to generate the MSIL (Micrsoft Intermediate Language) code. Dot Net Reflection Emit allows us to construct assemblies, modules, types at runtime and define code inside these types. 14. How to maintain ViewState of dynamically created user controls? For example, If I am creating few instances ?

dim btn1 as new button btn1.eableviewstate=True -----Sorry We need to use Loadviewstae and saveview state for this 15.How do you know what version of IIS is being used by server..I mean can a client know what version of IIS is being used? or how can I know what version of IIS is being used by my hosting company? Response.Write Request.ServerVariables ("SERVER_SOFTWARE") 16. 1. What is the core difference between ASP and ASP.NET and why do you want to migrate from asp to asp.net 2. What is the diff b/w HTML server Controls and Web Server Controls http://www.extremeexperts.com/Net/FAQ/DiffBetweenServerandHTMLControls.aspx 3. How sessions are handled in ASP Vs ASP.NET 4. How versions are controlled in ASP Vs ASP.NET 5. Explain the concurrency problems using DATASETS 6. what is XSD and XSLT. what is XML and what are the types of XML 7. What are web services

There are many difference between asp and asp.net In asp.net the programming approach used is Object oriented programming with which you can create scallable application seperating presentation layer from business logic.

asp.net provides build in security ,authentication nad authorization machinism. asp.net provides better database programming access then asp using ado.net(which also provides disconnected data operations) there are many advantages these are few to name .You search using google. 17. which class builds insert,update,delete colums for automatically? Command builder class 18. which namespace is used for event log support? using System.Diagnostics;

19. What is the difference between Session and Cookies. Can we use both in the same webpage. when we should go for cookies.. What are the advantages and disadvantages of both.. Plz send me code also..

As far as my knowledge is concerned, cookies are stored on client side where as sessions are server variables. The storage limitations are also there (like IE restricts the size of cookie to be not more than 4096 bytes). We can store only a string value in a cookie where as objects can be stored in session variables. The client will have to accept the cookies in order to use cookies, there is no need of user's approval or confirmation to use Session variables cos they are stored on server. The other aspect of this issue is cookies can be stored as long as we want(even for life time) if the user accepts them, but with session variables we can only store something in it as long as the session is not timed out or the browser window is not closed which ever occurs first. Coming to usage you can use both cookies and session in the same page. We should go for cookies to store something that we want to know when the user returns to the web page in future (eg. remember me on this computer check box on login pages uses cookies to remember the user when he returns). Sessions should be used to remember something for that particular browser session (like the user name, to display on every page or where ever needed). how to write and read cookies. This eample code belongs to web site www.gotdotnet.com visit the following link for full example code and demo. http://samples.gotdotnet.com/quickstart/aspplus/doc/stateoverview.aspx Protected Sub Page_Load(sender As Object, e As EventArgs) If Request.Cookies("preferences1") = Null Then Dim cookie As New HttpCookie("preferences1") cookie.Values.Add("ForeColor", "black") ... Response.AppendCookie(cookie) End If End Sub Protected Function GetStyle(key As String) As String Dim cookie As HttpCookie = Request.Cookies("preferences1") If cookie <> Null Then Select Case key

Case "ForeColor" Return(cookie.Values("ForeColor")) Case ... End Select End If Return("") End Function How to write and read session variables. This example belongs to www.eggheadcafe.com visit the following link for quick summary and list of FAQs on Session State. http://www.eggheadcafe.com/articles/20021016.asp Basic use of Session in ASP.NET (C#): STORE: DataSet ds = GetDataSet(whatever parameters); Session["mydataset")=ds; RETRIEVE: DataSet ds = (DataSet)Session["mydataset"]; 20. how to refresh the crystal report data from ASP.Net?

Try to use following code : <meta http-equiv="refresh" content="1"> within ur <head>. This would refresh the whole page.To avoid this ,you could embed your page with the report in an iframe and then embed that iframe in your "outer" page.That way, you can refresh the inner page with just the report, while the main page remains. The problem here would be that when the embedded page refreshes the browser,it would show the progress bar in the status bar and the whole page shows a flicker which is same as if the whole page (outside page) is refreshed. For that ,use refresh code and this in iframe header. <meta HTTP-EQUIV="Page-Enter" CONTENT="revealtrans(duration=0.0)"> <meta HTTP-EQUIV="Page-Exit" CONTENT="revealtrans(duration=0.0)"> That way , we can get a smoother effect. 21. How to show graphs in ASP .net ?graphs will be based on the databse.

We can use System.Drawing;

System.Drawing.Drawing2D;
name spaces for drawing graphs based on data from databases in web pages.

22. Explain the life cycle of an ASP .NET page.

Stage Page Initialization View State Loading Postback data processing Page Loading PostBack Change Notification PostBack Event Handling Page Pre Rendering Phase View State Saving Page Rendering Page Unloading

Events/Method Page_Init LoadViewState LoadPostData Page_Load RaisePostDataChangedEvent RaisePostBackEvent Page_PreRender SaveViewState Page_Render Page_UnLoad

23. How can we associate a single codebehind file with two aspx pages. eg. We have two files First.aspx and Second.aspx and we have cs files codebehind.cs in which we want to write code for both files. Then how we will execute this cs file for both of the aspx file\'s events. Yes we can make it.Just replace the codebehind filename in both the .aspx files and also the inherits class name with the .cs file name and class name.for example if first.aspx ,second.aspx are the two aspx pages and second.aspx.cs is the codebehind file then in the <@ page > tag of the first.aspx file rename the 'codebehind = first.aspx.cs' with 'codebehind = second.aspx.cs' and also Inherits="WebApplication1.first" with Inherits="WebApplication1.second" when we execute this then second.aspx.cs will be executed 24. How we implement Web farm and Web Garden concept in ASP.NET?At least give an example A web farm is a multi-server scenario. So we may have a server in each state of US. If the load on one server is in excess then the other servers step in to bear the brunt. How they bear it is based on various models. 1. RoundRobin. (All servers share load equally) 2. NLB (economical) 3. HLB (expensive but can scale up to 8192 servers) 4. Hybrid (of 2 and 3). 5. CLB (Component load balancer). A web garden is a multi-processor setup. i.e., a single server (not like the multi server above). How to implement webfarms in .Net: Go to web.config and Here for mode = you have 4 options. a) Say mode=inproc (non web farm but fast when you have very few customers). b) Say mode=StateServer (for webfarm) c) Say mode=SqlServer (for webfarm) Whether to use option b or c depends on situation. StateServer is faster but SqlServer is more reliable and used for mission critical applications. How to use webgardens in .Net: Go to web.config and Change the false to true. You have one more attribute that is related to webgarden in the same tag called cpuMask 25. is there any limit for query string? if means what is the maximum size?. 255

26. How to create a package for web application with components that shared with other applications? Create a setup project which produces a .msi file. A shared component assembly must be given a strong name using the following steps: 1. Create a key pair using sn.exe -k on the command line 2. Add AssemblyKeyFileAttribute to the assembly file and set it to the full name and path of the key file generated in step 1. 3. Build the assembly The setup program detects a strongg named assembly and installs it into GAC on the client machine 27. How to debug javascript or vbscript in .Net? For debugging the client side script enable the debugging in IE.a. Open Microsoft Internet Explorer.b. On the Tools menu, click Internet Options.c. On the Advanced tab, locate the Browsing section, clear the Disable script debugging check box, and then click OK.d. Close Internet Explorer 28. How to validate xmlschema in xml document? One can validate the XML document againest a given schema using the .Net class under the package System.Xml.Schema; like using XMLSchemaValidator and XmlSchema

----One can validate the XML document againest a given schema using the .Net class under the package System.Xml.Schema; like using XMLSchemaValidator and XmlSchema 29. What is the difference between web.config and machine.config ? the settings made in the web.config file are applied to that particular web application only whereas the settings of machine.config file are applied to the whole asp.net application ---Web.config file Setting of asp.net all porject mach.config are setting of server setting and when the web side are implemented time it work all project but web.config file set all projects ----web config will be for that paticlur aplln whereas the manchine .config will for the whole machine ---Web.config file is to override the settings from the machine.config file. machine.config file settings are applied to all the webapplications residing on the server while web.config settings are application specific. --Web.config file is to override the settings from the machine.config file. machine.config file settings are applied to all the webapplications residing on the server while web.config settings are application specific. --Every ASP.NET application that you has a web.config file . The settings specified in this will imply only to that application.Whereas Your System will have a machine.config file in Microsoft.NET\Framework\v1.1.4322\CONFIG Folder which contains specifications and settings at a system level. 30. How to compare an xml schema with xml schema? xml schema is compared through Diffgram. with the help diffram we compare opl xml schema and new schema. In Data Set uses this functionality

31. How to handle the exception occured in catch block? (If a exception occurs in catch block,which statement is executed next?)

The exception in catch blck may be handled using the same try--catch--finally structure. In case an exception generated in catch block is not handled in the same block, it travels its usual way -- to the parent of the current method. Here is a piece of code written in a web form which demonstrates exception handling in catch block and what happens if exception is not handled in catch: private void Button1_ServerClick(object sender, System.EventArgs e) {

try
{ f(); }

catch (Exception exfinal)


{ Label3.ForeColor = System.Drawing.Color.BlueViolet; Label3.Text = exfinal.Message + "::" + exfinal.Source + "::::::::" + exfinal.InnerException.Message; } }

private void f()


{

try
{ Exception ex = new Exception("Main Exception");

throw ex;
}

catch (Exception ex)


{

//another exception try


{ Exception newex = new Exception("Exception in catch block", ex);

throw newex;
}

catch (Exception nex)


{

//Label3.Text = nex.Message + "::::" + nex.InnerException.Message; //yet another exception, not caught here throw nex;
} } }

32. What are web parts ? Web Parts is a way of letting the user to customize the information that is available in our site this is a very interesting feature available in ASP 2.0 which brings a world of Web Parts controls like Web Parts Manager control, Web Part Zone, Catalog Zone to name a few....hope this info is useful

Catch Management in asp.net


InProc - Stored in the aspnet_wp.exe process area. The session data is lost when the process or the application domain is recycled. StateServer - Session state is stored in a separate process (aspnet_state.exe) which can be stored in a different machine. Since it can be stored in a different machine, this option will work in a web farm scenario. SQLServer - Session state is stored in a SQL Server database. This option will also work in a web farm scenario.

Asp.net 3 pages completed

Das könnte Ihnen auch gefallen