|
Hello All,
I am getting the following exception when I run my C# application. I am using VS2008 and I am logged into my computer as admin. I have also launched VS2008 with admin permissions. I am using WinXP SP2 and Spring .NET version . Can someone help ?
*********************************************************************************************************************
System.Configuration.ConfigurationErrorsException was unhandled by user code
Message="Error creating context 'spring.root': Request for the permission of type 'System.Configuration.ConfigurationPermission, System.Configuration, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' failed."
Source="Spring.Core"
BareMessage="Error creating context 'spring.root': Request for the permission of type 'System.Configuration.ConfigurationPermission, System.Configuration, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' failed."
Line=0
StackTrace:
at Spring.Context.Support.ContextHandler.Create(Object parent, Object configContext, XmlNode section) in l:\projects\spring-net\trunk\src\Spring\Spring.Core\Context\Support\ContextHandler.cs:line 291
at System.Configuration.RuntimeConfigurationRecord.RuntimeConfigurationFactory.CreateSectionImpl(RuntimeConfigurationRecord configRecord, FactoryRecord factoryRecord, SectionRecord sectionRecord, Object parentConfig, ConfigXmlReader reader)
at System.Configuration.RuntimeConfigurationRecord.RuntimeConfigurationFactory.CreateSectionWithRestrictedPermissions(RuntimeConfigurationRecord configRecord, FactoryRecord factoryRecord, SectionRecord sectionRecord, Object parentConfig, ConfigXmlReader reader)
at System.Configuration.RuntimeConfigurationRecord.RuntimeConfigurationFactory.CreateSection(Boolean inputIsTrusted, RuntimeConfigurationRecord configRecord, FactoryRecord factoryRecord, SectionRecord sectionRecord, Object parentConfig, ConfigXmlReader reader)
at System.Configuration.RuntimeConfigurationRecord.CreateSection(Boolean inputIsTrusted, FactoryRecord factoryRecord, SectionRecord sectionRecord, Object parentConfig, ConfigXmlReader reader)
at System.Configuration.BaseConfigurationRecord.CallCreateSection(Boolean inputIsTrusted, FactoryRecord factoryRecord, SectionRecord sectionRecord, Object parentConfig, ConfigXmlReader reader, String filename, Int32 line)
InnerException: Spring.Util.FatalReflectionException
Message="Cannot instantiate Type [Spring.Context.Support.XmlApplicationContext] using ctor [Void .ctor(System.String, Boolean, System.String[])] : 'Exception has been thrown by the target of an invocation.'"
Source="Spring.Core"
StackTrace:
at Spring.Util.ObjectUtils.InstantiateType(ConstructorInfo constructor, Object[] arguments) in l:\projects\spring-net\trunk\src\Spring\Spring.Core\Util\ObjectUtils.cs:line 254
at Spring.Context.Support.ContextHandler.RootContextInstantiator.InvokeContextConstructor(ConstructorInfo ctor) in l:\projects\spring-net\trunk\src\Spring\Spring.Core\Context\Support\ContextHandler.cs:line 549
at Spring.Context.Support.ContextHandler.ContextInstantiator.InstantiateContext() in l:\projects\spring-net\trunk\src\Spring\Spring.Core\Context\Support\ContextHandler.cs:line 493
at Spring.Context.Support.ContextHandler.InstantiateContext(IApplicationContext parentContext, Object configContext, String contextName, Type contextType, Boolean caseSensitive, String[] resources) in l:\projects\spring-net\trunk\src\Spring\Spring.Core\Context\Support\ContextHandler.cs:line 336
at Spring.Context.Support.ContextHandler.Create(Object parent, Object configContext, XmlNode section) in l:\projects\spring-net\trunk\src\Spring\Spring.Core\Context\Support\ContextHandler.cs:line 279
InnerException: System.Reflection.TargetInvocationException
Message="Exception has been thrown by the target of an invocation."
Source="mscorlib"
StackTrace:
at System.RuntimeMethodHandle._InvokeConstructor(Object[] args, SignatureStruct& signature, IntPtr declaringType)
at System.RuntimeMethodHandle.InvokeConstructor(Object[] args, SignatureStruct signature, RuntimeTypeHandle declaringType)
at System.Reflection.RuntimeConstructorInfo.Invoke(BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)
at System.Reflection.ConstructorInfo.Invoke(Object[] parameters)
at Spring.Util.ObjectUtils.InstantiateType(ConstructorInfo constructor, Object[] arguments) in l:\projects\spring-net\trunk\src\Spring\Spring.Core\Util\ObjectUtils.cs:line 249
InnerException: Spring.Objects.Factory.ObjectDefinitionStoreException
Message="Could not resolve resource location [config://spring/objects]"
Source="Spring.Core"
ObjectName=""
ResourceDescription=""
StackTrace:
at Spring.Objects.Factory.Support.AbstractObjectDefinitionReader.LoadObjectDefinitions(String location) in l:\projects\spring-net\trunk\src\Spring\Spring.Core\Objects\Factory\Support\AbstractObjectDefinitionReader.cs:line 229
at Spring.Objects.Factory.Support.AbstractObjectDefinitionReader.LoadObjectDefinitions(String[] locations) in l:\projects\spring-net\trunk\src\Spring\Spring.Core\Objects\Factory\Support\AbstractObjectDefinitionReader.cs:line 255
at Spring.Context.Support.AbstractXmlApplicationContext.LoadObjectDefinitions(XmlObjectDefinitionReader objectDefinitionReader) in l:\projects\spring-net\trunk\src\Spring\Spring.Core\Context\Support\AbstractXmlApplicationContext.cs:line 214
at Spring.Context.Support.AbstractXmlApplicationContext.LoadObjectDefinitions(DefaultListableObjectFactory objectFactory) in l:\projects\spring-net\trunk\src\Spring\Spring.Core\Context\Support\AbstractXmlApplicationContext.cs:line 238
at Spring.Context.Support.AbstractXmlApplicationContext.RefreshObjectFactory() in l:\projects\spring-net\trunk\src\Spring\Spring.Core\Context\Support\AbstractXmlApplicationContext.cs:line 133
at Spring.Context.Support.AbstractApplicationContext.Refresh() in l:\projects\spring-net\trunk\src\Spring\Spring.Core\Context\Support\AbstractApplicationContext.cs:line 764
at Spring.Context.Support.XmlApplicationContext..ctor(Boolean refresh, String name, Boolean caseSensitive, IApplicationContext parentContext, String[] configurationLocations) in l:\projects\spring-net\trunk\src\Spring\Spring.Core\Context\Support\XmlApplicationContext.cs:line 217
at Spring.Context.Support.XmlApplicationContext..ctor(String name, Boolean caseSensitive, String[] configurationLocations) in l:\projects\spring-net\trunk\src\Spring\Spring.Core\Context\Support\XmlApplicationContext.cs:line 122
InnerException: System.Security.SecurityException
Message="Request for ConfigurationPermission failed while attempting to access configuration section 'spring/objects'. To allow all callers to access the data for this section, set section attribute 'requirePermission' equal 'false' in the configuration file where this section is declared."
Source="System.Configuration"
StackTrace:
at System.Configuration.BaseConfigurationRecord.CheckPermissionAllowed(String configKey, Boolean requirePermission, Boolean isTrustedWithoutAptca)
at System.Configuration.BaseConfigurationRecord.GetSectionRecursive(String configKey, Boolean getLkg, Boolean checkPermission, Boolean getRuntimeObject, Boolean requestIsHere, Object& result, Object& resultRuntimeObject)
at System.Configuration.BaseConfigurationRecord.GetSection(String configKey, Boolean getLkg, Boolean checkPermission)
at System.Configuration.BaseConfigurationRecord.GetSection(String configKey)
at System.Configuration.ClientConfigurationSystem.System.Configuration.Internal.IInternalConfigSystem.GetSection(String sectionName)
at System.Configuration.ConfigurationManager.GetSection(String sectionName)
at Spring.Util.ConfigurationUtils.GetSection(String sectionName) in l:\projects\spring-net\trunk\src\Spring\Spring.Core\Util\ConfigurationUtils.cs:line 58
at Spring.Core.IO.ConfigSectionResource..ctor(String resourceName) in l:\projects\spring-net\trunk\src\Spring\Spring.Core\Core\IO\ConfigSectionResource.cs:line 89
at Spring.DynamicReflection.Ctor_ConfigSectionResource_c47035f20d0b4f8f86335dc74e27af5e.Invoke(Object[] args)
at Spring.Core.IO.ConfigurableResourceLoader.GetResource(String resourceName) in l:\projects\spring-net\trunk\src\Spring\Spring.Core\Core\IO\ConfigurableResourceLoader.cs:line 149
at Spring.Objects.Factory.Support.AbstractObjectDefinitionReader.LoadObjectDefinitions(String location) in l:\projects\spring-net\trunk\src\Spring\Spring.Core\Objects\Factory\Support\AbstractObjectDefinitionReader.cs:line 226
InnerException: System.Security.SecurityException
Message="Request for the permission of type 'System.Configuration.ConfigurationPermission, System.Configuration, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' failed."
Source="mscorlib"
StackTrace:
at System.Security.CodeAccessSecurityEngine.Check(Object demand, StackCrawlMark& stackMark, Boolean isPermSet)
at System.Security.CodeAccessPermission.Demand()
at System.Configuration.BaseConfigurationRecord.CheckPermissionAllowed(String configKey, Boolean requirePermission, Boolean isTrustedWithoutAptca)
InnerException:
*********************************************************************************************************************
Thanks,
Ashwanth
|
|
|
|
|
Sounds like some nasty code access security thing to me. Did you notice that buried in the middle of the stack trace these words:
Message="Request for ConfigurationPermission failed while attempting to access configuration section 'spring/objects'. To allow all callers to access the data for this section, set section attribute 'requirePermission' equal 'false' in the configuration file where this section is declared."
Source="System.Configuration"
Have you done that?
Regards,
Rob Philpott.
|
|
|
|
|
I had the requirePermission attribute already set to false. It has not helped.
Thanks,
Ashwanth
|
|
|
|
|
How to get a webbrowser control of IE? When a user clicks on back button of top left corner of IE window, how can I know, Is any event fired?
|
|
|
|
|
|
Dear All,
well i want to make my own panel like an expander which can be expanded and collapased.
this expand and collapse is done by a button, I have made this control which works in run time.
i want expand and collapse functionality in design time, means when we add that control to my panel, i should be able to collapse and expand it.
in run time i have done it, i also add several events to my controls, but still i am lacking to add expand and collapse functionality in design time.
I do really appreciate your idea?
Abdul Rahaman Hamidy
Database Developer
Kabul, Afghanistan
|
|
|
|
|
You can start by reading this[^]. It's a good intro to design time features in custom controls.
Simon
|
|
|
|
|
Simon, thanks alot.
I have read the topic, infact it did not solved my problem, but i have learned other issues and mostly how to add smart tag from to control at design time.
still i am looking for a method to add design time event for my control, i have seen several posts in regarding such issue,but the links were down.
Abdul Rahaman Hamidy
Database Developer
Kabul, Afghanistan
|
|
|
|
|
How do I set TXA-2 to "Counselling System^^DOC"?
My current code can only give "Counselling System" output.
((TXA)msg.GetStructure("TXA")).DocumentType.Value = "Counselling System";
Is there a way to set "DOC" to TXA-2-3 using NHapi?
Thank you in advance.
|
|
|
|
|
Found a solution.
I used Terser to set the value.
Terser terser = new Terser(msg);
terser.Set("/.TXA-2-3", "DOC");
|
|
|
|
|
Thank you, It's worked for me
|
|
|
|
|
Hi,
First time I am doing programming with datagridview. I read from net and various sites that it is very powerful to show data.
I have some question and want suggestion and tips or if possible some demo programming help.
1. Want grid should be for insert, update, delete with validation.
2. My data source is a mix table query means join of two or more table.
3. want columns as autocompletemode.
4. unique rows in grid some key values must be not in repeat
please help me
Regards
Prakash Paul
Prakash
|
|
|
|
|
Hi,
(i) Use Edit Item Template to update the grid.
(ii) Your data source may contain values from multiple tables, but that won't create any problem as you can simply put those values into a datatable and bind the data table to the data grid vew.
(iii) Use AJAXAutoCompleteExtender control in the row data bound event of the data grid view. You need to use it dynamically.
(iv) you have to check it in your query and ensure that only distinct rows come into the result set.
Regards
Saanj
Either you love IT or leave IT...
|
|
|
|
|
Using c#, how can I catch the onclick event when a user clicks on "BACK" button on top left corner of Internet Explorer window, I want to do this using a BHO...
|
|
|
|
|
svt gdwl wrote: Using c#, how can I catch the onclick event
First you need to understand the difference between between Client and server side execution.
You can never do this by using C#.
Manas Bhardwaj
Please remember to rate helpful or unhelpful answers, it lets us and people reading the forums know if our answers are any good.
|
|
|
|
|
|
problem arises when fetching cursors.
please help asap.
the function code:
set ANSI_NULLS ON
set QUOTED_IDENTIFIER ON
go
CREATE FUNCTION Get_Coll_Ovd_Report
(
@fromDate datetime,
@ToDate datetime,
@dtOvdDate datetime,
@dtOvdDatePrev datetime,
@strAndPaid VARCHAR(300),
@rdoFileInfoSpecific int,
@SpecificFileNo varchar(20),
@strAndFOfficer varchar(100),
@strAndZone varchar(100),
@strCollType varchar(50),
@rdoStatusNID smallint,
@rdoStatusBankOpen smallint,
@chkOvdVal smallint,
@rdoRepTypeAllDet smallint
)Returns @retVal table(
[SLNo] int,
[TDate] DateTime,
[GLRef] Varchar(50),
[LdgAcNo] Varchar(50),
[AcName] Varchar(200),
[MRNo] int,
[GLName] Varchar(200),
[Cash] decimal(18,6),
[Clear] decimal(18,6),
[Trans] decimal(18,6),
[CnTot] decimal(18,6),
[FileNo] Varchar(50),
[NidStat] smallint,
[UserID] Varchar(50),
[District] Varchar(50),
[PaidAt] Varchar(50),
[ZMrNo] Varchar(50),
[ZMrDate] DateTime,
[Model] Varchar(50),
[FOID] int,
[FClBal] decimal(18,6),
[TotCol] decimal(18,6),
[BLoan] decimal(18,6),
[BTotDr] decimal(18,6),
[OvdPrv] decimal(18,6),
[P1] decimal(18,6),
[P2] decimal(18,6))
AS
BEGIN
declare @f_SLNo int,@f_TDate datetime,@f_GLRef varchar(50), @f_LdgAcNo varchar(50) , @f_AcName varchar(200) , @f_MRNo int, @f_GLName varchar(50), @f_Cash decimal(18,6), @f_Clear decimal(18,6), @f_Trans decimal(18,6), @f_CnTot decimal(18,6), @f_FileNo varchar(30) , @f_NidStat smallint , @f_UserID varchar(50), @f_District varchar(50) , @f_PaidAt Varchar(50), @f_ZMrNo Varchar(50), @f_ZMrDate datetime, @f_Model Varchar(50) , @f_FOID int, @f_FClBal decimal(18,6), @f_TotCol decimal(18,6), @f_BLoan decimal(18,6), @f_BTotDr decimal(18,6), @f_OvdPrv decimal(18,6), @f_P1 decimal(18,6), @f_P2 decimal(18,6)
declare @strSQL varchar(2000),
@LdgAcNo varchar(12),
@MAcName varchar(80),
@FileNo varchar(30),
@MaxiInstlAmt decimal(18,0),
@MaxiMinInstlAmt decimal(18,0),
@DCPDt datetime,
@FClBal decimal(18,6),
@Ac_Status smallint,
@FileClosedDt datetime,
@ReconV varchar(15),
@GuestPrdComp smallint,
@TermComp smallint,
@FOID int,
@FOName Varchar(100),
@DistName Varchar(50),
@ZName Varchar(50),
@Model Varchar(150),
@Ac_StatusB smallint,
@BClosedDt datetime,
@SzdStatus varchar(50),
@SzdDate datetime,
@IntRt decimal(18,6),
@LoanAmt decimal(18,6),
@TotAmt decimal(18,6)
set @strSQL = 'SELECT Distinct
tblILedger.LdgAcNo,
tblBuyerMst.MAcName,
tblVLedger.FileNo,
tblVLedger.MaxiInstlAmt,
tblVLedger.MaxiMinInstlAmt,
tblDCDetail.DCPDt,
tblILedger.FClBal,
tblILedger.Ac_Status,
tblVLedger.FileClosedDt,
tblVLedger.ReconV,
tblVLedger.GuestPrdComp,
tblVLedger.TermComp,
tblVLedger.FOID,
tblFOfficer.FOName,
tblDistMst.DistName,
tblZoneMst.ZName,
tblModelMst.Model,
tblLoanDoc.Ac_StatusB,
tblLoanDoc.BClosedDt,
tblVLedger.SzdStatus,
tblVLedger.SzdDate,
tblVLedger.IntRt,
tblLoanDoc.LoanAmt,
ISNULL((SELECT SUM(tblMRMst.TotAmt)From tblMRMst Where (tblMRMst.LdgAcNo = tblILedger.LdgAcNo) AND (tblMRMst.TotAmt > 0) AND (tblMRMst.Rvrs = 0 OR tblMRMst.Rvrs is Null) ' + @strAndPaid + '),0) AS TotAmt '+
'FROM tblVLedger INNER JOIN tblILedger ON tblILedger.LdgAcNo = tblVLedger.LdgAcNo INNER JOIN
tblDCDetail ON tblVLedger.DCNo = tblDCDetail.DCNo INNER JOIN tblBuyerMst ON
tblDCDetail.BNo = tblBuyerMst.BNo INNER JOIN
tblDistMst ON tblBuyerMst.MDistID = tblDistMst.DistID INNER JOIN tblZoneMst ON tblBuyerMst.MZID = tblZoneMst.ZID
Inner Join tblModelMst ON tblDCDetail.MNo=tblModelMst.MNo
Inner Join tblFOfficer ON tblVLedger.FOID=tblFOfficer.FOID
INNER JOIN tblLoanDoc ON tblDCDetail.DCNo = tblLoanDoc.DCNo
WHERE (tblDCDetail.DCPDt <'''+cast(@fromDate as varchar(20))+''')
AND ((tblILedger.Ac_status = 1) OR ((tblILedger.Ac_status = 0) AND (tblVLedger.FileClosedDt >='''+cast(@fromDate as varchar(20))+''')))'
if (@rdoFileInfoSpecific=1)
begin
set @strSQL = @strSQL + ' AND (tblVLedger.FileNo= '+@SpecificFileNo+')'
end
if (@rdoStatusBankOpen=1)
begin
set @strSQL = @strSQL + ' AND (tblLoanDoc.Ac_StatusB=1 OR (tblLoanDoc.Ac_StatusB = 0 AND tblLoanDoc.BClosedDt >= '''+cast(@fromDate as varchar(20))+'''))'
end
else
begin
if(@rdoStatusNID=1)
begin
set @strSQL = @strSQL + ' AND (tblLoanDoc.Ac_StatusB=0 AND (tblLoanDoc.BClosedDt is null OR tblLoanDoc.BClosedDt< '''+cast(@fromDate as varchar(20))+'''))'
end
end
set @strSQL = @strSQL + @strAndFOfficer;
set @strSQL = @strSQL + @strAndZone;
set @strSQL = @strSQL + @strCollType;
set @strSQL = @strSQL + ' ORDER BY tblZoneMst.ZName,tblVLedger.FOID,tblVLedger.FileNo'
-- end of main query string
declare curMain cursor for select @strsql
open curMain
--local variables
declare @dblPer int, @divisor int, @intTotMonths int,@blnSzdStatus smallint
fetch next from curMain into @LdgAcNo , @MAcName , @FileNo , @MaxiInstlAmt , @MaxiMinInstlAmt , @DCPDt , @FClBal, @Ac_Status , @FileClosedDt , @ReconV , @GuestPrdComp , @TermComp , @FOID , @FOName , @DistName , @ZName , @Model , @Ac_StatusB , @BClosedDt , @SzdStatus , @SzdDate , @IntRt , @LoanAmt , @TotAmt
WHILE @@FETCH_STATUS = 0
BEGIN
-- A lot of codes goes here . but they do not raises the error. I checked it.
--insert into @retVal values(@f_SLNo,@f_TDate,@f_GLRef , @f_LdgAcNo , @f_AcName , @f_MRNo, @f_GLName , @f_Cash, @f_Clear, @f_Trans, @f_CnTot, @f_FileNo , @f_NidStat , @f_UserID , @f_District , @f_PaidAt , @f_ZMrNo , @f_ZMrDate, @f_Model , @f_FOID, @f_FClBal, @f_TotCol, @f_BLoan, @f_BTotDr, @f_OvdPrv, @f_P1, @f_P2)
fetch next from curMain into @LdgAcNo , @MAcName , @FileNo , @MaxiInstlAmt , @MaxiMinInstlAmt , @DCPDt , @FClBal, @Ac_Status , @FileClosedDt , @ReconV , @GuestPrdComp , @TermComp , @FOID , @FOName , @DistName , @ZName , @Model , @Ac_StatusB , @BClosedDt , @SzdStatus , @SzdDate , @IntRt , @LoanAmt , @TotAmt
END
CLOSE curMain
DEALLOCATE curMain
return
END
calling with:
select * from dbo.Get_Coll_Ovd_Report
(
'14 Apr 2009',
'10 May 2009',
'13 Apr 2009',
'10 May 2009',
'',--' this will be andpaid clause',
0,-- this is tag for file specific
'900',-- this is file no
'470',--'officer id', -- all officer
'',--' zone id',-- zone id
'',--'coll type',
0,--is nid
0,
0,
1
-- is bank open
)
output:
Msg 16924, Level 16, State 1, Line 1
Cursorfetch: The number of variables declared in the INTO list must match that of selected columns.
|
|
|
|
|
Your post is a database question, and you should post this in the database forum.
"WPF has many lovers. It's a veritable porn star!" - Josh Smith As Braveheart once said, "You can take our freedom but you'll never take our Hobnobs!" - Martin Hughes.
My blog | My articles | MoXAML PowerToys | Onyx
|
|
|
|
|
Pete O'Hanlon wrote: you should post this in the database forum
It's a fantastic candidate for the "Coding Horrors" forum instead.
It is a crappy thing, but it's life -^ Carlo Pallini
|
|
|
|
|
you know the sp has lots of code than high level language
|
|
|
|
|
try to remove the next from from the code below and try again
open curMain
--local variables
declare @dblPer int, @divisor int, @intTotMonths int,@blnSzdStatus smallint
fetch next from curMain into @LdgAcNo , @MAcName , @FileNo , @MaxiInstlAmt , @MaxiMinInstlAmt , @DCPDt , @FClBal, @Ac_Status , @FileClosedDt , @ReconV , @GuestPrdComp , @TermComp , @FOID , @FOName , @DistName , @ZName , @Model , @Ac_StatusB , @BClosedDt , @SzdStatus , @SzdDate , @IntRt , @LoanAmt , @TotAmt
change it into fetch curMain into @LdgAcNo,....
|
|
|
|
|
I have tried it.
returns same message
mir
|
|
|
|
|
Be sure that the number of columns you are selecting in the select statement for the cursor is the same number of variables that you have when calling the Fetch
|
|
|
|
|
I have chacked it several times . Everything is fine . also the length for varchar types. the message not shown if I select into the first variable only. I don't know whats the problem with it . but I have wrote a lot of sp with such select into.
|
|
|
|
|
In the query you are building you have Select Distinct and when you are creating the cursor you have another SELECT. it can be that there is the problem. when it tis being executed you are havin
SELECT SELECT DISTINCT...
|
|
|
|
|