Friday, January 30, 2009

BizTalk : Deployment cannot initialize the connection to the database "BizTalkMgmtDb" on server "HOME".

To resolve this problem on the project properties inside Visual Studios, you need to change that to the server(HOME) you want to deploy to.

Wednesday, January 28, 2009

Error creating window handle

I faced this problem during a search screen. When I got the record in my GridView and click on a link I am opening a window form. The problem arise when I open 15 to 16 times the window.

Problem:The error is because windows has a limit of 1000 windows handles so I presume data grid returns more than 1000 or near enough rows. We need to reuse the same object rather than creating a new control every time.

Solution: To resolve this problem we have to open the task manager and add the columns Handles, Threads, User Objects, GDI Objects by clicking the View-> Select column. Now run your application and check which is increasing frequently once you complete the functionality. In my application I found the USER Objects increasing very quickly. I check my code and found that I was not disposing the objects and so its increasing. In my application I found that User Objects reach 10000 and it locks to load controls. So to resolve it I have set the objects to null and dispose the controls which were not required and when the window is going to close. It can possible that problem can arise from the Handlers. So at this time we have to detach all the event handlers when we close the window or we have to check is the handler is exist and if not exist then we have to create it else not. So this is one of the important article I faced it and really interested thats possible even .Net has Garbage Collection features. So we should remember that we don't require any control just dispose it. So keep in mind it because its very important.

You can add your comments and suggesions here. Do it yaar......

Regards,
Vijay Modi

Sunday, January 25, 2009

Sys.WebForms.PageRequestManagerParserErrorException

passA partial-page update is initiated by a client request (an asynchronous postback) to the server. The server processes the request and returns a response to the client.

If the browser does not receive a response in a specified time, the Sys.WebForms.PageRequestManagerTimeoutException is raised. To change the interval that elapses before asynchronous postbacks time out, set the AsyncPostBackTimeout property of the ScriptManager control.

If an error occurs on the server while the request is being processed, an error response is returned to the browser and the Sys.WebForms.PageRequestManagerServerErrorException exception is raised. To customize error handling and to display more information about the server error, handle the AsyncPostBackError event and use the AsyncPostBackErrorMessage and AllowCustomErrorsRedirect properties. For an example of how to provide custom error handling during partial-page updates, see Customizing Error Handling for UpdatePanel Controls.

If the response to an asynchronous postback returns without an error but there is an error processing the response in the client, the Sys.WebForms.PageRequestManagerParserErrorException is raised. For information about how to handle this error condition, see ASP.NET AJAX Debugging and Tracing Overview.

How to avoid this problem:

1. Calls to Response.Write():
Place an or similar control on your page and set its Text property. The added benefit is that your pages will be valid HTML. When using Response.Write() you typically end up with pages that contain invalid markup.

2. Response filters:
The fix might just be to not use the filter. They're not used very often anyway. If possible, filter things at the control level and not at the response level.

3. HttpModules:
Same as response filters.

4. Server trace is enabled:
Use some other form of tracing, such as writing to a log file, the Windows event log, or a custom mechanism.

5. Calls to Server.Transfer():
I'm not really sure why people use Server.Transfer() at all. Perhaps it's a legacy thing from Classic ASP. I'd suggest using Response.Redirect() with query string parameters or cross-page posting.

Another way to avoid the parse error is to do a regular postback instead of an asynchronous postback. For example, if you have a button that absolutely must do a Server.Transfer(), make it do regular postbacks. There are a number of ways of doing this:

1. The easiest is to simply place the button outside of any UpdatePanels. Unfortunately the layout of your page might not allow for this.
2. Add a PostBackTrigger to your UpdatePanel that points at the button. This works great if the button is declared statically through markup on the page.
3. Call ScriptManager.RegisterPostBackControl() and pass in the button in question. This is the best solution for controls that are added dynamically, such as those inside a repeating template.

Support: http://weblogs.asp.net/leftslipper/archive/2007/02/26/sys-webforms-pagerequestmanagerparsererrorexception-what-it-is-and-how-to-avoid-it.aspx#1820815

Hope it will resolve this problem. You can add your comments here.

Regards,
Vijay Modi

Set Parameter in Crystal Reports using ASP.Net

Some one send me a mail and ask for help regarding setting parameters in Crystal Reports using asp.net.

My advice is always to download the web samples at:

Visual Basic .NET Web Samples

C# .NET Web Sample Applications

Then, follow the Readme file to install the “Discrete Parameters” example. This has been my guide, and it works great.

Additional help and tutorials are in the CR SDK:

Crystal Reports .NET SDK – Additional Conceptual Documentation and Tutorials

This file contains additional conceptual information and tutorials for using Crystal Reports in Visual Studio .NET (including a developer reference). This documentation applies to Crystal Reports 9 & 10 and Crystal Reports for Visual Studio .NET 2002 & 2003. Sample applications built using these tutorials are available for download (cr_net_sdk_tutorial_samples_en.zip).

Crystal Reports .NET SDK – Sample Applications from Tutorials

This file contains C# and VB .NET Windows and web sample applications. These samples were built using the tutorials provided in the ‘Crystal Reports .NET SDK – Additional Documentation and Tutorials’ (cr_net_sdk_additional_en.zip). These sample applications applies to: Crystal Reports 9 & 10 and Crystal Reports for Visual Studio .NET 2002 & 2003.

If you're new to Crystal Reports .NET, get this book:

Crystal Reports .NET Programming

It is both an introduction to Crystal Reports .NET, as well as a object model programming guide/reference. Examples are in both VB.NET and C#.

A number of methods out there use the CrystalReportViewer control to set parameters. That's great unless you need to export your report to PDF (or XLS or RTF). This is a code snippet I use, it comes from Business Objects tech support:

================================================

rptCount = New ReportDocument
rptCount.Load(Server.MapPath("reportname.rpt"))
''Get the collection of parameters from the report
crParameterFieldDefinitions = rptCount.DataDefinition.ParameterFields
''Access the specified parameter from the collection
crParameter1 = crParameterFieldDefinitions.Item("Param1")
crParameter2 = crParameterFieldDefinitions.Item(“Param2")

''Get the current values from the parameter field. At this point
''there are zero values set.
crParameter1Values = crParameter1.CurrentValues
crParameter2Values = crParameter2.CurrentValues

''Set the current values for the parameter field
crDiscrete1Value = New ParameterDiscreteValue
crDiscrete1Value.Value = Request.Form(“param1value“)

crDiscrete2Value = New ParameterDiscreteValue
crDiscrete2Value.Value = Request.Form(“param2value“)

''Add the first current value for the parameter field
crParameter1Values.Add(crDiscrete1Value)
crParameter2Values.Add(crDiscrete2Value)

''All current parameter values must be applied for the parameter field.
crParameter1.ApplyCurrentValues(crParameter1Values)
crParameter2.ApplyCurrentValues(crParameter2Values)

=========================================

Once you get used to working with parameters, you can “automagically” display them on your web pages. This series of articles shows you how to get a list of parameters from your report file, and display them on your web form, where you can prompt for inputs:

Automagically displaying a Crystal Reports Parameters - Part I
Automagically displaying a Crystal Reports Parameters - Part II

Support: http://aspadvice.com/blogs/rjdudley/archive/2005/02/21/2554.aspx

You can add comments regarding this article.

Thanks & Regards,
Vijay Modi

Tuesday, January 20, 2009

Convert MySql Database Script to MsSql

Yesterday I need to export data from MySql database to MSSql database. I tried, but I could not solve it. I try today once more and I got solution and its solved. Please download the demo version from the following link and test it. Its working fine. Really very good. Its automatically convert mysql database to mssql database.
http://www.convert-in.com/sql2mss.htm

Kindly add your comments and suggestions.

Regards
Vijay Modi

Wednesday, January 14, 2009

MS Sql Server: Stored procedures vs. functions

In many instances you can accomplish the same task using either a stored procedure or a function. Both functions and stored procedures can be custom defined and part of any application. Functions, on the other hand, are designed to send their output to a query or T-SQL statement. For example, User Defined Functions (UDFs) can run an executable file from SQL SELECT or an action query, while Stored Procedures (SPROC) use EXECUTE or EXEC to run. Both are instantiated using CREATE FUNCTION. UDFs are instantiated using CREATE FUNCTION and SPROC instantiated by using CREATE PROCEDURE.

To decide between using one of the two, keep in mind the fundamental difference between them: stored procedures are designed to return its output to the application. A UDF returns table variables, while a SPROC can't return a table variable although it can create a table. Another significant difference between them is that UDFs can't change the server environment or your operating system environment, while a SPROC can. Operationally, when T-SQL encounters an error the function stops, while T-SQL will ignore an error in a SPROC and proceed to the next statement in your code (provided you've included error handling support). You'll also find that although a SPROC can be used in an XML FOR clause, a UDF cannot be.

If you have an operation such as a query with a FROM clause that requires a rowset be drawn from a table or set of tables, then a function will be your appropriate choice. However, when you want to use that same rowset in your application the better choice would be a stored procedure.

There's quite a bit of debate about the performance benefits of UDFs vs. SPROCs. You might be tempted to believe that stored procedures add more overhead to your server than a UDF. Depending upon how your write your code and the type of data you're processing, this might not be the case. It's always a good idea to text your data in important or time-consuming operations by trying both types of methods on them.

Reference: http://searchsqlserver.techtarget.com/tip/1,289483,sid87_gci1063700,00.html

Friday, January 9, 2009

ASP.Net: The request failed with HTTP status 503: Service Unavailable.

Hi Friends,

I faced this problem in my asp.net project with web service. This problem will occur when you are working with web services using ASP.Net. You need to check you app.config file and check the your web service path provided in this app.config file. Just change this path with your existing web service path. You can view your web service path just by right clicking on the web service project and by clicking "View In Browser" option. Just copy path and replace it with the existing wrong path.

You can insert your comments and suggestions.

Regards,
Vijay Modi

Tuesday, January 6, 2009

'System.Web.UI.Compatibility.CompareValidator' Could not Load Type

Hi Friends,

I found this problem during my first use of ASP.Net AJaX toolkit. To resolve this problem you have to add the validation.dll file in your bin folder and just commnet your tagMapping block exist in the Web.Config file and add the following:










Hope it will resolve your problem.
Regards
VBM

Monday, January 5, 2009

Method Not Allowed / The requested method POST is not allowed for the URL

Really a very interesting and common problem I found today. The solution is more interesting than the Problem.

This error can occur in several situations. The following list includes some of the most common reasons developers encounter this issue:

The action attribute of a form does not point to an executable script or there is no file specified for the action (in which case, the action field in the Property inspector is blank).
The form's action attribute points to an HTML file.
A developer saves web pages with an HTM or HTML file extension instead of ASP, PHP, CFM or JSP file extensions, and specifies HTM or HTML as the default file extension in the site definition.
Things to look for when receiving this error:

Specify an action attribute in the form's Property inspector
The action field cannot be left blank and must specify an executable file. Common valid file types for the form action attribute include ASP, JSP, CFM, PHP, EXE, DLL or CGI. If you use one of Dreamweaver's application objects—such as an Insert Record or Update Record—you may instead see a variable similar to <%=MM_editAction%>.
Check file extension of the web page producing the error
The page must have a file extension of ASP, PHP, ASPX, CFM or JSP. If the page has an extension of HTM or HTML, it will need to be renamed with the default extension for the server model specified in the site definition.
Check that the correct page type is specified in the site definition
Check the server model field in the Testing Server category of the site definition. The server model should match the correct language.
Another solution:

PHP: This is almost always due to Apache not being configured to treat the file you are trying to POST to as a CGI script. You can not POST to a normal HTML file; the operation has no meaning.

Please visit to find the solution: http://www.somacon.com/p126.php

One most important thing is that "your web server must support the php, asp or cgi whatever scripting language you are using". Please check is your web server support the scripting language you are using in your web site else it can generate this error. This is one of the major issue found in various problem. So plz check your web server.

If you feel this blog gives you a proper solution, please post your comments.

Regards,
Vijay Modi

Sunday, January 4, 2009

Ms Sql Vs My Sql

DBMS Comparisons: MySQL 5.0 vs. Microsoft SQL Server 2005

Database engines are a crucial fixture for businesses today. There is no shortage of both commercial and open source database engines to choose from. Microsoft SQL Server 2005 is Microsoft’s next-generation data management solution that claims to deliver secure and scalable applications while making them easy to deploy and manage. MySQL has long been the DBMS of choice in the open source community. The recent release of MySQL 5.0 has seen major changes in both features and performance to bring the database system into enterprise-level standards.
This paper aims to give the low-down on features most desirable to database developers and compare both database management systems in light of these features.

Topics in this Paper:FeaturesThe Open Source vs. Commercial Database ParadigmPerformance ReplicationSecurity

Recovery

Features

The most obvious difference between the two products is in philosophy. SQL server is essentially a proprietary storage engine. Once you purchase the product, you are only limited to the Sybase-derived engine. By contrast, MySQL is an open storage engine offering multiple choices: InnoDb, BerkleyDB, MyISAM and Heap amongst other supported engines.

The second marked difference between the two database systems is in the technical features and specifications implemented. SQL Server is a fully-fledged database system developed specifically for large enterprise databases. All advanced features of a relational database are fully implemented. MySQL, on the other hand, has only come out of edge in the “relational” front, with recent support for foreign keys.

The latest release of MySQL, the 5.X offering, has rounded up on features that lagged commercial equivalents such as SQL Server. There is now full support for cursors, complete views and stored procedures according to the SQL 2003 syntax. Other features that were a major differentiator between MySQL and SQL Server are now part of the 5.X release. Triggers, stored procedures and foreign keys are fully implemented.

But is MySQL 5.0 really up to industry-level database standards? The features outlined above have only been implemented in the latest release and are yet to fully stabilise. They are yet to be rationalised across the different databases in the MySQL suite of products – InnoDB, MyISAM, MaxDB and the new data clusters. MySQL is still carrying four distinct database architectures and it proves very challenging to fully implement replication, parallel processing, journaling and recovery across different databases.

SQL Server continues to have the edge, as the advanced features list has long stabilised. The latest release of SQL Server 2005 provides the necessary technological underpinnings to keep it in the higher-end of database systems. There is now a far greater integration with Microsoft’s .NET Framework, a development environment that greatly facilitates coding without the need to learn advanced features of SQL. It is also tightly integrated with Visual Studio .NET. This will provide better support for XML, querying multi-dimensional data in the SQL server and a set of advanced reporting controls. Finally, XML is now a native data type within XML. This enables a DBA to modify an XML document within the DBMS environment, query the document and validate it against an XML schema.

The Open Source versus Commercial License Paradigm

Another difference between the two database engines is licensing costs. Both databases have a two-tiered licensing scheme, but have little else in common.

The first licensing scheme is essentially free. SQL Server provides a free license for "development use only". What this means is that the database system cannot be deployed in a commercial environment. MySQL, on the other hand, is free to use under any environment, provided one abides by GPL license rules.

This brings us to the second-tier of licensing. For use in a commercial environment, one would need to purchase the SQL Standard Edition license. It costs a whopping $1,400, a substantial investment for a small business. However, it is a fully-fledged relational database system complete with all features needed to develop and deploy enterprise databases. This goes a long way towards justifying the hefty price tag.

MySQL also provides licensing schemes to circumvent some of the restrictions of the GPL license. This is especially important for companies that deal with proprietary information. These commercial licenses are piloted by MySQL AB, the company behind the development of MySQL, and cost a very affordable $400. Non-profit organisations and educational establishments are exempt from this fee.

Performance

In terms of performance, MySQL fairs better than SQL on a variety of platforms thanks to the default table format of its MyISAM database. They are compact on disk and use less memory and CPU cycles. While the database system performs well on Windows, it is better suited for UNIX and UNIX-like systems. The performance can further be tuned on 64-bit processors (such as SPARC stations) because of the internal use of 64 integers in the database. The latest release of MySQL 5.0 has seen further improvements in engine performance, through compact mode support. Engines such as InnoDB and NDB Cluster uses 20% less space than it required in previous versions.

For additional non-default MySQL features, there is an increased demand on resource usage and this has obviously an effect on performance. For instance, alternative table formats on MyISAM or transactions on Berkeley DB will require additional memory usage. These features will, however, offer additional functionality.

For SQL Server, the full-set of powerful features that surpasses that of most competitors has a negative effect on performance. It's true that many of these features are geared towards performance tuning, but overall the system is more complex, places additional requirements on memory and disk storage. This results in a poorer performance compared with MySQL. The performance will benefit greatly with RAID and a dedicated hard drive for the data store.

Replication

Both Database systems are scalable and support replication to a different degree of complexity.

Replication on MYSQL is easy because all SQL statements that change data are kept in a binary log. Because of the binary nature of the records, data can be replicated easily and quickly to one or more slave machines. This also means that data remains intact and replication takes place even when the server goes down. On the scalability front, MYSQL scales easily into large, query-heavy databases.

Unlike MySQL one-way replication, SQL Server offers replication in a number of models: snapshot, transactional and merge. A snapshot application is a simple snapshot of the entire replicated database. It is a time consuming process but can be useful for databases that rarely change or as a way to establish a baseline for replication between systems. A transactional replication is a more flexible solution for databases that regularly change. The database is monitored for any changes by a replication agent monitor. When changes do take place, they are transmitted to the subscribers. Finally, merge replication allows simultaneous changes to the database by both the publisher and subscribers. Changes can be made without an active network connection, and any conflicting changes are resolved through a predefined conflict resolution algorithm.

However, increased replication support comes at the expense of a greater degree of complexity. This is due to SQL's complex transaction and record locking mechanism, cursor manipulation and synchronisation of dynamic data replication. If you’re skilled in these elaborate mechanisms, then replication and migration shouldn’t be an issue.

Security

Security remains a major concern for most businesses and a compelling consideration in choosing a database system.

Both DBMS support security at the base level. MySQL is limited to supporting basic security at the table level, via the SQL command. By contrast, SQL server fully supports security at the column level.

Another important consideration is security certificates - the verification of the database security by a third party. SQL Server has been certified as C-2 compliant, which means the database system has adequate security for government applications. MySQL has no such certification.

Moving on to more advanced features of protecting data on the database, the SQL Server 2005 have implemented more advanced authentication and authorisation features. The database supports native encryption capabilities, obfuscating the DBA from writing user-defined functions using column encryption APIs. The encryption mechanism is based on a combination of third-party certificates, symmetric keys and asymmetric keys. You can specify asymmetric keys for increased security or symmetric keys for better performance. A DBA has also the choice of specifying his own user-defined security functions through the encryption facility implemented in the .NET Framework.

Recovery

SQL Server is more failsafe and less prone to data corruption. SQL has a robust checkpoint mechanism whereby the data passes from the keyboard to the hard drive before showing in the monitor. Even if the databases shut down unexpectedly without warning, the data can be recovered.

New features in the SQL 2005 release provide enhanced mechanisms to manage data protection and rapid restoration. Mirrored backups allow you to create multiple copies of the backup file. These backups have identical content, so you can always mix the files in case one of the sets becomes corrupt.

Copy only backups enable you to make a copy of the database without interrupting the sequence of other backup files. This copy can be used to restore your database, instead of going through the full backup and translation log. You can also save time by using partial backups for all filegroups, except those marked as read-only.

MySQL falls short in recovery with its default MyISAM mechanism. The UPS assumes uninterrupted data, and in the event of an unexpected shutdown your data can be lost and the data store corrupted.

Concluding Thoughts

From a database developer’s perspective, choosing between a MySQL and SQL Server DBMS is a matter of the scale of the database application. For enterprise-level applications, SQL Server wins hands down. It has advanced set of SQL features, superior replication, clustering, security and management tools.

For lower-tier database applications, MySQL can offer the core functionality you require at a very low cost. Some might argue that the latest offering from MySQL has made the open source database system enterprise “worthy”, but this remains to be seen. The advanced functionalities implemented are yet to stabilise and be rationalised across the database engine. What's more, Microsoft has upped the ante with even more advanced features of its own. It’s up to MySQL to rise up to the challenge, but at this point in time MySQL is nowhere near the competitive enterprise field of the more established SQL Server 2005.

Please visit: http://www.tometasoftware.com/MySQL-5-vs-Microsoft-SQL-Server-2005.asp

You can add you comments and suggestions for this article.

Regards,
Vijay Modi

Saturday, January 3, 2009

Synchronous AND Asynchronous

•> Asynchronous
– examples
• Google Maps – http://maps.google.com
– asynchronously loads graphic tiles to support map scrolling
• Google Suggest – http://www.google.com/suggest
– asynchronously updates list of possible topic matches
based on what has been typed so far
•> Synchronous
– even when there is nothing useful for the user to do after a request is submitted to a server, AJaX can be used to retrieve data and update selected parts of the page
without refreshing the entire page.
• better user experience

Friday, January 2, 2009

php configuration, apache, mysql, phpMyAdmin installation / setup through Wamp server:

Do you facing problem during installation of php & Mysql. You can install it very very easy. Let me go in detail...

I am using WAMP server for more then one year. I think its really very good for configuring the php, MySql and apache. Its ready tool for installing Php, MySql and Apache on your windows operating system. Its install all above very easily. You can configure PhpMyAdmin too by using this tool. Really very important too for easily configuring the php with apache server.

Link : www.wampserver.com

Regards...
Vijay Modi

Thursday, January 1, 2009

SQL Server Index Tuning / Clustered vs Non-Clustered Indexes

Hello Friends,

What is cluster and Non-Cluster index and why we need it? Do you know? Just reat this article you will know all about it.

Most database administrators are familiar with the potential performance benefits they can gain through the judicious use of indexes on database tables. Indexes allow you to speed query performance on commonly used columns and improve the overall processing speed of your database.
Microsoft SQL Server supports two types of indexes:

-> Clustered indexes define the physical sorting of a database table’s rows in the storage media. For this reason, each database table may have only one clustered index. If a PRIMARY KEY constraint is created for a database table and no clustered index currently exists for that table, SQL Server automatically creates a clustered index on the primary key.
-> Non-clustered indexes are created outside of the database table and contain a sorted list of references to the table itself.
SQL Server 2000 supports a maximum of 249 non-clustered indexes per table. However, it’s important to keep in mind that non-clustered indexes slow down the data modification and insertion process, so indexes should be kept to a minimum

One of the hardest tasks facing database administrators is the selection of appropriate columns for non-clustered indexes. You should consider creating non-clustered indexes on any columns that are frequently referenced in the WHERE clauses of SQL statements. Other good candidates are columns referenced by JOIN and GROUP BY operations.
You may wish to also consider creating non-clustered indexes that cover all of the columns used by certain frequently issued queries. These queries are referred to as “covered queries” and experience excellent performance gains.
SQL Server provides a wonderful facility known as the Index Tuning Wizard which greatly enhances the index selection process. To use this tool, first use SQL Profiler to capture a trace of the activity for which you wish to optimize performance. You may wish to run the trace for an extended period of time to capture a wide range of activity. Then, using Enterprise Manager, start the Index Tuning Wizard and instruct it to recommend indexes based upon the captured trace. It will not only suggest appropriate columns for queries but also provide you with an estimate of the performance increase you’ll experience after making those changes!

Reference Link: http://databases.about.com/od/sqlserver/a/indextuning.htm

Regards
Vijay Modi:)