为什么列映射与源到目标不匹配,即使源和目标中具有相同数据类型的列数相同? [英] Why Column mapping mismatch with source to destination even when there are same number of columns in both source and destination with same datatype?

查看:884
本文介绍了为什么列映射与源到目标不匹配,即使源和目标中具有相同数据类型的列数相同?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

您好我正在使用数据表列名创建一个sql表。我有每列的数据。我使用SQLBulkCopy将列值从datatable复制到sqltable。我在源和目标中具有相同数量的列,具有相同的数据类型。但我得到一个例外,因为 Given ColumnMapping与源或目标中的任何列不匹配。这两个表都没有标识列。给我解决方案。

Hi I am creating a sql table by using datatable column names. And I have data for each column. I am using SQLBulkCopy for copying column values from datatable to sqltable. I have same number of columns in both source and destination with same datatype. But I am getting an exception as The Given ColumnMapping does not match up with any column in the source or destination. And Both the tables have no identity column too. Give me the solution.

推荐答案

可能有各种原因。请参阅 http://social.msdn.microsoft.com/Forums/en-US/a77f0c77-17ae-403e-bc9e-2127d003ed20/sqlbulkcopy- the-given-columnmapping-does-up-with-any-column-in-the-source-or forum = adodotnetdataproviders [ ^ ]以获取建议。
It can be various reasons. Please see http://social.msdn.microsoft.com/Forums/en-US/a77f0c77-17ae-403e-bc9e-2127d003ed20/sqlbulkcopy-the-given-columnmapping-does-not-match-up-with-any-column-in-the-source-or?forum=adodotnetdataproviders[^] for suggestions.


这篇关于为什么列映射与源到目标不匹配,即使源和目标中具有相同数据类型的列数相同?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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