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. )