Wednesday, June 25, 2008

requirePermission="false" in the Web.config shows error

requirePermission="false" in the Web.config shows error?
Solution: Add xmlns property for the configuration tabxmlns="http://schemas.microsoft.com/.NetConfiguration/v2.0"
ie,

Friday, June 20, 2008

ASP.Net Report Control.

Writting conditions in the columns; Report Control, ASP.Net.

=IIf(IsNothing(Fields!Value.Value),"NA",Fields!Value.Value)This one check if the value is Null or not.If Value is Null, it displays NA
Else it displays the Value from the Business Entity.

Thursday, June 19, 2008

Split Text In Stored Procedure and Insert in to the Table

User Selects the Select All check box and clicks Submit. All the IDs of selected check boxes are concatenated and send to the Stored Procedures.Stored Procedure accepts Two Patameters UserName and IdStringId String is in the format ~71~5~88~1043~9.
The special character '~' is used to concatenate the Ids.
Stored procedure splits the IdString and get each seperate id and update the database with the UserNameThe Table(CH_APPLIED_INFO) will be updated as

UserName JobID
Sabin 71
Sabin 5
Sabin 88
Sabin 1043
Sabin 9

This SP is communicative / Userfriendly. It accepts two parameters, UserName, which is a string and an IdString which is a '~' Concatenated String of JOB IDs the user have been selectd through the Check boxes in the Job listing Page.//Format of the IdString is ~71~5~88~1043~9

CREATE PROCEDURE dbo.SplitAndInsert
(
@userName varchar(100),
@idString varchar(100)
)
AS
SET NOCOUNT ON
DECLARE @splitstring varchar(100)
DECLARE @substring varchar(50)
Set @splitstring = @idString
WHILE (CHARINDEX('~',@splitstring ,1)<>0)
BEGIN
SET @substring = substring(@splitstring ,1,CHARINDEX('~',@splitstring ,1)-1)-- Find Substring up to Separator
PRINT @substringif @substring <> 0
INSERT INTO CH_APPLIED_INFO(USER_NAME, JOB_ID)
VALUES (@userName,@substring)SET @splitstring = substring(@splitstring ,Len(@substring)+2,Len(@splitstring ))
-- SET The Original String after the Split END
SET NOCOUNT OFF
RETURN

Tuesday, June 10, 2008

Transaction Scope Settings


You may open Control Panel\Administrative Tools\Component Services.
Select Component Services\Computer\My Computer,
right-click and choose Properties.
On the MSDTC tab, press "Security Configuration..." and check if following options are enabled

Network DTC Access
Under Client and Administration >

Allow Remote Clients, Allow Remote Administration

Under Transaction Manager

CommunicationAllow
InboundAllow
OutboundNo


Authentication Required Enale XA Transactions
And then reboot your computer and test again.

Here is the Snippet for implementing Transaction Scope for Rolling out the Changes.

using (TransactionScope scope = new TransactionScope())
{
try
{ }
catch (Exception ex)
{
throw new Exception("Application cannot Save the entry as the mandatory fields are not filled");
} scope.Complete();


http://msdn.microsoft.com/en-us/library/ms172152.aspx (Microsoft Pulled out this Page, I guess. )

Thursday, April 24, 2008

The type or namespace name 'Transactions' doesnot exist in the namespace 'System'




The type or namespace name 'Transactions' doesnot exist in the namespace 'System' (are you missing an assembly reference



Cause : You are missing a DLL.

Solution : This can be added by adding reference by right clicking in the solution in the Visual studio IDE. After adding this one, you can see the change in the Web.config file. You will see a new assembly been added there..


















Tuesday, April 22, 2008

sys.WebForms.PageRequestManagerParserErrorException:

sys.WebForms.PageRequestManagerParserErrorException: The message receieved from server could not be parsed. Common causes for this error are when the response is modified by calls to Response filters, HttpModules, or server trace is enabled.

There are a couple of solutions available to this error:
Try to put yur Sumbit button out of the Update Panel.

do not use the HttpModule and rely on IIS compression, or move the application to the .NET Framework 3.5.
Remove the HttpModule from web.config
Assure ScriptResource is not compressed:
Open the IIS Manager
Right click on "Web Sites" folder > Properties
Click the "Services" tab
Check "Compress application files" and "Compress static files"
Apply and confirm all dialogs
Stop IIS
Open a command prompt and go to C:\Inetpub\AdminScripts
Run the following commands to add .js, .aspx and .axd to the compression list:
cscript adsutil.vbs set W3SVC/Filters/Compression/GZIP/HcFileExtensions "htm" "html" "txt" "js"
cscript adsutil.vbs set W3SVC/Filters/Compression/Deflate/HcFileExtensions "htm" "html" "txt" "js"
cscript adsutil.vbs set W3SVC/Filters/Compression/GZIP/HcScriptFileExtensions "asp" "dll" "exe" "aspx"
cscript adsutil.vbs set W3SVC/Filters/Compression/Deflate/HcScriptFileExtensions "asp" "dll" "exe" "aspx"
Restart IIS
You can also move the application to .NET Framework 3.5 instead, because the UpdatePanel control has been changed internally and now this problem should not happen anymore.

Monday, April 14, 2008

The Name 'Request' does not exist in the current context

Nothing to worry about, since you can still access these properties, but using a different path.For example to access a cookie with the name MyCookie you would normally use Request.Cookies["MyCookie"]; however, if the error The name 'Request' does not exist in the current context is returned, use the following path for retrieving the cookie:
System.Web.HttpContext.Current.Request.Cookies["MyCookie"].value;