我的代码中出现未知数据库连接器错误

unknown database connector error in my code(我的代码中出现未知数据库连接器错误)
本文介绍了我的代码中出现未知数据库连接器错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

Dim rp As New ReportDocument
Dim myData As New MyDataSet
Dim dt As New MyDataSet.UserDataTable
Dim FirstRow As MyDataSet.UserRow = _
  CType(myData.User.NewRow, MyDataSet.UserRow)
FirstRow.MemberID = "1"
FirstRow.FirstName = "Amir Hossein"
FirstRow.LastName = "Rahnama"
myData.User.Rows.Add(FirstRow)

Dim SecondRow As MyDataSet.UserRow = _
  CType(myData.User.NewRow, MyDataSet.UserRow)
SecondRow.MemberID = "2"
SecondRow.FirstName = "Aziz"
SecondRow.LastName = "Khodaie"
myData.User.Rows.Add(SecondRow)

rp.Load("C:Report.rpt")
rp.SetDataSource(myData)
CRV1.ReportSource = rp

设置数据源的时候报错:

When setting the datasource It comes up with an error:

未知的数据库连接器错误文件 C:DOCUME~1A_RAHN~1LOCALS~1Temp1Report {832105B2-2E31-4018-9761-77581CC86142}.rpt 中的错误:未知的数据库连接器错误

Unknown Database Connector Error Error in File C:DOCUME~1A_RAHN~1LOCALS~1Temp1Report {832105B2-2E31-4018-9761-77581CC86142}.rpt: Unknown Database Connector Error

为了让您知道,我通过 Crystal Reports 2008 独立 IDE 创建了该报表,而不是在 VS2010 IDE 中生成它,并且它通过水晶报表向导绑定到该数据集.

To let you know, I created that report by Crystal Reports 2008 Stand-alone IDE rather than generating it in VS2010 IDE and it is binded to that dataset dutring the crystal report wizard.

推荐答案

您需要做的是,您将按以下顺序将属性添加到启动元素:

What you need to do is that you will add an attribute to startup element in the following order:

 <startup useLegacyV2RuntimeActivationPolicy="true">        
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.0"/>
</startup>

这篇关于我的代码中出现未知数据库连接器错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!

本站部分内容来源互联网,如果有图片或者内容侵犯您的权益请联系我们删除!

相关文档推荐

c# Generic Setlt;Tgt; implementation to access objects by type(按类型访问对象的C#泛型集实现)
InvalidOperationException When using Context Injection in ASP.Net Core(在ASP.NET核心中使用上下文注入时发生InvalidOperationException)
quot;Overflowquot; compiler error with -9223372036854775808L(编译器错误-9223372036854775808L(Q;溢出Q))
Visual Studio 2010 ReportViewer Assembly References(Visual Studio 2010 ReportViewer程序集引用)
Weird behaviour when I open a reportviewer in WPF(在WPF中打开报表查看器时出现奇怪的行为)
how do i pass parameters to aspnet reportviewer(如何将参数传递给aspnet report查看器)