运行转换时出错:indexoutofrangeexception-Petapeco [英] error in running transformation:indexoutofrangeexception - petapeco
问题描述
根据@CreativeManix的建议,我开始调查petaPeco
as per suggestion for by @CreativeManix I started investigating petaPeco
Retrieving large number of rows (more than 10 mil) in asp.net mvc application
添加完精确的system.data.oracleclient +将web.config放入在.dll中编译mvc的容器中后,出现以下错误:
After adding exact system.data.oracleclient + putting web.config in the bin where mvc is getting compiled in .dll I got following error:
Error 3
Running transformation: System.IndexOutOfRangeException: Index was outside the bounds of the array.
at System.Array.InternalGetReference(Void* elemRef, Int32 rank, Int32* pIndices)
at System.Array.GetValue(Int32 index)
at Microsoft.VisualStudio.TextTemplating5F4490FB7AE018243DBB4DF6250E7211.GeneratedTextTransformation.GetCurrentProject()
at Microsoft.VisualStudio.TextTemplating5F4490FB7AE018243DBB4DF6250E7211.GeneratedTextTransformation.GetConnectionString(String& connectionStringName, String& providerName)
at Microsoft.VisualStudio.TextTemplating5F4490FB7AE018243DBB4DF6250E7211.GeneratedTextTransformation.InitConnectionString()
at Microsoft.VisualStudio.TextTemplating5F4490FB7AE018243DBB4DF6250E7211.GeneratedTextTransformation.LoadTables()
at Microsoft.VisualStudio.TextTemplating5F4490FB7AE018243DBB4DF6250E7211.GeneratedTextTransformation.TransformText()
at Microsoft.VisualStudio.TextTemplating.TransformationRunner.RunTransformation(TemplateProcessingSession session, String source, ITextTemplatingEngineHost host, String& result)
在安装petaPoco之后运行转换时会出现此错误.
This error shows up when i run the transformation after installation of petaPoco.
我确实知道错误来自"GetCurrentProject" -可能是-(Array)dte.ActiveSolutionProjects"
One thing I do know the error is coming from "GetCurrentProject" - and probably - "(Array)dte.ActiveSolutionProjects"
我认为在我的项目中设置petaPoco的方式有问题!不知何故找不到activesolution项目.我不太确定如何解决它.
I think something is wrong in the way petaPoco is set up with my project! somehow it can't find the activesolution project. I am not too sure how to fix it.
推荐答案
我对此进行了调查.
在我的问题部分,我问了几个问题:
In my question section I asked few questions:
- 我不确定如何启动转换/或生成Database.CS的过程.因此,最初我是从命令提示符下安装petapoco的-我
要执行此操作,只需在"Database.tt"上单击鼠标右键,然后单击运行自定义工具".如果您的连接字符串正确+您引用的是正确的Oracle/SQL Server数据提供程序+该提供程序可在GAC +中使用(如果它是oracle,并且您具有尝试访问的数据库的默认架构用户的密码)-然后应该会生成Database.cs
To do that you just click "Run Custom Tool" by right clicking on the "Database.tt". If your connection string is correct + you are referencing correct Oracle/SQL server data provider + that provider is available in GAC + (if it is oracle and you have the password for the default schema user of the database you are trying to access)- then that should generate the Database.cs
- 要使Oracle数据客户端能够从oracle数据库中读取模式,我需要删除以下条目:
cmd.GetType().GetProperty("BindByName").SetValue(cmd,true,null);
一切正常.
- 连接字符串如下所示:
connectionString ="Data Source = PXWREG; Persist Security Info = True;用户ID = XWREG_ACDS_T; password = isacdst"
这篇关于运行转换时出错:indexoutofrangeexception-Petapeco的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!