J
Jim Heavey
I have been trying to figure out why when I set the MissingSchemaAction=
Error, I am getting an error. I have run out of ideas why this is
occurring. I know that I could choose the "passthrough" setting and all
would be well, but I want to understand why it is not happening - what
property am I not setting correctly?
I have enclosed everything about this situation as I can think of.
Here is the DDL for my small table (just a primary key, not foreign
keys)
CREATE TABLE [SkatingClubs] (
[ClubID] [uniqueidentifier] NOT NULL CONSTRAINT
[DF_SkatingClub_ClubID] DEFAULT (newid()),
[ClubName] [char] (50) COLLATE SQL_Latin1_General_CP1_CI_AS NOT
NULL ,
CONSTRAINT [PK_SkatingClubs] PRIMARY KEY CLUSTERED
(
[ClubID]
) ON [PRIMARY]
) ON [PRIMARY]
GO
Here is how I set the table up in code...
DataTable dtClubs = new DataTable("SkatingClubs");
dtClubs.Columns.Add("ClubID",typeof(Guid));
dtClubs.Columns["ClubID"].AllowDBNull=false;
dtClubs.Columns["ClubID"].Unique=true;
dtClubs.Columns.Add("ClubName", typeof(string));
dtClubs.Columns["ClubName"].AllowDBNull=false;
dtClubs.Columns["ClubName"].MaxLength=50;
dtClubs.Columns["ClubName"].Unique=false;
// set up primary key for Clubs Table
DataColumn[] pkClubs = { dtClubs.Columns["ClubID"] };
dtClubs.PrimaryKey=pkClubs;
ds.Tables.Add(dtClubs); // add to the dataset
da.MissingMappingAction=MissingMappingAction.Error ;
da.MissingSchemaAction=MissingSchemaAction.Error ;
daFill(dtClubs);
Here is the Proc that I am executing (a little stripped down...)
select ClubID, ClubName
from dbo.SkatingClubs
set @recCount = @@ROWCOUNT
I get the following error "Missing Table Mapping when
TableMapping.DatasetTable='SkatingClubs'"
Any ideas as to what the "MissingMapping" might be?
Error, I am getting an error. I have run out of ideas why this is
occurring. I know that I could choose the "passthrough" setting and all
would be well, but I want to understand why it is not happening - what
property am I not setting correctly?
I have enclosed everything about this situation as I can think of.
Here is the DDL for my small table (just a primary key, not foreign
keys)
CREATE TABLE [SkatingClubs] (
[ClubID] [uniqueidentifier] NOT NULL CONSTRAINT
[DF_SkatingClub_ClubID] DEFAULT (newid()),
[ClubName] [char] (50) COLLATE SQL_Latin1_General_CP1_CI_AS NOT
NULL ,
CONSTRAINT [PK_SkatingClubs] PRIMARY KEY CLUSTERED
(
[ClubID]
) ON [PRIMARY]
) ON [PRIMARY]
GO
Here is how I set the table up in code...
DataTable dtClubs = new DataTable("SkatingClubs");
dtClubs.Columns.Add("ClubID",typeof(Guid));
dtClubs.Columns["ClubID"].AllowDBNull=false;
dtClubs.Columns["ClubID"].Unique=true;
dtClubs.Columns.Add("ClubName", typeof(string));
dtClubs.Columns["ClubName"].AllowDBNull=false;
dtClubs.Columns["ClubName"].MaxLength=50;
dtClubs.Columns["ClubName"].Unique=false;
// set up primary key for Clubs Table
DataColumn[] pkClubs = { dtClubs.Columns["ClubID"] };
dtClubs.PrimaryKey=pkClubs;
ds.Tables.Add(dtClubs); // add to the dataset
da.MissingMappingAction=MissingMappingAction.Error ;
da.MissingSchemaAction=MissingSchemaAction.Error ;
daFill(dtClubs);
Here is the Proc that I am executing (a little stripped down...)
select ClubID, ClubName
from dbo.SkatingClubs
set @recCount = @@ROWCOUNT
I get the following error "Missing Table Mapping when
TableMapping.DatasetTable='SkatingClubs'"
Any ideas as to what the "MissingMapping" might be?