Followers

Thursday, August 26, 2004

Error while running web service

I get this Error while running the application that was created in VS.NET
2003 converted to VS.NET 2002. I have put this application in wwwRoot. there
are 2 errors that I get and need some help
1. Error while trying to run project:Unable to start debugger on the webs
server. The project is not configured to be debugged and and a bunch of
lines....

2. If I run this project without debugging then I get this error.

Server Error in '/' Application.
----------------------------------------------------------------------------
----

Configuration Error
Description: An error occurred during the processing of a configuration file
required to service this request. Please review the specific error details
below and modify your configuration file appropriately.

Parser Error Message: It is an error to use a section registered as
allowDefinition='MachineToApplication' beyond application level. This error
can be caused by a virtual directory not being configured as an application
in IIS.

Source Error:


Line 38: by Microsoft that offers a single logon and core profile
services for member sites.
Line 39: -->
Line 40:
Line 41:
Line 42:



Source File: c:\inetpub\wwwroot\LMWebService\web.config Line: 40

Solution


It sounds like you need to make your directory a virtual root under the default web. You can't just copy a directory with a web service application into wwwroot without then configuring the directory as a virtual directory in IIS admin.

Try this:
-Open IIS Manager
-Under the default web find the folder LMWebService
-Right click on that folder and select properties
-On the 'Directory' tab, click the Create button next to the Application Name text box which will make the directory a virtual root of the default web.
-Now try hitting your service again.

How To Repair IIS Mapping After You Remove and Reinstall IIS for asp.net

View products that this article applies to.
This article was previously published under Q306005
SUMMARY
After you install the Microsoft .NET Framework Software Development Kit (SDK) or Visual Studio .NET, Microsoft Internet Information Service (IIS) mappings are created to associate the new file extensions and settings for ASP.NET. If you did not have IIS installed when you ran the SDK or Visual Studio Setup, or if you uninstalled and reinstalled IIS after you ran the SDK or Visual Studio Setup, those settings will not be in place. You experience unexpected behavior when you try to view ASP.NET pages.

When you try to create a new ASP.NET Web application in Visual Studio .NET 2003, you receive the following error message:

Visual Studio .NET has detected that the specified Web server is not running ASP.NET version 1.1. You will be unable to run ASP.NET Web applications or services.
MORE INFORMATION
To fix IIS mappings for ASP.NET, follow these steps:
Run the Aspnet_regiis.exe utility:
Click Start, and then click Run.
In the Open text box, type cmd, and then press ENTER.
At the command prompt, type the following, and then press ENTER:
"%windir%\Microsoft.NET\Framework\version\aspnet_regiis.exe" -i

In this path, version represents the version number of the .NET Framework that you installed on your server. You must replace this placeholder with the actual version number when you type the command.
Register the Aspnet_isapi.dll:
Click Start, and then click Run.
In the Open text box, type the following, and then press ENTER:
regsvr32 %windir%\Microsoft.NET\Framework\version\aspnet_isapi.dll

Regsvr32 returns the results of the registration.




see link http://support.microsoft.com/default.aspx?scid=kb;en-us;306005

Monday, August 16, 2004

Using the DataReader

The following are some tips for best performance using a DataReader, as well as, answers to common questions regarding the use of the DataReader.

The DataReader must be closed before accessing any output parameters for the associated Command.
Always close the DataReader when you are finished reading the data. If the Connection you are using is only used to return the DataReader, close it immediately after closing the DataReader.
An alternative to explicitly closing the Connection is to pass CommandBehavior.CloseConnection to the ExecuteReader method to ensure that the associated connection is closed when the DataReader is closed. This is especially useful if you are returning a DataReader from a method and do not have control over the closing of the DataReader or associated connection.

The DataReader cannot be remoted between tiers. The DataReader is designed for connected data access.
When accessing column data use the typed accessors like GetString, GetInt32, and so on. This saves you the processing required to cast the Object returned from GetValue as a particular type.
Only one DataReader can be open at a time, off of a single connection. In ADO, if you opened a single connection and requested two recordsets that used a forward-only, read-only cursor, ADO implicitly opens a second, unpooled connection to the data store for the life of that cursor, and then implicitly closes it. With ADO.NET, little is done for you "under-the-covers". If you want two DataReaders open at the same time, off the same data store, you have to explicitly create two connections, one for each DataReader. This is one way that ADO.NET gives you more control over the use of pooled connections.
By default, the DataReader loads an entire row into memory with each Read. This allows for random access of columns within the current row. If this random access is not necessary, for increased performance, pass CommandBehavior.SequentialAccess to the call to ExecuteReader. This changes the default behavior of the DataReader to only load data into memory when it is requested. Note that, CommandBehavior.SequentialAccess requires you to access returned columns in order. That is, once you have read past a returned column, you can no longer read its value.
If you are finished reading the data from a DataReader, but still have a large number of unread results pending, call Cancel on the Command prior to calling Close on the DataReader. Calling Close on the DataReader causes it to retrieve pending results and empty the stream prior to closing the cursor. Calling Cancel on the Command discards results on the server so that the DataReader does not have to read though them when it is closed. If you are returning output parameters from your Command, calling Cancel discards them as well. If you need to read any output parameters, do not call Cancel on the Command; just call Close on the DataReader.

for more details see: http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnadonet/html/adonetbest.asp

DataSet vs. DataReader

To determine whether to use the DataSet or the DataReader when you design your application, consider the level of functionality that is needed in the application.

Use the DataSet in order to do the following with your application:

Navigate between multiple discrete tables of results.
Manipulate data from multiple sources (for example, a mixture of data from more than one database, from an XML file, and from a spreadsheet).
Exchange data between tiers or using an XML Web service. Unlike the DataReader, the DataSet can be passed to a remote client.
Reuse the same set of rows to achieve a performance gain by caching them (such as for sorting, searching, or filtering the data).
Perform a large amount of processing per row. Extended processing on each row returned using a DataReader ties up the connection serving the DataReader longer than necessary, impacting performance.
Manipulate data using XML operations such as Extensible Stylesheet Language Transformations (XSLT transformations) or XPath queries.
Use the DataReader in your application if you:

Do not need to cache the data.
Are processing a set of results too large to fit into memory.
Need to quickly access data once, in a forward-only and read-only manner.
Note The DataAdapter uses the DataReader when filling a DataSet. Therefore, the performance gained by using the DataAdapter instead of the DataSet is that you save on the memory that the DataSet would consume and the cycles it takes to populate the DataSet. This performance gain is, for the most part, nominal so you should base your design decisions on the functionality required.

Tuesday, August 10, 2004

we will now use Regasm on managed .NET librarie instead of Regsvr32

Where we once used (might be still using) Regsvr32 on unmanaged COM libraries, we will now use Regasm on managed .NET libraries.

“Regsvr32 (http://www.microsoft.com/resources/documentation/windows/xp/all/proddocs/en-us/regsvr32.mspx) is the command-line tool that registers .dll files as command components in the registry“

“Regasm.exe, the Assembly Registration tool (http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cptools/html/cpgrfassemblyregistrationtoolregasmexe.asp) that comes with the .NET SDK, reads the metadata within an assembly and adds the necessary entries to the registry, which allows COM clients to create .NET Framework classes transparently. Once a class is registered, any COM client can use it as though the class were a COM class. The class is registered only once, when the assembly is installed. Instances of classes within the assembly cannot be created from COM until they are actually registered.“

To register an assembly programmatically, see the RegistrationServices class (http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpref/html/frlrfsystemruntimeinteropservicesregistrationservicesclasstopic.asp) and ComRegisterFunctionAttribute (http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpref/html/frlrfsystemruntimeinteropservicescomregisterfunctionattributeclasstopic.asp)

MSN's new Web Messenger is now out

MSN's new Web Messenger is now out. A web based interface to your MSN Messanger. Cool!!

http://webmessenger.msn.com/

Monday, August 09, 2004

.NET DEPLOYMENT

I have a project to deploy.These are the steps required...

1) detect dotnet framework and install it automatically if not found
2) detect mdac and install automatically if not found
3) Allow me to choose between 2 options a) Full setup b) trial version
4) Get userid and product_serial_number and validate it the "next button" of the installer should be disabled till the user gives a valid product_serial_number (i have custom algotims in a dll for validating and storing it in the registry)
5) get the database user_id and password and database_name and install the database
6) install the web project that i have developed

if i have to create a database project and do some stuff plz advice me on how to do thatif u have a database project that fits along with the above spec can i have a sample code that i can get along with all this has to be done byusing setup_project available in the .net framework 2003 ide i cannot use install shield or any other third party components plz give me detailed information of how i have to go about this problem....

SOLUTION

Follow these links, they can help in solving most of your cases.
1. Walkthrough: Creating a Custom Action : http://msdn.microsoft.com/library/default.asp?url=/library/en-us/vsintro7/html/vxwlkwalkthroughcreatingcustomaction.asp

2. Walkthrough: Using a Custom Action to Create a Database DuringInstallation :http://msdn.microsoft.com/library/default.asp?url=/library/en-us/vsintro7/html/vxwlkwalkthroughcreatingcustomaction.asp

3. Walkthrough: Passing Data to a Custom Action : http://msdn.microsoft.com/library/default.asp?url=/library/en-us/vsintro7/html/vxwlkwalkthroughusingcustomactiontocreatedatabaseduringinstallation.asp

These are all under the section : "Deployment Walkthroughs"at link :

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/vsintro7/html/vxwlkwalkthroughcreatingcustomaction.asp in MSDN.

Thursday, August 05, 2004

Comparisons between ADO and ADO.NET

Apart from its disconnected nature, the other key advantages of ADO.NET over ADO are: Whereas ADO.NET uses DataSets to hold data, ADO uses the RecordSet object. An ADO RecordSet represents a single table so, even if you join multiple tables, its view will be of a single table – it is not possible to work with multiple tables at once. The ADO.NET DataSet, on the other hand, contains a collection of tables and the relationships between them, so is able to handle a much more complex data structure.

The ADO.NET DataSet provides both a table-based relational view and an XML-based hierarchical view, and either can be used interchangeably. See Chapter 12 for more on this. The ADO RecordSet stores data in binary format, which can be a problem because firewalls tend to block binary data transfers. XML is a text-based data format, so ADO.NET can transfer data more easily and reliably through firewalls.

XML also permits an unlimited variety of data types, and incorporates ways to validate that the correct data types are used. Because ADO uses COM as a transportation mechanism, performance can be hindered by translation to and from the limited COM data types.

With ADO, there was always the problem of having the correct version of MDAC to access your data, but ADO.NET supports side-by-side versions of ADO.NET without having to worry about versioning issues.