未知数据库连接器错误在我的代码

未知数据库连接器错误在我的代码

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

问题描述

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:

为了让您知道,我是由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>

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

07-30 21:29