Why Do I Get The Error Message "object Must Implement Iconvertible". How Can I Resolve It?
The common cause for this error is specifying a control as a SqlParameter's Value instead of the control's text value.For example, if you write code as below you'll get the above error
VB.NET
Dim nameParameter As SqlParameter = command.Parameters.Add ("@name",SqlDbType.NVarChar,50)
nameParameter.Value = txtName
C#
SqlParameter nameParameter = command.Parameters.Add("@name", SqlDbType.NVarChar, 50);
nameParameter.Value = txtName ;
To resolve it, specify the control's Text property instead of the control itself.
VB.NET
nameParameter.Value = txtName.Text
C#
nameParameter.Value =txtName.Text;
Suppose You Want A Certain Asp.net Function Executed On Mouseover For A Certain Button. Where Do You Add An Event Handler?
Add an OnMouseOver attribute to the button.
Example: btnSubmit.Attributes.Add ("onmouseover","someClient CodeHere();");
What Data Types Do The Rangevalidator Control Support?
Integer, String, and Date.
Explain The Differences Between Server-side And Client-side Code?
Server-side code executes on the server. Client-side code executes in the client's browser.
What Type Of Code (server Or Client) Is Found In A Code-behind Class?
The is server-side code since code-behind is executed on the server. However, during the code-behind's execution on the server, it can render client-side code such as JavaScript to be processed in the clients browser. But just to be clear, code-behind executes on the server, thus making it server-side code.
Should User Input Data Validation Occur Server-side Or Client-side? Why?
All user input data validation should occur on the server at a minimum. Additionally, client-side validation can be performed where deemed appropriate and feasable to provide a richer, more responsive experience for the user.
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 client's 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 user's browser to another page or site. This perform as a trip back to the client where the client's browser is redirected to the new page. The user's browser history list is updated to reflect the new address.
Can You Explain The Difference Between An Ado.net Dataset And An Ado Recordset?
Valid s are
A DataSet can represent an entire relational database in memory, complete with tables, relations, and views.
A DataSet is designed to work without any continuing connection to the original data source.
Data in a DataSet is bulk-loaded, rather than being loaded on demand.
There's no concept of cursor types in a DataSet.
DataSets have no current record pointer You can use For Each loops to move through the data.
You can store many edits in a DataSet, and write them to the original data source in a single operation.
Though the DataSet is universal, other objects in ADO.NET come in different versions for different data sources.
What Is The Global.asax Used For?
The Global.asax (including the Global.asax.cs file) is used to implement application and session level events.
What Are The Application_start And Session_start Subroutines Used For?
This is where you can set the specific variables for the Application and Session objects.
Can You Explain What Inheritance Is And An Example Of When You Might Use It?
When you want to inherit (use the functionality of) another class.Example: With a base class named Employee, a Manager class could be derived from the Employee base class.
What Is Viewstate?
ViewState allows the state of objects (serializable) to be stored in a hidden field on the page. ViewState is transported to the client and back to the server, and is not stored on the server or any other external source. ViewState is used the retain the state of server-side objects between postbacks.
What Is The Lifespan For Items Stored In Viewstate?
Item stored in ViewState exist for the life of the current page. This includes postbacks (to the same page).
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 re connected 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.
Let's Say I Have An Existing Application Written Using Visual Studio 6 (vb 6, Interdev 6) And This Application Utilizes Windows 2000 Com+ Transaction Services. How Would You Approach Migrating This Application To .net
You have to use System.EnterpriseServices namespace and also COMInterop the existing application.
Can You Give An Example Of What Might Be Best Suited To Place In The Application_start And Session_start Subroutines?
In the Application_Start event you could store the data, which is used throughout the life time of an application for example application name, where as Session_Start could be used to store the information, which is required for that session of the application say for example user id or user name.
If Iam Developing An Application That Must Accomodate Multiple Security Levels Though Secure Login And My Asp.net Web Appplication Is Spanned Across Three Web-servers (using Round-robbin Load Balancing) What Would Be The Best Approach To Maintain Login-in State For The Users?
Use the state server or store the state in the database. This can be easily done through simple setting change in the web.config.
<sessionState mode="InProc" stateConnection String= "tcpip=127.0.0. 1:42424" sqlConnectionString="data source=127.0.0.1;user id=sa; password=" cookieless="false" timeout="30"/>
in the above one instead of mode="InProc", you specifiy stateserver or sqlserver.
What Are Asp.net Web Forms? How Is This Technology Different Than What Is Available Though Asp (1.0-3.0)?
ASP.NET webforms are analogous to Windows Forms which are available to most VB developers. A webform is essentially a core container in a Page. An empty webform is nothing but a HTML Form tag(control) running at server and posting form to itself by default, but you could change it to post it to something else. This is a container, and you could place the web controls, user controls and HTML Controls in that one and interact with user on a postback basis.
How Does Vb.net/c# Achieve Polymorphism?
Polymorphism is achieved through virtual, overloaded, overridden methods in C# and VB.NET.
Describe Session Handling In A Webform, How Does It Work And What Are The Its Limits?
Sometimes it is necessary to carry a particular session data across pages, and HTTP is a stateless protocol. In order to maintain state between page calls, we could use cookies, hidden form fields etc. One of them is using sessions. each sessions are maintain a unique key on the server and serialize the data on it. Actually it is a hashtable and stores data on key/value pair of combination. You could set a session using Session Object and retrieve the same data/state by passing the key.
//Set
Session["abc"] = "Session Value";
// Get
string abc = Session["abc"].ToString();
The downside of sessions is scalability. Say your application gets more and more hits and you though instead of one webserver handling it, have it in a webform (multiple web servers working under one domain). You cannot transfer the session so easily across multiple webservers. it physically serializes the state data to webserver hard disk. .NET proposes a new way to handle this using a stateserver (actually a trimmed down sql server) storing the web session data in a factory configured database schema or using Database with your own schema defined to handle the sessions.
Whats An Assembly?
Assemblies are the building blocks of the .NET framework. Overview of assemblies from MSDN.
Describe The Difference Between Inline And Code Behind?
Inline code is written along with the html code in a page. Code-behind is code written in a separate file and referenced by the .aspx page.
Explain What A Diffgram Is, And A Good Use For One?
The DiffGram is one of the two XML formats that you can use to render DataSet object contents to XML. A good use is reading database data to an XML file to be sent to a Web Service.
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.
Which Method Do You Invoke On The Dataadapter Control To Load Your Generated Dataset With Data?
The Fill() method.
Can You Edit Data In The Repeater Control?
No,
it just reads the information from its data source.
Which Template Must You Provide, In Order To Display Data In A Repeater Control?
ItemTemplate.
The common cause for this error is specifying a control as a SqlParameter's Value instead of the control's text value.For example, if you write code as below you'll get the above error
VB.NET
Dim nameParameter As SqlParameter = command.Parameters.Add ("@name",SqlDbType.NVarChar,50)
nameParameter.Value = txtName
C#
SqlParameter nameParameter = command.Parameters.Add("@name", SqlDbType.NVarChar, 50);
nameParameter.Value = txtName ;
To resolve it, specify the control's Text property instead of the control itself.
VB.NET
nameParameter.Value = txtName.Text
C#
nameParameter.Value =txtName.Text;
Add an OnMouseOver attribute to the button.
Example: btnSubmit.Attributes.Add ("onmouseover","someClient CodeHere();");
What Data Types Do The Rangevalidator Control Support?
Integer, String, and Date.
Explain The Differences Between Server-side And Client-side Code?
Server-side code executes on the server. Client-side code executes in the client's browser.
What Type Of Code (server Or Client) Is Found In A Code-behind Class?
The is server-side code since code-behind is executed on the server. However, during the code-behind's execution on the server, it can render client-side code such as JavaScript to be processed in the clients browser. But just to be clear, code-behind executes on the server, thus making it server-side code.
Should User Input Data Validation Occur Server-side Or Client-side? Why?
All user input data validation should occur on the server at a minimum. Additionally, client-side validation can be performed where deemed appropriate and feasable to provide a richer, more responsive experience for the user.
Apple Most Frequently Asked Latest ASP.NET Interview Questions Answers |
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 client's 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 user's browser to another page or site. This perform as a trip back to the client where the client's browser is redirected to the new page. The user's browser history list is updated to reflect the new address.
Can You Explain The Difference Between An Ado.net Dataset And An Ado Recordset?
Valid s are
A DataSet can represent an entire relational database in memory, complete with tables, relations, and views.
A DataSet is designed to work without any continuing connection to the original data source.
Data in a DataSet is bulk-loaded, rather than being loaded on demand.
There's no concept of cursor types in a DataSet.
DataSets have no current record pointer You can use For Each loops to move through the data.
You can store many edits in a DataSet, and write them to the original data source in a single operation.
Though the DataSet is universal, other objects in ADO.NET come in different versions for different data sources.
What Is The Global.asax Used For?
The Global.asax (including the Global.asax.cs file) is used to implement application and session level events.
What Are The Application_start And Session_start Subroutines Used For?
This is where you can set the specific variables for the Application and Session objects.
Can You Explain What Inheritance Is And An Example Of When You Might Use It?
When you want to inherit (use the functionality of) another class.Example: With a base class named Employee, a Manager class could be derived from the Employee base class.
What Is Viewstate?
ViewState allows the state of objects (serializable) to be stored in a hidden field on the page. ViewState is transported to the client and back to the server, and is not stored on the server or any other external source. ViewState is used the retain the state of server-side objects between postbacks.
What Is The Lifespan For Items Stored In Viewstate?
Item stored in ViewState exist for the life of the current page. This includes postbacks (to the same page).
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 re connected 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.
Let's Say I Have An Existing Application Written Using Visual Studio 6 (vb 6, Interdev 6) And This Application Utilizes Windows 2000 Com+ Transaction Services. How Would You Approach Migrating This Application To .net
You have to use System.EnterpriseServices namespace and also COMInterop the existing application.
Can You Give An Example Of What Might Be Best Suited To Place In The Application_start And Session_start Subroutines?
In the Application_Start event you could store the data, which is used throughout the life time of an application for example application name, where as Session_Start could be used to store the information, which is required for that session of the application say for example user id or user name.
If Iam Developing An Application That Must Accomodate Multiple Security Levels Though Secure Login And My Asp.net Web Appplication Is Spanned Across Three Web-servers (using Round-robbin Load Balancing) What Would Be The Best Approach To Maintain Login-in State For The Users?
Use the state server or store the state in the database. This can be easily done through simple setting change in the web.config.
<sessionState mode="InProc" stateConnection String= "tcpip=127.0.0. 1:42424" sqlConnectionString="data source=127.0.0.1;user id=sa; password=" cookieless="false" timeout="30"/>
in the above one instead of mode="InProc", you specifiy stateserver or sqlserver.
What Are Asp.net Web Forms? How Is This Technology Different Than What Is Available Though Asp (1.0-3.0)?
ASP.NET webforms are analogous to Windows Forms which are available to most VB developers. A webform is essentially a core container in a Page. An empty webform is nothing but a HTML Form tag(control) running at server and posting form to itself by default, but you could change it to post it to something else. This is a container, and you could place the web controls, user controls and HTML Controls in that one and interact with user on a postback basis.
How Does Vb.net/c# Achieve Polymorphism?
Polymorphism is achieved through virtual, overloaded, overridden methods in C# and VB.NET.
Describe Session Handling In A Webform, How Does It Work And What Are The Its Limits?
Sometimes it is necessary to carry a particular session data across pages, and HTTP is a stateless protocol. In order to maintain state between page calls, we could use cookies, hidden form fields etc. One of them is using sessions. each sessions are maintain a unique key on the server and serialize the data on it. Actually it is a hashtable and stores data on key/value pair of combination. You could set a session using Session Object and retrieve the same data/state by passing the key.
//Set
Session["abc"] = "Session Value";
// Get
string abc = Session["abc"].ToString();
The downside of sessions is scalability. Say your application gets more and more hits and you though instead of one webserver handling it, have it in a webform (multiple web servers working under one domain). You cannot transfer the session so easily across multiple webservers. it physically serializes the state data to webserver hard disk. .NET proposes a new way to handle this using a stateserver (actually a trimmed down sql server) storing the web session data in a factory configured database schema or using Database with your own schema defined to handle the sessions.
Whats An Assembly?
Assemblies are the building blocks of the .NET framework. Overview of assemblies from MSDN.
Describe The Difference Between Inline And Code Behind?
Inline code is written along with the html code in a page. Code-behind is code written in a separate file and referenced by the .aspx page.
Explain What A Diffgram Is, And A Good Use For One?
The DiffGram is one of the two XML formats that you can use to render DataSet object contents to XML. A good use is reading database data to an XML file to be sent to a Web Service.
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.
Which Method Do You Invoke On The Dataadapter Control To Load Your Generated Dataset With Data?
The Fill() method.
Can You Edit Data In The Repeater Control?
No,
it just reads the information from its data source.
Which Template Must You Provide, In Order To Display Data In A Repeater Control?
ItemTemplate.
Post a Comment