Tuesday, October 12, 2010

Frequently Asked Interview Question-Answer of C#.NET

What’s the advantage of using System.Text.StringBuilder over System.String?
         StringBuilder is more efficient in the cases, where a lot of manipulation is done to the text. Strings are immutable, so each time it’s being operated on, a new instance is created

What’s the difference between the System.Array.CopyTo() and System.Array.Clone()?
         The first one performs a deep copy of the array, the second one is shallow.

How can you sort the elements of the array in descending order?
         By calling Sort() and then Reverse() methods.

What’s the .NET datatype that allows the retrieval of data by a unique key?
         HashTable.

Can multiple catch blocks be executed?
         No, once the proper catch code fires off, the control is transferred to the finally block (if there are any), and then whatever follows the finally block.

What’s a delegate?
         A delegate object encapsulates a reference to a method. In C++ they were referred to as function pointers.

What’s a multicast delegate?
         It’s a delegate that points to and eventually fires off several methods.

What’s a satellite assembly?
         When you write a multilingual or multi-cultural application in .NET, and want to distribute the core application separately from the localized modules, the localized assemblies that modify the core application are called satellite assemblies.

What namespaces are necessary to create a localized application?
         System.Globalization, System.Resources.

How do you generate documentation from the C# file commented properly with a command-line compiler?
         Compile it with a /doc switch.

Frequently Asked Interview Question-Answer of ADO.NET

What is a DataSet?
         The Dataset is the central object in ADO.NET. DataSet is a logical container of data. It represents a set of data tables referenced as one unit in the application. With this object you can get all the data you need from each table quickly, examine and change it while you are disconnected from the server and then update the server with changes in an efficient operation.

How to fill DataSet with data?
         To fill DataSet with data we have to use Fill() method of DataAdapter object. Fill() has several overloads. But the simple one is Fill(DataSet, DataTable)

Explain about ADO.NET and its features?
         ADO.NET features are included in the Microsoft.NET framework. It has software components which help in data access and services.This can be used to make changes to RDBMS and non relational data base systems. This technology is considered to be the forefront of Active X data objects.

Explain about Active X data objects?
         Active X data objects are used to access data sources and it is based upon the Component object model. This technology allows data base developers to write program without the knowledge of how database is implemented. Knowledge of SQL is absolutely not necessary to write programs in ADO.

What are the different languages which implement ADO?
         There are several languages which implement ADO technology out of which these are some of the basic they are VB script in ASP, Visual Basic, Delphi, C++, and Microsoft environments. ADO.NET is a new addition to ADO..

State some of the basic steps required to access and manipulate data?
         Some of the basic steps which should be taken to access and manipulate data are as follows.
* Creating connection object which helps to connect to a database.
* Record set object should be created which facilitates connection to receive data.
* Opening of the connection
* Passing the desired name for your table and performing necessary functions on the fetched data.
* Changes can be done by using the commands update and update batch.


Name some of the top level objects which ADO consists?
         Some of the several objects which ADO consists are as follows they are
* Connection object is responsible for creating a connection to the database.
* Record object represents data which is not from the database.
* Parameter object represents a sql parameter
* Stream object is responsible to represent data from a text page or web page.


Explain about RDO?
         A remote data object is also called as RDO in short. This represents data access application programming interface used in operating systems of windows. This was primarily designed for visual basic applications. This feature allows data base developers to interact directly with Open data base connectivity.

Explain about Data access objects or DAO?
         DAO is used for database access on windows platform. It creates a work space object in which applications or operations are performed. There are two types of database engines they are Jet database engine and ODBC direct database engine.
Explain about the command Data reader?
         This feature should be used when you have a long list of results and you need to process one at a time. It provides only two features which is read and forward only. Records should be accessed sequentially. Previously accessed records cannot be accessed again.

Explain about LINQ?
         Language integrated query or LINQ provides developers to query data. It uses strongly typed queries and results. Developer productivity increases by the usage of compile time error checking and intellisense. This feature is common on number of data types.

Explain about Data services?
         ADO.NET has number of combinations of patterns and resources of libraries. This creates a feature which integrates data services with web. It contains formats which represent data such as JSON and plain XML. This form of interaction enables developers to interact with normal http commands..

Explain LINQ to Entities?
         This feature allows LINQ query capabilities and it specifically forms a part of the .NET framework. This feature allows developers to program in ADO.NET and ORM. This feature also allows access to third party database. This provides new features to entity data.
list all the classes those are used for database connections between sql server and asp.net.
        
1.SqlClientPermission - Enables the .NET Framework Data Provider for SQL Server to help ensure that a user has a security level adequate to access a data source.
2.SqlClientPermissionAttribute - Associates a security action with a custom security attribute.
3. SqlCommand - Represents a Transact-SQL statement or stored procedure to execute against a SQL Server database. This class cannot be inherited.
4.SqlCommandBuilder - Automatically generates single-table commands used to reconcile changes made to a DataSet with the associated SQL Server database. This class cannot be inherited.
5. SqlConnection - Represents an open connection to a SQL Server database. This class cannot be inherited.
6.SqlDataAdapter - Represents a set of data commands and a database connection that are used to fill the DataSet and update a SQL Server database. This class cannot be inherited.
7.SqlDataReader - Provides a means of reading a forward-only stream of rows from a SQL Server database. This class cannot be inherited.
8.SqlError - Collects information relevant to a warning or error returned by SQL Server. This class cannot be inherited.
9.SqlErrorCollection - Collects all errors generated by the .NET Framework Data Provider for SQL Server. This class cannot be inherited.
10.SqlException - The exception that is thrown when SQL Server returns a warning or error. This class cannot be inherited.
11.SqlInfoMessageEventArgs - Provides data for the InfoMessage event. This class cannot be inherited.
12.SqlParameter - Represents a parameter to a SqlCommand, and optionally, its mapping to DataSet columns. This class cannot be inherited.
13.SqlParameterCollection - Represents a collection of parameters relevant to a SqlCommand as well as their respective mappings to columns in a DataSet. This class cannot be inherited.
14.SqlRowUpdatedEventArgs - Provides data for the RowUpdated event. This class cannot be inherited.
15.SqlRowUpdatingEventArgs- Provides data for the RowUpdating event. This class cannot be inherited.
16. SqlTransaction - Represents a Transact-SQL transaction to be made in a SQL Server database. This class cannot be inherited.

 


What is main difference between ado and ado.net
        
ADO and ADO.NET are different in several ways:

? ADO works with connected data. This means that when you access data, such as viewing and updating data, it is real-time, with a connection being used all the time. This is barring, of course, you programming special routines to pull all your data into temporary tables.

ADO.NET uses data in a disconnected fashion. When you access data, ADO.NET makes a copy of the data using XML. ADO.NET only holds the connection open long enough to either pull down the data or to make any requested updates. This makes ADO.NET efficient to use for Web applications. It is also decent for desktop applications.

? ADO has one main object that is used to reference data, called the Recordset object. This object basically gives you a single table view of your data, although you can join tables to create a new set of records. With ADO.NET, you have various objects that allow you to access data in various ways. The DataSet object will actually allow you to store the relational model of your database. This allows you to pull up customers and their orders, accessing/updating the data in each related table individually.

? ADO allows you to create client-side cursors only, whereas ADO.NET gives you the choice of either using client-side or server-side cursors. In ADO.NET, classes actually handle the work of cursors. This allows the developer to decide which is best. For Internet development, this is crucial in creating efficient applications.

? Whereas ADO allows you to persist records in XML format, ADO.NET allows you to manipulate your data using XML as the primary means. This is nice when you are working with other business applications and also helps when you are working with firewalls because data is passed as HTML and XML.


Can we do database operations without using any of the ADO.net objects?
        
No its not at all possible.


Can we do database operations without using any of the ADO.net objects?
        
 can we connect two dataadapters to same data source using single connection at same time?


If we are not returning any records from the database, which method is to be used?
        
There is a method called Execute Non Query. This method executes the Update, Delete etc. This does not return any rows but will give the number of rows affected.


Which one of the following objects is a high-level abstraction of the Connection and Command objects in ADO.NET?
        
DataReader DataSet DataTable DataView DataAdapter

Answer: DataAdapter


How can we load multiple tables in to Dataset?
        
DataSet ds=new DataSet();

SqlDataAdapter dap=new SqlDataAdapter(Select * from <tablename>,<connection1>);

dap.Fill(ds,"TableOne");

SqlDataAdapter dap1=new SqlDataAdapter(Select * from <tablename>,<connection1>);

dap1.Fill(ds,"tableTwo");



What is connection String?
        
connection String - a string which contains address of the database we want to connect to.



How do you update a Dataset in ADO.Net and How do you update database through Dataset?
        
a. Update a dataset;
Dataset ds = new dataset();
SqlDataAdapter adp = new SqlDataAdapter(Query,connection);
Adp.fill(ds);
Again you can add/update Dataset as below
SqlDataAdapter adp1 = new SqlDataAdapter(Query1,connection);
Adp1.fill(ds);

b. Update database through dataset.
SqlCommandBuilder mySqlCommandBuilder = new SqlCommandBuilder(mySqlDataAdapter);
Foreach(datarow dr in ds.table[0].rows)
{
Dr[“column Name”] = “value”;
mySqlDataAdapter.Update(ds);
}



What are the steps to connect to a database?
        
1. Create a connection. This requires a connection string, which can be given declaratively or put in a well defined place like the .config files. Advantage of keeping in .config files is that it enables use of Connection Pooling by .Net framework, else even one small change in connection string will cause CLR to think it is not the same connection and will instantiate new connection for other request.



2. Open the connection and keep it open until done, typically done as using (con) { //use }



3. If using connected data model, create a SqlCommand object, decorate it with desired command, command type (stored procedure for eg), add any parameters and their values to the command, and then consume the command by using ExcuteReader or ExecuteScalar. In case of ExecuteReader, we will get back a handle to a fast-forward, read only pointer to the recordset. We can also decorate Command object with multiple recordsets in 2.0 and execute one by one (MARS - Multiple Active Record Sets)



4. If using disconnected data model, create a DataAdapter object, decorate it with desired SELECT, INSERT, UPDATE, DELETE commands, add parameters as necessary and then fill up a DataSet or DataTable using the DataAdapter. Subsequent SQL can be executed using insert, update, delete commands on the dataset.



Explain about command builder class feature?
         Implementation of INSERT, DELETE and UPDATE commands is automatic and this class provides the necessary automation. You cannot extend or change the command builder while keeping the base algorithm intact to create action statements.

Explain about Db enumerator?
         This base class is added to ADO.NET 2.0. This class facilitates the process of obtaining a list of data sources. SQL server returns instances that are available on the network. Programmers do have choice of tools in their hands with this feature.

How can you find a problem in the data stack?
         Problem can arise from these following instances they are: -
1) Mismatch of schema between the client and database.
2) Network library problems or non existence of data.
3) Wrong SQL generated.
4) Wrong programming logic.


Compare and explain about ADO.NET and Visual Stuidio.NET?
         If you are planning to create specialized sub classes of the data set then it is better to use visual studio as it has features supporting database schema. Access can be obtained to each field through strongly types properties. Intellisense is much helpful.

Explain about the relationship of XML and ADO.NET?
         ADO.NET utilizes the power of XML by providing disconnected access to data. This is designed with the help of XML classes in .NET Framework which form the components of single architecture.

What are the Advantages of ADO.Net?
        
Ado.net uses dataset for accessing the data , since the dataset is created in client side there is no need of connection at the time of working on dataset ,to the server(where the database is present), so this makes the data accessing faster mainly in the net environment.

Explain about data provider?
         ADO.NET has two primary parts in its architecture out of which one is data provider. It has its own set of objects and it consists of its own classes. Some of them are connection, parameter, data reader, command and data adapter. This provides access to data sources such as Oracle, SQL server, etc

Frequently Asked Interview Question-Answer of ASP.NET

What property is use to set alternate color scheme in a Repeater control?
         AlternatingItemTemplate.

What is the base class for Web Forms?
         The System.Web.UI.Page class.

What are the meaning of terms boxing and un-boxing?
         Boxing: Implicit conversion of a value type into a reference type. Un-Boxing: Explicit conversion of a reference type into a value type. Can also be call casting.

Give a brief description of how the heap and stack are managed in .Net.
         Stack and heap are memory sections of the .net application. The CLR(Common Language Runtime) is in charge of managing those sections. Value type variables are stored in the stack where storing order is Last in first out. When a variable is out of scope it basically fall off the stack. Refence type variable are stored on the heap where storing order is First in first out. When a variable becomes out of scope it is mark for collection. The GC(Garbage Collector) is the part of the CLR responsible for cleaning up the heap releasing resources occupied by Reference type variables.

What are advantages and disadvantages of Microsoft-provided data provider classes in ADO.NET?
         SQLServer.NET data provider is high-speed and robust, but requires SQL Server license purchased from Microsoft. OLE-DB.NET is universal for accessing other sources, like Oracle, DB2, Microsoft Access and Informix, but it is a .NET layer on top of OLE layer, so not the fastest thing in the world. ODBC.NET is a deprecated layer provided for backward compatibility to ODBC engines.

How is the DLL Hell problem solved in .NET?
         Assembly versioning allows the application to specify not only the library it needs to run (which was available under Win32), but also the version of the assembly.

What are the ways to deploy an assembly?
         An MSI installer, a CAB archive, and XCOPY command.

What is the difference between // comments, /* */ comments and /// comments?
         Single-line, multi-line and XML documentation comments.

How do you debug an ASP.NET Web application?
         Attach the aspnet_wp.exe process to the DbgClr debugger.

What is smart navigation?
         The cursor position is maintained when the page gets refreshed due to the server side validation and the page gets refreshed.


What is De-normalization?
         De-normalization is the process of attempting to optimize the performance of a database by adding redundant data. It is sometimes necessary because current DBMSs implement the relational model poorly. A true relational DBMS would allow for a fully normalized database at the logical level, while providing physical storage of data that is tuned for high performance. De-normalization is a technique to move from higher to lower normal forms of database modeling in order to speed up database access.

How to manage pagination in a page?
         Using pagination option in DataGrid control. We have to set the number of records for a page, then it takes care of pagination by itself.

Can the validation be done in the server side? Or this can be done only in the Client side?
         Client side is done by default. Server side validation is also possible. We can switch off the client side and server side can be done.

Explain the differences between Server-side and Client-side code?
         Server side scripting means that all the script will be executed by the server and interpreted as needed. ASP doesnt have some of the functionality like sockets, uploading, etc. For these you have to make a custom components usually in VB or VC++. Client side scripting means that the script will be executed immediately in the browser such as form field validation, clock, email validation, etc. Client side scripting is usually done in VBScript or JavaScript. Download time, browser compatibility, and visible code - since JavaScript and VBScript code is included in the HTML page, then anyone can see the code by viewing the page source. Also a possible security hazards for the client computer.

What is the transport protocol you use to call a Web service?
         SOAP is not the transport protocol. SOAP is the data encapsulation protocol that is used but the transport protocol is fairly unlimited. Generally HTTP is the most common transport protocol used though you could conceivanly use things like SMTP or any others. SOAP is not dependant on any single transport protocol or OS, it is a syntactical and logical definition, not a transport protocol.

What does WSDL stand for?
         Web Services Description Language

What tags do you need to add within the asp:datagrid tags to bind columns manually?
         Column tag and an ASP:databound tag.

Which control would you use if you needed to make sure the values in two different controls matched?
         Use the CompareValidator control to compare the values of 2 different controls.

How many classes can a single .NET DLL contain?
         Unlimited.

What are the properties and different Types of Sub-Queries?
         Properties of Sub-Query A sub-query must be enclosed in the parenthesis. A sub-query must be put in the right hand of the comparison operator, and A sub-query cannot contain an ORDER-BY clause. A query can contain more than one sub-query. Types of Sub-query Single-row sub-query, where the sub-query returns only one row. Multiple-row sub-query, where the sub-query returns multiple rows,. and Multiple column sub-query, where the sub-query returns multiple columns
What are the objects in asp.net and tell the purpose of those objects?
         Here are 5 objects in asp.net

1.Response:This object is to response to other e.g.:

2.Request:This object is request from server

3.Application: This object is store global information of application.

4.Session:This object used store the values into variable.

5.Server:






What tag do you use to add a hyperlink column to the DataGrid?
         <asp:HyperLinkColumn> 

Explain the ways of authentication techniques in ASP.NET
         Selection of an authentication provider is done through the entries in the web.config file for an application.
The modes of authentication are:
<authentication mode=”windows”>
<authentication mode=”passport”>
<authentication mode=”forms”>
Custom authentication needs installation of ISAPI filter in IIS. It compares incoming requests to a list of source IP addresses and a request is considered to be authenticated if it comes from an acceptable address.


What is AppSetting Section in “Web.Config” file?
         Web.config file defines configuration for a webproject.
AppSetting section is used to set the user defined values. For e.g.: The ConnectionString which is used through out the project for database connection.
<configuration>
<appSettings><BR><addkey="ConnectionString"value="server=xyz;pwd=www;database=testing" />
</appSettings>


Can a .NET web application consume Java web service ?
         Yes.Actually Webservices are independent to language. it depends on WSDL and SOAP. so any one can develope the Webservices anddisclose the wsdl and users can cosume the webservices.wsdl and soap both are xml based.. and all languages having xml parsing capability and access to http protocol will be able to work with Webservices

how to click or select a row in gridview using c# code?
         We should use the Currency CurrencyManager cmGrid = (CurrencyManager)this.BindingContext[gridview.DataSource, gridview.DataMember]; cmGrid.Position = iIndex;

What is IPostBack? How to use it?
         Ispostback event is generated by the web controls to alert the server to take respected action of the event generated. When the button is clicked then click event is generated which further cause ispostback event & it alerts the server to take respected action during postback event.

ColumnMapping belongs to which namespaces?
         ColumnMapping belongs to System.Data

Can you give an example of when it would be appropriate to use a web service as opposed to a non-serviced .NET component
         when there is no .Net framework installed in one of the communicating applications

Enumerate the types of Directives?
        
  • @ Page directive
  • @ Assembly directive
  • @ Import directive
  • @ Reference directive
  • @ Implements directive
  • @ OutputCache directive
  • @ Register directive
Which method do you invoke on the DataAdapter control to load your generated dataset with data?
        
  • dataadapter.fill(dataset object)


In order to get assembly info whcih namespace we should import?
         system.reflection

Differnce B/w DataReader and DataSet
         The Dataset is an core of disconnected architecture.Disconnected architecture means once you have retriveed the data from the database the connect of the datasource is dropped.The disconnected data become very commonlyThe dataset for the disconnected data from the Dataset object.The DataReader is an readonly ,forward only stream from the database.While using the datareader can improve the application performance reduce the system overhead because only one buffer row at a time in memory.


Explain the ASP.NET page lifecycle.
        
  • Page_Init(Initialization of the page)
  • LoadViewState(loading of View State)
  • LoadPostData(Postback data processing) 
  • Page_Load(Loading of page) 
  • RaisePostDataChangedEvent(PostBack change notification)
  • RaisePostBackEvent (PostBack event handling) 
  • Page_PreRender (Page Pre Rendering Phase) 
  • SaveViewState (View state saving) 
  • Page_Render (Page rendering)
  • Page_UnLoad (Page unloading)


ASP.NET application life cycle and events processing-
         A web application starts when a browser requests a page of the application first time. The request is received by the IIS which then starts ASP.NET worker process (aspnet_wp.exe). The worker process then allocates a process space to the assembly and loads it. An application_start event occurs followed by Session_start. The request is then processed by the ASP.NET engine and sends back response in the form of HTML. The user receives the response in the form of page. 

The page can be submitted to the server for further processing. The page submitting triggers postback event that causes the browser to send the page data, also called as view state to the server. When server receives view state, it creates new instance of the web form. The data is then restored from the view state to the control of the web form in Page_Init event.
The data in the control is then available in the Page_load event of the web form. The cached event is then handled and finally the event that caused the postback is processed. The web form is then destroyed. When the user stops using the application, Session_end event occurs and session ends. The default session time is 20 minutes. The application ends when no user accessing the application and this triggers Application_End event. Finally all the resources of the application are reclaimed by the Garbage collector.

Frequently Asked Interview Question-Answer of ASP.NET

What is Fragment Caching in ASP.NET?
         Fragment caching allows to cache specific portions of the page rather than the whole page. It is done by implementing the page in different parts............

What is partial classess in .net?
         When there is a need to keep the business logic separate from the User Interface or when there is some class which is big enough to have multiple number of developers............

What is a ViewState?
         If a site happens to not maintain a ViewState, then if a user has entered some information in a large form with many input fields and the page is refreshes, then the values filled up in the form are lost

What is the difference between src and Code-Behind?
         With the ‘src’ attribute, the source code files are deployed and are compiled by the JIT as needed. Though the code is available to everyone with an access to the server (NOT anyone on the web)

What is the Pre-Compilation feature of ASP.NET 2.0
         Previously, in ASP.NET, the pages and the code used to be compiled dynamically and then cached so as to make the requests to access the page extremely efficient

How can we create custom controls in ASP.NET
         Custom controls are user defined controls. They can be created by grouping existing controls, by deriving the control from System.Web.UI.WebControls..........

What is the difference between cookies and session? and Where we will use sessions in real time project?
         Both cookies and session are used to hold a value..but both are different because cookies is used to stored client information in client side and session is used to provide uniqueness to client request.in real time session variable is use to move data from one page to other page.and session is use for server side state management.

What’s the difference between Response.Write() andResponse.Output.Write()?
         Response.Output.Write() allows you to write formatted output.

What methods are fired during the page load?
         Init() - when the page is instantiated Load() - when the page is loaded into server memory PreRender() - the brief moment before the page is displayed to the user as HTML Unload() - when page finishes loading.

When during the page processing cycle is ViewState available?
         After the Init() and before the Page_Load(), or OnLoad() for a control.
What does the "EnableViewState" property do? Why would I want it on or off?
         It allows the page to save the users input on a form across postbacks. It saves the server-side values for a given control into ViewState, which is stored as a hidden value on the page before sending the page to the clients browser. When the page is posted back to the server the server control is recreated with the state stored in viewstate.

What are the different types of Session state management options available with ASP.NET?
         ASP.NET provides In-Process and Out-of-Process state management. In-Process stores the session in memory on the web server. This requires the a "sticky-server" (or no load-balancing) so that the user is always reconnected to the same web server. Out-of-Process Session state management stores data in an external data source. The external data source may be either a SQL Server or a State Server service. Out-of-Process state management requires that all objects stored in session are serializable.

What is the difference between Server.Transfer and Response.Redirect? Why would I choose one over the other?
         Server.Transfer transfers page processing from one page directly to the next page without making a round-trip back to the clients browser. This provides a faster response with a little less overhead on the server. Server.Transfer does not update the clients url history list or current url. Response.Redirect is used to redirect the users browser to another page or site. This performas a trip back to the client where the clients browser is redirected to the new page. The users browser history list is updated to reflect the new address

Whats an assembly?
         Assemblies are the building blocks of the .NET framework.

What is MSIL, and why should my developers need an appreciation of it if at all?
         MSIL is the Microsoft Intermediate Language. All .NET compatible languages will get converted to MSIL. MSIL also allows the .NET Framework to JIT compile the assembly on the installed computer.

What is the difference between DataList and Repeater data binding controls?
         The DataList control is similar to the Repeater control. However, it has some additional properties and templates that you can use to display its data in a diverse fashion. The Repeater control does not have any built-in layout or style. We are forced to specify all formatting-related HTML elements and style tags. On the other hand, a DataList control provides more flexibility to display data in a desired layout. It also provides data selection and editing capabilities. How does it do it? Well, in addition to the five templates (Item Template, AlternatingItem Template, Separator Template, Header Template, Footer Template that a repeater has, the DataList control has two more templates: SelectedItemTemplate, and EditItemTemplate. These templates are useful for allowing data selection and data editing functionalities. Furthermore, the RepeatDirection and RepeatColumns properties of a DataList control can be exploited to lay out the data in horizontal or vertical fashions.

How many languages .NET is supporting
         When .NET was introduced it came with several languages. VB.NET, C#, COBOL and Perl, etc. The site DotNetLanguages.Net says 44 languages are supported by .NET

How is .NET able to support multiple languages?
         A language should comply with the Common Language Runtime standard to become a .NET language. In .NET, code is compiled to Microsoft Intermediate Language (MSIL for short). This is called as Managed Code. This Managed code is run in .NET environment. So after compilation to this IL the language is not a barrier. A code can call or use a function written in another language.

What is ADO .NET and what is difference between ADO and ADO.NET?
         ADO uses Recordsets and cursors to access and modify data. Because of its inherent design, Recordset can impact performance on the server side by tying up valuable resources. In addition, COM marshalling - an expensive data conversion process - is needed to transmit a Recordset. ADO.NET addresses three important needs that ADO does not address. 1. Providing a comprehensive disconnected data-access model, which is crucial to the Web environment 2. Providing tight integration with XML, and 3. Providing seamless integration with the .NET Framework (e.g., compatibility with the base class librarys type system). From an ADO.NET implementation perspective, the Recordset object in ADO is eliminated in the .NET architecture. In its place, ADO.NET has several dedicated objects led by the DataSet object and including the DataAdapter, and DataReader objects to perform specific tasks. In addition, ADO.NET DataSets operate in disconnected state whereas the ADO RecordSet objects operated in a fully connected state. In ADO, the in-memory representation of data is the recordset. In ADO.NET, it is the dataset. A recordset looks like a single table. If a recordset is to contain data from multiple database tables, it must use a JOIN query, which assembles the data from the various database tables into a single result table. In contrast, a dataset is a collection of one or more tables. The tables within a dataset are called data tables; specifically, they are DataTable objects. If a dataset contains data from multiple database tables, it will typically contain multiple DataTable objects. That is, each DataTable object typically corresponds to a single database table or view. In this way, a dataset can mimic the structure of the underlying database. In ADO you scan sequentially through the rows of the recordset using the ADO MoveNext method. In ADO.NET, rows are represented as collections, so you can loop through a table as you would through any collection, or access particular rows via ordinal or primary key index. A cursor is a database element that controls record navigation, the ability to update data, and the visibility of changes made to the database by other users. ADO.NET does not have an inherent cursor object, but instead includes data classes that provide the functionality of a traditional cursor. For example, the functionality of a forward-only, read-only cursor is available in the ADO.NET DataReader object. There is one significant difference between disconnected processing in ADO and ADO.NET. In ADO you communicate with the database by making calls to an OLE DB provider. In ADO.NET you communicate with the database through a data adapter (an OleDbDataAdapter, SqlDataAdapter, OdbcDataAdapter, or OracleDataAdapter object), which makes calls to an OLE DB provider or the APIs provided by the underlying data source.

List all Validation Controls available in asp .net?
         RequiredFieldValidator : Checks if a control has a value. RangeValidator : Checks if the control’s value is within a certain range. RegularExpressionValidator : Checks whether the value of an input control matches a certain pattern CompareValidator : Checks a control’s value against a constant or another control value. CustomValidator : Checks a control’s value against a customized validation logic. ValidationSummary : Displays a list of all validation errors
  
 

Common Interview Questions and Answers


Review these typical interview questions and think about how you would answer them. Read the questions listed; you will also find some strategy suggestions with it.

1. Tell me about yourself:
The most often asked question in interviews. You need to have a short statement prepared in your mind. Be careful that it does not sound rehearsed. Limit it to work-related items unless instructed otherwise. Talk about things you have done and jobs you have held that relate to the position you are interviewing for. Start with the item farthest back and work up to the present.

2. Why did you leave your last job?
Stay positive regardless of the circumstances. Never refer to a major problem with management and never speak ill of supervisors, co- workers or the organization. If you do, you will be the one looking bad. Keep smiling and talk about leaving for a positive reason such as an opportunity, a chance to do something special or other forward- looking reasons.

3. What experience do you have in this field?
Speak about specifics that relate to the position you are applying for. If you do not have specific experience, get as close as you can.

4. Do you consider yourself successful?
You should always answer yes and briefly explain why. A good explanation is that you have set goals, and you have met some and are on track to achieve the others.

5. What do co-workers say about you?
Be prepared with a quote or two from co-workers. Either a specific statement or a paraphrase will work. Jill Clark, a co-worker at Smith Company, always said I was the hardest workers she had ever known. It is as powerful as Jill having said it at the interview herself.

6. What do you know about this organization?
This question is one reason to do some research on the organization before the interview. Find out where they have been and where they are going. What are the current issues and who are the major players?

7. What have you done to improve your knowledge in the last year?
Try to include improvement activities that relate to the job. A wide variety of activities can be mentioned as positive self-improvement. Have some good ones handy to mention.

8. Are you applying for other jobs?
Be honest but do not spend a lot of time in this area. Keep the focus on this job and what you can do for this organization. Anything else is a distraction.

9. Why do you want to work for this organization?
This may take some thought and certainly, should be based on the research you have done on the organization. Sincerity is extremely important here and will easily be sensed. Relate it to your long-term career goals.

10. Do you know anyone who works for us?
Be aware of the policy on relatives working for the organization. This can affect your answer even though they asked about friends not relatives. Be careful to mention a friend only if they are well thought of.

11. What kind of salary do you need?
A loaded question. A nasty little game that you will probably lose if you answer first. So, do not answer it. Instead, say something like, That's a tough question. Can you tell me the range for this position? In most cases, the interviewer, taken off guard, will tell you. If not, say that it can depend on the details of the job. Then give a wide range.

12. Are you a team player?
You are, of course, a team player. Be sure to have examples ready. Specifics that show you often perform for the good of the team rather than for yourself are good evidence of your team attitude. Do not brag, just say it in a matter-of-fact tone. This is a key point.

13. How long would you expect to work for us if hired?
Specifics here are not good. Something like this should work: I'd like it to be a long time. Or As long as we both feel I'm doing a good job.

14. Have you ever had to fire anyone? How did you feel about that?
This is serious. Do not make light of it or in any way seem like you like to fire people. At the same time, you will do it when it is the right thing to do. When it comes to the organization versus the individual who has created a harmful situation, you will protect the organization. Remember firing is not the same as layoff or reduction in force.

15. What is your philosophy towards work?
The interviewer is not looking for a long or flowery dissertation here. Do you have strong feelings that the job gets done? Yes. That's the type of answer that works best here. Short and positive, showing a benefit to the organization.

16. If you had enough money to retire right now, would you?
Answer yes if you would. But since you need to work, this is the type of work you prefer. Do not say yes if you do not mean it.

17. Have you ever been asked to leave a position?
If you have not, say no. If you have, be honest, brief and avoid saying negative things about the people or organization involved.

18. Explain how you would be an asset to this organization.
You should be anxious for this question. It gives you a chance to highlight your best points as they relate to the position being discussed. Give a little advance thought to this relationship.

19. Why should we hire you?
Point out how your assets meet what the organization needs. Do not mention any other candidates to make a comparison.

20. Tell me about a suggestion you have made.
Have a good one ready. Be sure and use a suggestion that was accepted and was then considered successful. One related to the type of work applied for is a real plus.

21. What irritates you about co-workers?
This is a trap question. Think real hard but fail to come up with anything that irritates you. A short statement that you seem to get along with folks is great.

22. What is your greatest strength?
Numerous answers are good, just stay positive. A few good examples: Your ability to prioritize, Your problem-solving skills, Your ability to work under pressure, Your ability to focus on projects, Your professional expertise, Your leadership skills, Your positive attitude

23. Tell me about your dream job.
Stay away from a specific job. You cannot win. If you say the job you are contending for is it, you strain credibility. If you say another job is it, you plant the suspicion that you will be dissatisfied with this position if hired. The best is to stay genetic and say something like: A job where I love the work, like the people, can contribute and can't wait to get to work.

24. Why do you think you would do well at this job?
Give several reasons and include skills, experience and interest.

25. What are you looking for in a job?
See answer # 23

26. What kind of person would you refuse to work with?
Do not be trivial. It would take disloyalty to the organization, violence or lawbreaking to get you to object. Minor objections will label you as a whiner.

27. What is more important to you: the money or the work?
Money is always important, but the work is the most important. There is no better answer.

28. What would your previous supervisor say your strongest point is?
There are numerous good possibilities:
Loyalty, Energy, Positive attitude, Leadership, Team player, Expertise, Initiative, Patience, Hard work, Creativity, Problem solver

29. Tell me about a problem you had with a supervisor.
Biggest trap of all. This is a test to see if you will speak ill of your boss. If you fall for it and tell about a problem with a former boss, you may well below the interview right there. Stay positive and develop a poor memory about any trouble with a supervisor.

30. What has disappointed you about a job?
Don't get trivial or negative. Safe areas are few but can include:
Not enough of a challenge. You were laid off in a reduction Company did not win a contract, which would have given you more responsibility.

31. Tell me about your ability to work under pressure.
You may say that you thrive under certain types of pressure. Give an example that relates to the type of position applied for.

32. Do your skills match this job or another job more closely?
Probably this one. Do not give fuel to the suspicion that you may want another job more than this one.

33. What motivates you to do your best on the job?
This is a personal trait that only you can say, but good examples are: Challenge, Achievement, Recognition

34. Are you willing to work overtime? Nights? Weekends?
This is up to you. Be totally honest.

35. How would you know you were successful on this job?
Several ways are good measures: You set high standards for yourself and meet them. Your outcomes are a success.Your boss tell you that you are successful

36. Would you be willing to relocate if required?
You should be clear on this with your family prior to the interview if you think there is a chance it may come up. Do not say yes just to get the job if the real answer is no. This can create a lot of problems later on in your career. Be honest at this point and save yourself uture grief.

37. Are you willing to put the interests of the organization ahead of your own?
This is a straight loyalty and dedication question. Do not worry about the deep ethical and philosophical implications. Just say yes.

38. Describe your management style.
Try to avoid labels. Some of the more common labels, like progressive, salesman or consensus, can have several meanings or descriptions depending on which management expert you listen to. The situational style is safe, because it says you will manage according to the situation, instead of one size fits all.

39. What have you learned from mistakes on the job?
Here you have to come up with something or you strain credibility. Make it small, well intentioned mistake with a positive lesson learned. An example would be working too far ahead of colleagues on a project and thus throwing coordination off.

40. Do you have any blind spots?
Trick question. If you know about blind spots, they are no longer blind spots. Do not reveal any personal areas of concern here. Let them do their own discovery on your bad points. Do not hand it to them.

41. If you were hiring a person for this job, what would you look for?
Be careful to mention traits that are needed and that you have.

42. Do you think you are overqualified for this position?
Regardless of your qualifications, state that you are very well qualified for the position.

43. How do you propose to compensate for your lack of experience?
First, if you have experience that the interviewer does not know about, bring that up: Then, point out (if true) that you are a hard working quick learner.

44. What qualities do you look for in a boss?
Be generic and positive. Safe qualities are knowledgeable, a sense of humor, fair, loyal to subordinates and holder of high standards. All bosses think they have these traits.

45. Tell me about a time when you helped resolve a dispute between others.
Pick a specific incident. Concentrate on your problem solving technique and not the dispute you settled.

46. What position do you prefer on a team working on a project?
Be honest. If you are comfortable in different roles, point that out.

47. Describe your work ethic.
Emphasize benefits to the organization. Things like, determination to get the job done and work hard but enjoy your work are good.

48. What has been your biggest professional disappointment?
Be sure that you refer to something that was beyond your control. Show acceptance and no negative feelings.

49. Tell me about the most fun you have had on the job.
Talk about having fun by accomplishing something for the organization.

50. Do you have any questions for me?
Always have some questions prepared. Questions prepared where you will be an asset to the organization are good. How soon will I be able to be productive? and What type of projects will I be able to assist on? are examples.

Wednesday, September 22, 2010

பெரியகோயில் 1000 ஆண்டு நிறைவு விழாக்கோலம் பூண்டது

தஞ்சை: தஞ்சை பெரியகோயிலின் ஆயிரம் ஆண்டு நிறைவு விழா இன்று மாலை தொடங்கி 5 நாட்கள் நடைபெறுகிறது. தமிழர்களின் வீரத்திற்கும், கட்டிட கலைக்கும் சான்றாக விளங்குகிறது தஞ்சை பிரகதீஸ்வரர் ஆலயம். போரில் வெற்றிகண்ட மன்னன் ராஜராஜசோழன் வெற்றிச்சின்னமாக கட்டிய இந்த கோயில் ஆயிரம் ஆண்டுகளை நிறைவு செய்து இன்னும் கம்பீரமாக காட்சியளிக்கிறது. பெரிய கோயில் என்று அழைக்கப்படும் இந்த கோயிலை உலக பாரம்பரிய சின்னமாக யுனெஸ்கோ நிறுவனம் அறிவித்து உள்ளது.

பெரிய கோயிலின் ஆயிரம் ஆண்டு நிறைவு விழாவை தமிழக அரசு இன்று முதல் 5 நாட்கள் தஞ்சையில் கோலாகலமாக கொண்டாடுகிறது. இதையொட்டி கலைநிகழ்ச்சிகள், கருத்தரங்குகள், ஆய்வரங்குள் நடத்தவும் ஏற்பாடு செய்யப்பட்டு உள்ளது. விழாவுக்காக தஞ்சை நகரில் பல்வேறு அடிப்படை வசதிகள் நிறைவேற்றப்பட்டு நகரம் அழகுபடுத்தப்பட்டு விழாக்கோலம் பூண்டுள்ளது.
இன்று மாலை 5.30 மணிக்கு பெரியகோயிலில் தொடங்கும் விழாவில், சீர்காழி சிவசிதம்பரம், சுதா ரகுநாதனின் இசை நிகழ்ச்சி நடைபெறுகிறது.

பாதுகாப்பு பணியில் 10 ஆயிரம் போலீசார் ஈடுபடுகின்றனர். குற்றங்களை தடுக்கும் வகையில் நகரில் 21 இடங்களில் சுழல் கேமராக்கள் பொருத்தப்பட்டு உள்ளன. சிறப்பு காவல் கட்டுப்பாட்டு அறையும் திறக்கப்பட்டு உள்ளது.
பெரியகோயில் ஆயிரமாவது ஆண்டு நிறைவு விழா நிகழ்ச்சிகள் அனைத்தையும் உலகம் முழுவதும் மக்கள் பார்த்து ரசிக்கும் வகையில் www.thanjavur.tn.nic.in/ bibtemple/btcontact.htm/ என்ற இணைய தளம் உருவாக்கப்பட்டுள்ளது.

State Management in Asp.net

Here I will show you step by step procedure how to maintain states in ASP.NET in Visual Studio 2005/2008.

The use of state implementation is that a numeric values will show you that how many times your web page has been opened or refreshed or loaded.

Here I am using Visual Studio 2008 but there is no condition you can use Visual Studio 2005 also.

So follow these steps to create State Implementation

The steps are:

1- Start -> All Programs -> Visual Studio 2005 or Visual Studio 2008

Now the Visual Studio will open like this:-


1.jpg

2- Now go to File Menu -> New -> Web Site

When you will click on the "New Web Site" a new window will open like this:-

2.jpg

3- Under Visual Studio Installed Template-> Choose ASP.NET WEB SITE -> Choose File System from the location combo box -> Set the path by the browse button - > Choose the language from the Language ComboBox (Visual C# , Visual Basic , J #)

Choose Visual C#

4 - Click on the OK Button:-

Now you will see a new from like this :-

3.jpg

First you have to learn XML and HTML to work with ASP .NET.

I have used to make the text as comment this is the way to make comment in this code ...
Inside the tags just u type line by line.....
Page Language="C#" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="_Default"
!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"
html xmlns="http://www.w3.org/1999/xhtml"
head id="Head1" runat="server"
title:
form id="form1″ runat="server"
div
In between div tags you can manage your web controls like buttons, labels, picture
Box, ImageMap etc
See here is a tab named Design in the bottom of this page

5- Click on this tab and you will see a blank web page where you can drag any control from the toolbox (which is in the left side of this window)

6- Drag a Label Control in the design window or in the source window...

7-Now write this code on the top of the source window
Inside the tags place it...
%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="_Default" %
script runat="server"

protected void Page_Load(object sender, EventArgs e)

{

Application["visits"] = (int)Application["visits"] + 1;

Label1.Text = Application["visits"].ToString();

}

/script
8- Now go to solution explorer and right click on the web site and choose Add New Item and add a .asax extension file.

9- Now type this code in the .asax extension file
<%@ Application Language="C#" %>

script runat="server"

void Application_Start(object sender, EventArgs e)

{

// Code that runs on application startup

Application["visits"] = 0;

}

/script


10 - Now run your web site by Ctrl + F5

11- Refresh your web page...

What’s New in .NET 3.5?

What’s New in .NET 3.5?

It is a good idea to know ‘What’s New in .NET 3.5′ before going to use it.



ASP.NET



ü Support for enabling existing ASP.NET 2.0 pages for AJAX

ü Creation of ASMX & WCF based web services and consuming them from AJAX Library

ü ASP.NET server side application services like authentication, roles management exposed as web services

ü ASP.NET Merge Tool – a new tool for merging pre-compiled assemblies

ü New ListView control which supports edit, insert, delete, sorting & paging

ü ASP.NET integrated with core IIS 7.0 which makes ASP.NET services like authentication & caching available for other content types also.

ü Microsoft AJAX Library to support AJAX based web development



Base Classes & CLR



ü Support for CSharp 3.5 including LINQ.

ü HashSet: A high performance collection of type set.

ü Time Zone Improvements : to develop applications which operate in multiple time zones

ü Minor Improvements in Threading, Reflection and controlling the GC behavior



Others



ü Client Application Services: All windows based application to use ASP.NET login, roles and profile services hosted on central server.

ü Occasionally Connected Services (OCS): keeps windows application’s local and remote data in sync.

ü ‘Silver’ : code name for a new technology which unifies WF and WCF

WCF Syndication: WCF services exposing syndication feeds. Supports Atom 1.0 and RSS 2.0

Tuesday, August 31, 2010

How to capture the screen easily?

Capture the screen easily!

Screen capture software


What is Gadwin PrintScreen?


Who needs Gadwin PrintScreen?


Why Gadwin PrintScreen?


System Requirement.


What is Gadwin PrintScreen?

Want to create a screenshot suitable for saving or printing? Then just hit a key on your keyboard. Oh yeah, you'll have to download this program first.

There are several hotkey combos to choose from (PrintScreen is the default). Once you've chosen your favorite combo, head to the Destination tab and have the screen print out instantly, copy the capture to the clipboard, save it to a specific folder, or even send it through e-mail. You can perform full screen captures, or only capture a specific window.


Gadwin PrintScreen is an easy to use freeware utility that allows you to capture any portion of the screen, save it to a file, copy it to Windows clipboard, print it or e-mail it to a recipient of your choice.

There are also six different image formats to choose from, and each one can be resized. With all the customization capabilities, what more could you ask for?

Gadwin PrintScreen Professional combines the power of a first-class screen capture application with an advanced image editing and annotation utility - wrapped into one easy-to-use tool. Gadwin PrintScreen Professional is versatile and extremely easy-to-use.


Who needs Gadwin PrintScreen?

Screen captures can be used for many reasons. Use captured images from Gadwin PrintScreen to show off your product on the web. Enhance technical or sales documents and embed captures into presentations. Gadwin PrintScreen can help you capture and print or save computer screen data.

Why Gadwin PrintScreen?

On most Windows computers a full screen of data can be put on the clipboard by pressing the PrintScreen key. This sends whatever you see on screen to the clipboard, which you must then edit in a different graphics program to cut to the right size and image format. Here are some other reasons not to use the prefabricated PrintScreen function of Windows:


Full screen of data can be put only on the clipboard.



It is either difficult or impossible to capture some elements of a Windows screen, such as different shaped cursors.


You spend too much time making image captures.

Use Gadwin PrintScreen to save time and enhance your screen shots! Download Gadwin PrintScreen now and try it out! This is the best way to learn what it can do.

System Requirement.

Gadwin PrintScreen requires Microsoft ® Windows 98/Me/2000/2003/XP/Vista, or Windows NT 4.0SP6. If you are running any of these operating systems and have a Windows-compatible mouse or pointing device, your system has already met all the requirements necessary to run Gadwin PrintScreen. A full installation of Gadwin PrintScreen requires 5 megabyte of hard drive space.

.NET Basics Interview Q & A

1.    What is .NET / .NET Framework?
         It is a Framework in which Windows applications may be developed and run. The Microsoft .NET Framework is a platform for building, deploying, and running Web Services and applications. It provides a highly productive, standards-based, multi-language environment for integrating existing investments with next-generation applications and services as well as the agility to solve the challenges of deployment and operation of Internet-scale applications. The .NET Framework consists of three main parts: the common language runtime, a hierarchical set of unified class libraries, and a componentized version of Active Server Pages called ASP.NET. The .NET Framework provides a new programming model and rich set of classes designed to simplify application development for Windows, the Web, and mobile devices. It provides full support for XML Web services, contains robust security features, and delivers new levels of programming power. The .NET Framework is used by all Microsoft languages including Visual C#, Visual J#, and Visual C++. 
2.How many languages .NET is supporting now? - When .NET was introduced it came with several languages. VB.NET, C#, COBOL and Perl, etc. The site DotNetLanguages.Net says 72 languages to support.


3.How is .NET able to support multiple languages? - a language should comply with the Common Language Runtime standard to become a .NET language. In .NET, code is compiled to Microsoft Intermediate Language (MSIL for short). This is called as Managed Code. This Managed code is run in .NET environment. So after compilation to this IL the language is not a barrier. A code can call or use a function written in another language.



4.How ASP .NET different from ASP? - Scripting is separated from the HTML, Code is compiled as a DLL, these DLLs can be executed on the server.


  1. What is smart navigation? - The cursor position is maintained when the page gets refreshed due to the server side validation and the page gets refreshed.
  2. What is view state? - The web is stateless. But in ASP.NET, the state of a page is maintained in the in the page itself automatically. How? The values are encrypted and saved in hidden controls. this is done automatically by the ASP.NET. This can be switched off / on for a single control
  3. Explain the life cycle of an ASP .NET page.
  4. How do you validate the controls in an ASP .NET page? - Using special validation controls that are meant for this. We have Range Validator, Email Validator.
  5. Can the validation be done in the server side? Or this can be done only in the Client side? - Client side is done by default. Server side validation is also possible. We can switch off the client side and server side can be done.
  6. How to manage pagination in a page? - Using pagination option in DataGrid control. We have to set the number of records for a page, then it takes care of pagination by itself.
  7. What is ADO .NET and what is difference between ADO and ADO.NET? - ADO.NET is stateless mechanism. I can treat the ADO.Net as a separate in-memory database where in I can use relationships between the tables and select insert and updates to the database. I can update the actual database as a batch.
  8. What is Reflection?
    It extends the benefits of metadata by allowing developers to inspect and use it at runtime. For example, dynamically determine all the classes contained in a given assembly and invoke their methods. Reflection provides objects that encapsulate assemblies, modules, and types. You can use reflection to dynamically create an instance of a type, bind the type to an existing object, or get the type from an existing object. You can then invoke the type's methods or access its fields and properties. Namespace: System.Reflection

     

Monday, August 30, 2010

DotNet Basic Questions

1.What is CLR?
 Full form of CLR is Common Language Runtime and it forms the heart of the .NET
framework.All Languages have runtime and its the responsibility of the runtime to take care of
the code execution of the program.
2. What is Garbage Collection?
Garbage Collection :- CLR automatically manages memory thus eliminating
memory leakes. When objects are not referred GC automatically releases those
memory thus providing efficient memory management.
3. What is CAS?
 Code Access Security :- CAS grants rights to program depending on the security
configuration of the machine.Example the program has rights to edit or create
a new file but the security configuration of machine does not allow the program
to delete a file.CAS will take care that the code runs under the environment of
machines security configuration.
5.Define Code Verification
Code Verification :- This ensures proper code execution and type safety while
the code runs.It prevents the source code to perform illegal operation such as
accessing invalid memory locations etc.
6. What is IL?
 IL( Intermediate language )-to-native translators and optimizer?s :- CLR uses
JIT and compiles the IL code to machine code and then executes. CLR also
determines depending on platform what is optimized way of running the IL.

Tuesday, August 24, 2010

How to Access webservice in Asp.net using SqlServer

 Steps To Follow:


1. File -> New Website ->Asp.net Webservice ->Click

2. In S.E ->App_code->Service.vb-><webmethod>_

3. Create Another Function related for ur database access. Just an example follows:

           Public Function getviews() As DataSet
        Dim con As New SqlConnection("server=.;database=sample;uid=sa;pwd=csbdu;")
        Dim da As New SqlDataAdapter("select * from emp", con)
        Dim ds As New DataSet()
        da.Fill(ds, "emp")
        Return ds
    End Function

Before that Import Namespaces like Imports System.Data,Imports System.Data.Sqlclient

4. Press F5 or Debug ur Webservice. U have Two methods like HelloWorld and Getviews:

5. Copy that URL and Paste into newly create Web application.

How to paste in WebApplication:

6. File -> New Website->click.

7. In S.E->rightClick->Add Webreference->Click


8. Paste that URL in Corresponding Location. Press Add Reference. Localhost 3 files to generated. files like .disco,.discomap,.wsdl.


9. In Default.aspx page add ur controls like gridview, multiview and so on related for ur local webservice.


        In my example, i follow the gridview control. In Default.aspx fix gridview and Button control. 
While u clicking the button control,enter the code follows


           Dim obj As New Mydbservice.Service
           GridView1.DataSource = obj.getviews
        GridView1.DataBind()







9. Press F5 or Debug ur Web Application.


Hope u will get .....

Monday, August 23, 2010

How to run webservice in Asp.Net

Steps to Create Webservice:

1.File->New Website->Select Asp.net Webservice->save ur webservice

2.In solution Explorer->App_code->service.vb-><Webmethod>_->write ur Code.

3. Create New Method like <Webmethod>_

         Public function add(a as integer,b as integer) as integer
return (a +b)
end function

4. Press F5 to run ur webservice or Debug ur webservice.

5. Add link button will be display on the output window.copy that URL before clicking Add. click Add that button u have 2 texboxes give ur input and press invoke button. XML output will display.

6. Create a new website application->S.E->Add webreference->paste that URL -> localhost->AddReference->3 files to be generated under the localhost service.

7. Drag and drop the required controls and when u click the Button u write this code;

        dim a,b,c as integer
     Assign ur textbox into a,b like a= textbox1.text and b=textbox2.text
      dim obj as new localhost.service
      c=obj.add(a,b)
      response.write(c)

8.Press F5 to run the web application.

      

Sanjheevi Academics

I Completed my schoolings in 1999. Next move to UG Mathematics in Arts & Science and then move to PG (Master of  Computer Applications) in Engineering Streams in between gap i done my PG Mathematics in distance Education.