将数据源设置为仅存在于数据集中的数据表中,而不是数据库中的实际表 [英] Set Data Source to datatable that only exists in dataset.. not an actual table in database

查看:86
本文介绍了将数据源设置为仅存在于数据集中的数据表中,而不是数据库中的实际表的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在数据集(.xsd文件)中创建了一个数据表,然后在其中填充代码。该数据表与sql中的实际表不对应。当我将此数据表设置为Crystal中的数据源时,出现数据库登录错误。

I created a datatable in my dataset (.xsd file) which I fill in code behind. This datatable doesn't correspond to an actual table in sql. When I set this datatable as the data source in crystal I get database logon error.

作为一种解决方法,我实际上是在sql中创建此表以使晶体起作用。

As a work around I actually create this table in sql for the crystal to work.

是否有一个没有上面的变通办法来做到这一点?

Is there a way of doing this without the above work around?

推荐答案

如果消息为数据库登录失败,则可以尝试:

If the message is "database logon failed", you can try:

1)打开RPT文件并使用命令验证数据库。重新部署和测试。

1) Open the RPT file and use the command "Verify Database". Redeploy and test.

2)如果您的RPT使用多个数据源(例如2个XSD文件),请尝试将多个数据源合并为一个。

2) If your RPT is using more than one datasource (2 XSD files for example), try to merge than into one.

3)验证数据集表列是否具有明确定义的类型。如果否,请定义它们。检查XSD中的类型是否相同。不要使用掩码类型(例如,将日期转换为字符串)。

3) Verify if the dataset tables columns have type defined explicitly. If no, define them. Check if the types are the same in the XSD. Dont "mask" type (convert date to string for example).

这篇关于将数据源设置为仅存在于数据集中的数据表中,而不是数据库中的实际表的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆