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

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>

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

本文标题为:我的代码中出现未知数据库连接器错误

基础教程推荐