问题
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.
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?
回答1:
If the message is "database logon failed", you can try:
1) Open the RPT file and use the command "Verify Database". Redeploy and test.
2) If your RPT is using more than one datasource (2 XSD files for example), try to merge than into one.
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).
来源:https://stackoverflow.com/questions/25615022/set-data-source-to-datatable-that-only-exists-in-dataset-not-an-actual-table-i