0

根据@CreativeManix 的建议,我开始调查 petaPeco

在asp.net mvc应用程序中检索大量行(超过1000万)

添加确切的 system.data.oracleclient + 将 web.config 放入 mvc 在 .dll 中编译的 bin 后,我收到以下错误:

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 后运行转换时会出现此错误。

我知道的一件事是错误来自“GetCurrentProject” - 可能 - “(Array)dte.ActiveSolutionProjects”

我认为在我的项目中设置 petaPoco 的方式有问题!不知何故,它找不到 activesolution 项目。我不太确定如何解决它。

4

1 回答 1

0

I investigated this.

In my question section I asked few questions:

  1. I was not sure about how to fire transformation/or process of generating Database.CS. So initially I was installing petapoco from the command prompt- I

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

  1. To enable Oracle data client to read the schema out of oracle database I needed to take out following entry:

cmd.GetType().GetProperty("BindByName").SetValue(cmd, true, null);

And everything worked.

  1. Connection string can look like:

connectionString="Data Source=PXWREG;Persist Security Info=True;User ID=XWREG_ACDS_T;password=isacdst"

于 2013-08-19T17:33:35.677 回答