-
- For most programmers, having a garbage collector (and using garbage collected objects) means that you never have to worry about deallocating memory, or reference counting objects, even if you use sophisticated data structures. It does require some changes in coding style, however, if you typically deallocate system resources (file handles, locks, and so forth) in the same block of code that releases the memory for an object. With a garbage collected object you should provide a method that releases the system resources deterministically (that is, under your program control) and let the garbage collector release the memory when it compacts the working set.
-
- All languages that target the runtime allow you to allocate class objects from the garbage-collected heap. This brings benefits in terms of fast allocation, and avoids the need for programmers to work out when they should explicitly free each object.The CLR also provides what are called ValueTypes—these are like classes, except that ValueType objects are allocated on the runtime stack (rather than the heap), and therefore reclaimed automatically when your code exits the procedure in which they are defined. This is how "structs" in C# operate.Managed Extensions to C++ lets you choose where class objects are allocated. If declared as managed Classes, with the __gc keyword, then they are allocated from the garbage-collected heap. If they dont include the __gc keyword, they behave like regular C++ objects, allocated from the C++ heap, and freed explicitly with the "free" method.
-
- Machine.Config:
1. This is automatically installed when you install Visual Studio. Net.
2. This is also called machine level configuration file.
3. Only one machine.config file exists on a server.
4. This file is at the highest level in the configuration hierarchy.Web.Config:
1. This is automatically created when you create an ASP.Net web application project.
2. This is also called application level configuration file.
3. This file inherits setting from the machine.config
-
- It is an optional XML File which stores configuration details for a specific ASP.Net web application.
-
- Configuration files are used to control and manage the behavior of a web application.1. Machine.config
2. Web.config
-
- By default ASP.Net web application has only one web.config. but in sub folder you can create one web.cofing per sub folder to set configuration of that folder.eg. - if your web application have 3 folder then 4 web.config can be in your web application
-
- The .Net Framework provides an extensive system of types that allow you to store, manipulate and pass values between members of your application. The .Net Framework is strongly typed, meaning that objects of one type cannot be freely exchanged with objects from another type. Implicit and explicit conversions allow you to convert data types when necessary..Net data types can be broken down into the following subcategories:1. Integer types
2. Floating-Point Types
3. Non-Numeric data types such as:
Boolean
Char
String
Object
-
- Exceptions represent a breach of an implicit assumption made within code. For example, if your code tries to access a file that is assumed to exist, but the file is missing, an exception would be thrown. However, if your code does not assume that the file exists and checks for its presence first, this scenario would not necessarily generate an exception.Exceptions are not necessarily errors. Whether or not an exception represents an error is determined by the application in which the exception occurred. An exception that is thrown when a file is not found may be considered an error in one scenario, but may not represent an error.
-
- No you cannot. The .Net Framework must be installed in the machine on which you want to run .Net Application .
-
- No, you cannot, you will need to install the latest .Net Framework.
-
- 1. All the .Net libraries you call within your code are not compiled into your assembly, and you need these assemblies in the destination machine, in order for it to run you need .Net Framework installed.\r\nA program compiled in C# or VB is not a program in native code, it is a Pre-compilation in a Intermediate Language (MSIL). When you run this program the .Net Runtime, makes the final compilation to native code for the platform on which it is executed - this is called Just-In-Time compilation.
- 1.
-
- 1. A typed dataset is very much similar to a normal dataset. But the only difference is that the sehema is already present for the same. Hence any mismatch in the column will generate compile time errors rather than runtime error as in the case of normal dataset. Also accessing the column value is much easier than the normal dataset as the column definition will be available in the schema.
- 1.
-
- 1. When sending and retrieving a DataSet from an XML Web service, the DiffGram format is implicitly used. Additionally, when loading the contents of a DataSet from XML using the ReadXml method, or when writing the contents of a DataSet in XML using the WriteXml method, you can select that the contents be read or written as a DiffGram. For more information, see Loading a DataSet from XML and Writing a DataSet as XML Data. While the DiffGram format is primarily used by the .NET Framework as a serialization format for the contents of a DataSet, you can also use DiffGrams to modify data in tables in a Microsoft SQL Server™ 2000 database.
- 1.
-
- 1. The answer of this question is always Yes because XML is an important component of ADO.Net architecture. ADO.Net use XML to store and transfer data. We do not have to convert data to XML format. DataSets helps XML to integrate with ADO.Net. XML schema plays a role to get table definition, column, datatypes and constraints in the DataSet.
- 1.
-
- 1. To get read-only and forward only access to data we use DataReader. The DataReader object reduces the system overhead because one row at a time is taken into memory so it is quite lightweight. To get second object connection is reconnected. We can create a DataReader object by Execute Reader() method. There are two Data Reader class one is SqlDataReader and other one is OleDbDataReader.
- 1.
-
- 1. 90 Seconds.
- 1.
-
- 1. System.Web.Mail (SWM) is the .Net namespace used to send email in .Net Framework applications. SWM contains three classes:1. MailMessage - used for creating and manipulating the mail message contents.
2. MailAttachments - used for creating a mail attachment to be added to the mail message.3. SmtpMail - used for sending email to the relay mail server.
- 1.
-
- 1. //Populate the DataSet//...
//Display in TextBoxes using Column Name
TextBox1.Text = ds.Tables [0].Rows[0]["ProductId"].ToString ();
TextBox2.Text =ds.Tables [0].Rows[0]["ProductName"].ToString ();
//Display in TextBoxes using Column Index
TextBox1.Text = ds.Tables [0].Rows[0][0].ToString ();TextBox2.Text =ds.Tables [0].Rows[0][1].ToString ();
- 1.
-
- 1. MSIL is the CPU-independent instruction set into which .Net Framework programs are compiled. It contains instructions for loading, storing, initializing, and calling methods on objects.Combined with metadata and the common type system, MSIL allows for true cross-language integration.Prior to execution, MSIL is converted to machine code. It is not interpreted.
- 1.
-
- 1. Garbage collection is a mechanism that allows the computer to detect when an object can no longer be accessed. It then automatically releases the memory used by that object (as well as calling a clean-up routine, called a "finalizer", which is written by the user). Some garbage collectors, like the one used by .Net, compacts memory and therefore decrease your programs working set.
- 1.
-
- 1. By default, ASP.Net submits a form to the same page. In cross-page posting, the form is submitted to a different page. This is done by setting the PostBackUrl property of the button(that causes postback) to the desired page. In the code-behind of the page to which the form has been posted, use the FindControl method of the PreviousPage property to reference the data of the control in the first page.
- 1.
-
- 1. The AutoEventWireUp is a boolean attribute that allows automatic wireup of page events when this attribute is set to true on the page. It is set to True by default for a C# web form whereas it is set as False for VB.Net forms. Pages developed with Visual Studio .Net have this attribute set to false, and page events are individually tied to handlers.
- 1.
-
- 1. Themes are a collection of CSS files, .skin files, and images applied to webcontrols on website. Themes do not replace the style sheets. It gives the common looks and feel to all webcontols in a simple way. Its allows to abstract the styles so that it can be reused.In ASP.Net 2.0, a special folder named App_Themes in the root of your application is used to store themes. Each theme needed for your application is placed in a separate folder within the App_Themes folder.
- 1.
-
- 1. Themes can be used by a variety of methods. The following examples show you how you can define a theme named "SmokeAndGlass" in your application by different methods:1. Page level
<%@ Page Theme="SmokeAndGlass" Language="C#"%>
2. Application level<configuration> <system.web> <pages theme=“SmokeAndGlass” /> </system.web> </configuration>
- 1.
-
- 1. Generally, Themes contain skins. A skin file contains style definitions for the individual server controls. You can define skin settings for a control using similar markup which we use to add server controls to web page. Only difference you may find between skinned versions of control is that skinned version do not include ID attribute for control. You should retain properties for which you want to configure through Themes. We create .skin files in Theme folder. We can also mix all server controls style definition in a single skin file. Make sure all style definition files like CSS, skin files, Image files and other resources are included in Themes folder in your application directory.There are two types of control skins based on their scope. They are:
1. Default Skins2. Named Skins
- 1.
-
- 1. Displays several images in succession, with different on displayed after each server round trip. Use the AdvertisementFile property to specify the XML file describing the iamges and the AdCreated event to perform processing before each image is sent back. You can also use target property to name a window to open when the image is clicked.
- 1.
-
- 1. Like Image control, but aloows you to specify specific action to trigger if user click one or more hot spots in the image. The action to take can either be a postback or a redirection to another URL. Hot spots are supplied by embedded controls that derive from HotSpot, such as RectangleHotSpot and CircleHotSpot.
- 1.
-
- 1. ASP.Net provides infrastructure for authentication and authorization that will meet most of your needs for securing an .Net application. Four schemes are available in ASP.Net:1. Forms-based authentication
2. Windows-based authentication
3. Microsoft Passport authentication4. None - authentication disabled
- 1.
-
- 1. Forms authentication generally refers to a system in which unauthenticated requests are redirected to an HTML form, using HTTP client-side redirection. Forms authentication is a good choice if your application needs to collect its own user credentials at logon time through HTML forms. The user provides credentials and submits the form. If the application authenticates the request, the system issues a form that contains the credentials or a key for reacquiring the identity. Subsequent requests are issued with the form in the request headers. They are authenticated and authorized by an ASP.NET handler using whatever validation method the application specifies.
Note that forms authentication is often used for personalization, where content is customized for a known user. In some of these cases, identification is the issue rather than authentication, so it is enough to merely store the user name in a durable form and use that form to access the users personalization information.
- 1.
-
- 1. The WindowsAuthenticationModule provider relies on IIS to provide authenticated users, using any of the mechanisms IIS supports. The provider module constructs a WindowsIdentity object. The default implementation constructs a WindowsPrincipal object and attaches it to the application context. The WindowsPrincipal object maps identities to Windows groups.An important reason to use the Windows Authentication provider is to implement an impersonation scheme that can use any of the authentication methods that might have already been performed by IIS before passing the request to the ASP.NET application. To do this, set the authentication mode to Windows, and confirm that the impersonate element is set to true.
- 1.
-
- 1. It populates dataset from data source. It contains a reference to the connection object and opens and closes the connection automatically when reading from or writing to the database.
Example:
SqlDataAdapter daEmp = new SqlDataAdapter("select EmpID, EmpName, Salary from Employees", conn);
Fill Method
It is used to populate dataset.
example: daEmp.Fill(dsEmp,"Employee");
Update Method
It is used to update database.example: daEmp.Update(dsEmp,"Employee");
- 1.
-
- 1. Dataset is a disconnected, in-memory representation of data. It can contain multiple data table from different database.They contain multiple Datatable objects, which contain columns and rows, just like normal data base tables. You can even define relations between tables to create parent-child relationships.
ExampleDataSet dsEmp = new DataSet();
- 1.
-
- 1. It provides a forward-only, read-only, connected recordset.
It is most efficient to use when data need not to be updated, and requires forward only traverse. In other words, it is the fastest method to read data.
Example:- Filling dropdownlistbox.
- Comparing username and password
in database.
SqlDataReader rdr = cmd.ExecuteReader();//Reading datawhile (rdr.Read())
{//Display datastring contact = (string)rdr["ContactName"];
string company = (string)rdr["CompanyName"];
string city = (string)rdr["City"];} - Filling dropdownlistbox.
- 1.
-
- 1. It allows to manipulate database by executing stored procedure or sql statements.A SqlCommand object allows you to specify what type of interaction you want to perform with a data base.
For example, you can do select, insert, modify, and delete commands on rows of data in a data base table.SqlCommand cmd = new SqlCommand("select * from Employees", conn);
- 1.
-
- 1. It establishes connection.The connection helps identify the data base server, the data base name, user name, password, and other parameters that are required for connecting to the data base.
Example:SqlConnection conn = new SqlConnection( "Data Source=(local);Initial Catalog=Northwind;Integrated Security=SSPI");
- 1.
-
- 1. protected string TruncateData( string strNotes ){
if (strNotes.Length > 20)
{
return strNotes.Substring(0,20) + "...";
}
else
{
return strNotes;
}}
- 1.
-
- 1. if (ds.Tables[0].Rows.Count == 0 ){
//No record
}
else
{
//Record Found}
- 1.
-
- 1. To avoid having to explicitly close the connection associated with the command used to create either a SqlDataReader or and OleDbDataReader, pass the CommandBehavior.CloseConnection argument to the ExecuteReader method of the Connection. i.edr= cmd.ExecuteReader(CommandBehavior.CloseConnection);
- 1.
-
- 1. Data Source: It can be a database, text file, excel spread sheet or an XML file.2. Data Provider: A set of libraries that is used to communicate with data source. Eg: SQL data provider for SQL, Oracle data provider for Oracle, OLE DB data provider for access, excel or mysql.3. SQL Connection: It establishes connection.4. SQL Command: It allows to manipulate database by executing stored procedure or sql statements.5. SQL DataReader: It provides a forward-only, read-only, connected recordset.6. DataSet: dataset is a disconnected, in-memory representation of data. It can contain multiple data table from different database.7. SQL DataAdapter: It populates dataset from data source. It contains a reference to the connection object and opens and closes the connection automatically when reading from or writing to the database.8. DataView: It provides a means to filter and sort data within a data table.9. Disconnected Data Source: Ado.net makes the connection to the database server only when it needs to do a transaction and disconnects once the transaction is over (similar to an http connection over the internet). This greatly reduces the network traffic.10. Strongly Typed Dataset Object: Strongly typed Dataset object allows you to create early-bound data retrieval expression. It is faster than late-bound data retrieval expression.
- 1.
-
- 1. ASP.Net is a server side scripting technology that enables scripts (embedded in web pages) to be executed by an Internet server.1. ASP.Net is a Microsoft Technology
2. ASP stands for Active Server Pages
3.ASP.Net is a program that runs inside IIS4.IIS (Internet Information Services) is Microsofts Internet server
- 1.
-
- 1. An ASP.Net file is just the same as an HTML file2. An ASP.Net file can contain HTML, XML, and scripts
3. Scripts in an ASP.Net file are executed on the server4. An ASP.Net file has the file extension ".aspx"
-
- 1. When a browser requests an HTML file, the server returns the file2. When a browser requests an ASP.Net file, IIS passes the request to the ASP.Net engine on the server
3. The ASP.Net engine reads the file, line by line, and executes the scripts in the file4. Finally, the ASP.Net file is returned to the browser as plain HTML.
-
- The Page_Load subroutine runs EVERY time the page is loaded. If you want to execute the code in the Page_Load subroutine only the FIRST time the page is loaded, you can use the Page.IsPostBack property. If the Page.IsPostBack property is false, the page is loaded for the first time, if it is true, the page is posted back to the server (i.e. from a button click or by AutoPostBack of any server control on a form).1. Page.IsPostBack = false means page is loaded first time.2. Page.IsPostBack = true means result of round trip (PostBack).
-
- 1. ADO.Net is a part of the .Net Framework2. ADO.Net consists of a set of classes used to handle data access
3. ADO.Net is entirely based on XML4. ADO.Net has, unlike ADO, no Recordset object
-
- Some of the new features in ASP.Net 2.0 are:1. Master Pages, Themes, and Web Parts
2. Standard controls for navigation
3. Standard controls for security
4. Roles, personalization, and internationalization services
5. Improved and simplified data access controls
6. Full support for XML standards like, XHTML, XML, and WSDL
7. Improved compilation and deployment (installation)
8. Improved site management9. New and improved development tools
-
- 1. A ASP.Net assembly may contain the following elements:1. Assembly Manifest - Metadata that describes the assembly and its contents
2. Source Code - Compiled into Microsoft intermediate language
3. Type Metadata - Defines all types, their properties and methods, and most importantly, public types exported from this assembly4. Resources - Icons, images, text strings and other resources
- 1.
-
- An assembly manifest is metadata inside an assembly that describes everything there is to know about the assembly and its contents. The manifest contains:1. Strong Name - The assembly name, version, culture, optional processor architecture, and public key (for shared assemblies)
2. File Contents - Name and hash of all files in the assembly
3. Type List - Types defined in the assembly, including public types that are exported from the assembly
4. Resource List - Icons, images, text strings and other resources contained in the assembly
5. Dependencies - Compile-time dependencies on other assemblies6. Security - Permissions required for the assembly to run properly
-
- 1. Namespaces are logical, whereas assemblies are physical.A namespace is a logical naming scheme to group related types. Namespaces can contain other namespaces to form a hierarchy. The “fully qualified name” of a type is its namespace followed by its type name, separated by a period (for example, System.Windows.Forms.Button). Type names must be unique within a namespace, but the same type name can be used in different namespaces.An assembly is a physical deployment scheme to group related types. An assembly can contain one or many namespaces. A namespace can exist in one or many assemblies.
- 1.
-
- Strong names are required to store shared assemblies in the global assembly cache (GAC). This is because the GAC allows multiple versions of the same assembly to reside on your system simultaneously, so that each application can find and use its own version of your assembly. This helps avoid DLL Hell, where applications that may be compiled to different versions of your assembly could potentially break because they are all forced to use the same version of your assembly.Another reason to use strong names is to make it difficult for hackers to spoof your assembly, in other words, replace or inject your assembly with a virus or malicious code.
-
- Delay signing is signing an assembly with its strong name public key, which is freely distributable, instead of using the private key as usual. This allows developers to use and test a strong-named assembly without access to the private key. Then at a later stage (typically just before shipping the assembly), a manager or trusted keyholder must sign the assembly with the corresponding private key.
-
- 1. A strong name key file has a .snk extension and contains a unique public-private key pair. You use the strong name key file to digitally sign your assembly. Note that this type of file is not secure, as the private key in a .snk file can be easily compromised.For added protection, Visual Studio can encrypt a strong name key file, which produces a file with the .pfx (Personal Information eXchange) extension. The .pfx file is more secure because whenever someone attempts to use the encrypted key, she will be prompted for the password.
- 1.
-
- 1. .NET uses digital signatures to verify the integrity of an assembly. The signatures are generated and verified using public key cryptography, specifically the RSA public key algorithm and SHA-1 hash algorithm. The developer uses a pair of cryptographic keys: a public key, which everyone can see, and a private key, which the developer must keep secret.To create a strong-named assembly, the developer signs the assembly with his private key when building the assembly. When the system later loads the assembly, it verifies the assembly with the corresponding public key.
- 1.
-
- 1. On Microsoft Windows operating systems, a Windows Service is a long-running executable that performs specific functions and which is designed not to require user intervention. Windows services can be configured to start when the operating system is booted and run in the background as long as Windows is running, or they can be started manually when required.Once a service is installed, it can be managed by launching "Services" from the Windows Control Panel -> Administrative Tools or typing "Services.msc" in the Run command on Start menu. The "Services" management console provides a brief description of the service functions and displays the path to the service executable, its current status, startup type, dependencies and the account under which the service is running. It enables users to:
1. Start, stop, pause or restart services.
2. Specify service parameters.
- 1.
0 comments:
Post a Comment
Note: only a member of this blog may post a comment.