Written at that time Program Because the boss had to make a PDF report, it was too troublesome for Crystal Report deployment, so he used reportviewer and got lazy in the middle. He directly used typed dataset to generate dataset, the problem occurs because the original project is re-built to another company, and the database name is changed, when typed dataset was used at that time, it was directly generated according to the connectionstring name at that time. As a result, the typed dataset still called the connectionstring at that time... The original connectionstring name has been changed, and an inexplicable error occurs .. When I found the result, I thought about Typed Dataset. I couldn't find connectionstring when I checked the query. Alas! Leave a footprint here to avoid the same errors in the future
< Datasource Defaultconnectionindex = "0" Functionscomponentname = "Queriestableadapter" Modifier = "Autolayout, ansiclass, class, public" Schemaserializationmode = "Includeschema" Xmlns = "Urn: Schemas-Microsoft-com: XML-msdatasource" >
< Connections >
< Connection Appsettingsobjectname = "Web. config" Appsettingspropertyname = "XXXX" Connectionstringobject = "" Isappsettingsproperty = "True" Modifier = "Assembly" Name = "XXX (Web. config )" Parameterprefix = "@" Propertyreference = "Appconfig. system. configuration. configurationmanager.0.connectionstrings. xxxconnectionstring" Provider = "System. Data. sqlclient" >
</ Connection >
</ Connections >
< Tables >
YesAppsettingspropertynameIf you have the same problem, check it first.