|
dev
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
Failed to enable constraints but please tell me sth."Failed to enable constraints. One or more rows contain values violating non-null, unique, or foreign-key constraints." I'v read a lot, but this solutions doesn't resolve my problem. I'm using Strongly typed datasets, and ObjectDataSources. And I can't operate with DataSet property EnforceConstrains. Lets look at my tables. I have 2 tables pools ------------ pools_id (PK, int, autoinc) pools_title (varchar(50) pools_questions ------------ pools_questions_id (PK, int, autoinc) pools_id (FK, not null) pools_questions_question (varchar(50)) pools_questions_votes (int, not null) Everything is ok, when my data looks like this: pools ------------ 1, "Title one" pools_questions ------------ 1, 1, "Yes", 3 but when i have 2 or more rows with the same value in: pools_questions.pools_id for example: pools_questions ------------ 1, 1, "Yes", 3 2, 1, "No", 10 3, 1, "Other", 4 4, 1, "Some", 5 then that data configuration throws error. When I'v designed my tables with SQL Server Management Studio Express, I setup relationship with property Enforce Foreing Key Constarints: True, and False - this doesnt work for me. Please somebody help me with this problem. Thanks in advance. Darek Hi,
I guess first two columns of pools_questions are crossed (first might be pools_id and the other pools_questions_id) or the reference is wrongly set (double check its fields). -- Show quoteMiha Markic [MVP C#, INETA Country Leader for Slovenia] RightHand .NET consulting & development www.rthand.com Blog: http://cs.rthand.com/blogs/blog_with_righthand/ "DariuszTarczynski" <dtarczyn***@gmail.com> wrote in message news:1155660179.068965.74750@b28g2000cwb.googlegroups.com... > Hello. I'm know, there is tones of pages in google, etc. about problem: > "Failed to enable constraints. One or more rows contain values > violating non-null, unique, or foreign-key constraints." I'v read a > lot, but this solutions doesn't resolve my problem. I'm using Strongly > typed datasets, and ObjectDataSources. And I can't operate with DataSet > property EnforceConstrains. > Lets look at my tables. I have 2 tables > > pools > ------------ > pools_id (PK, int, autoinc) > pools_title (varchar(50) > > pools_questions > ------------ > pools_questions_id (PK, int, autoinc) > pools_id (FK, not null) > pools_questions_question (varchar(50)) > pools_questions_votes (int, not null) > > Everything is ok, when my data looks like this: > > pools > ------------ > 1, "Title one" > > pools_questions > ------------ > 1, 1, "Yes", 3 > > but when i have 2 or more rows with the same value in: > pools_questions.pools_id for example: > > pools_questions > ------------ > 1, 1, "Yes", 3 > 2, 1, "No", 10 > 3, 1, "Other", 4 > 4, 1, "Some", 5 > > then that data configuration throws error. > When I'v designed my tables with SQL Server Management Studio Express, > I setup relationship with property Enforce Foreing Key Constarints: > True, and False - this doesnt work for me. > > Please somebody help me with this problem. Thanks in advance. > Darek > thanks for response, i think everything is allright, but I have errors.
Mayby somebody looks for scritps for tables: CREATE TABLE [dbo].[pools]( [pools_id] [int] IDENTITY(1,1) NOT NULL, [pools_title] [varchar](50) COLLATE Polish_CI_AS NOT NULL, CONSTRAINT [PK_pools] PRIMARY KEY CLUSTERED ( [pools_id] ASC )WITH (PAD_INDEX = OFF, IGNORE_DUP_KEY = OFF) ON [PRIMARY] ) ON [PRIMARY] GO SET ANSI_PADDING OFF CREATE TABLE [dbo].[pools_questions]( [pools_questions_id] [int] IDENTITY(1,1) NOT NULL, [pools_id] [int] NOT NULL, [pools_questions_question] [varchar](50) COLLATE Polish_CI_AS NOT NULL, [pools_questions_votes] [int] NOT NULL CONSTRAINT [DF_pools_questions_pools_questions_votes] DEFAULT ((0)), CONSTRAINT [PK_pools_questions] PRIMARY KEY CLUSTERED ( [pools_questions_id] ASC )WITH (PAD_INDEX = OFF, IGNORE_DUP_KEY = OFF) ON [PRIMARY] ) ON [PRIMARY] GO SET ANSI_PADDING OFF GO ALTER TABLE [dbo].[pools_questions] WITH CHECK ADD CONSTRAINT [FK_pools_questions_pools] FOREIGN KEY([pools_id]) REFERENCES [dbo].[pools] ([pools_id]) GO ALTER TABLE [dbo].[pools_questions] CHECK CONSTRAINT [FK_pools_questions_pools] How does your strong typed dataset look like (there is the problem)?
-- Show quoteMiha Markic [MVP C#, INETA Country Leader for Slovenia] RightHand .NET consulting & development www.rthand.com Blog: http://cs.rthand.com/blogs/blog_with_righthand/ "DariuszTarczynski" <dtarczyn***@gmail.com> wrote in message news:1155671463.688814.130810@p79g2000cwp.googlegroups.com... > thanks for response, i think everything is allright, but I have errors. > Mayby somebody looks for scritps for tables: > > CREATE TABLE [dbo].[pools]( > [pools_id] [int] IDENTITY(1,1) NOT NULL, > [pools_title] [varchar](50) COLLATE Polish_CI_AS NOT NULL, > CONSTRAINT [PK_pools] PRIMARY KEY CLUSTERED > ( > [pools_id] ASC > )WITH (PAD_INDEX = OFF, IGNORE_DUP_KEY = OFF) ON [PRIMARY] > ) ON [PRIMARY] > > GO > SET ANSI_PADDING OFF > > > CREATE TABLE [dbo].[pools_questions]( > [pools_questions_id] [int] IDENTITY(1,1) NOT NULL, > [pools_id] [int] NOT NULL, > [pools_questions_question] [varchar](50) COLLATE Polish_CI_AS NOT > NULL, > [pools_questions_votes] [int] NOT NULL CONSTRAINT > [DF_pools_questions_pools_questions_votes] DEFAULT ((0)), > CONSTRAINT [PK_pools_questions] PRIMARY KEY CLUSTERED > ( > [pools_questions_id] ASC > )WITH (PAD_INDEX = OFF, IGNORE_DUP_KEY = OFF) ON [PRIMARY] > ) ON [PRIMARY] > > GO > SET ANSI_PADDING OFF > GO > ALTER TABLE [dbo].[pools_questions] WITH CHECK ADD CONSTRAINT > [FK_pools_questions_pools] FOREIGN KEY([pools_id]) > REFERENCES [dbo].[pools] ([pools_id]) > GO > ALTER TABLE [dbo].[pools_questions] CHECK CONSTRAINT > [FK_pools_questions_pools] > STDS looks like this (tables: pools2, pools_questions2):
<TableAdapter BaseClass="System.ComponentModel.Component" DataAccessorModifier="AutoLayout, AnsiClass, Class, Public" DataAccessorName="pools2TableAdapter" GeneratorDataComponentClassName="pools2TableAdapter" Name="pools2" UserDataComponentName="pools2TableAdapter"> <MainSource> <DbSource ConnectionRef="ConnStr (Web.config)" DbObjectName="Dxcommerce.dbo.pools2" DbObjectType="Table" FillMethodModifier="Public" FillMethodName="Fill" GenerateMethods="Both" GenerateShortCommands="True" GeneratorGetMethodName="GetData" GeneratorSourceName="Fill" GetMethodModifier="Public" GetMethodName="GetData" QueryType="Rowset" ScalarCallRetval="System.Object, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" UseOptimisticConcurrency="True" UserGetMethodName="GetData" UserSourceName="Fill"> <DeleteCommand> <DbCommand CommandType="Text" ModifiedByUser="False"> <CommandText>DELETE FROM [dbo].[pools2] WHERE (([pools_id] = @Original_pools_id) AND ([pools_title] = @Original_pools_title))</CommandText> <Parameters> <Parameter AllowDbNull="False" AutogeneratedName="" DataSourceName="" DbType="Int32" Direction="Input" ParameterName="@Original_pools_id" Precision="0" ProviderType="Int" Scale="0" Size="0" SourceColumn="pools_id" SourceColumnNullMapping="False" SourceVersion="Original"> </Parameter> <Parameter AllowDbNull="False" AutogeneratedName="" DataSourceName="" DbType="AnsiString" Direction="Input" ParameterName="@Original_pools_title" Precision="0" ProviderType="VarChar" Scale="0" Size="0" SourceColumn="pools_title" SourceColumnNullMapping="False" SourceVersion="Original"> </Parameter> </Parameters> </DbCommand> </DeleteCommand> <InsertCommand> <DbCommand CommandType="Text" ModifiedByUser="False"> <CommandText>INSERT INTO [dbo].[pools2] ([pools_title]) VALUES (@pools_title); SELECT pools_id, pools_title FROM pools2 WHERE (pools_id = SCOPE_IDENTITY())</CommandText> <Parameters> <Parameter AllowDbNull="False" AutogeneratedName="" DataSourceName="" DbType="AnsiString" Direction="Input" ParameterName="@pools_title" Precision="0" ProviderType="VarChar" Scale="0" Size="0" SourceColumn="pools_title" SourceColumnNullMapping="False" SourceVersion="Current"> </Parameter> </Parameters> </DbCommand> </InsertCommand> <SelectCommand> <DbCommand CommandType="Text" ModifiedByUser="False"> <CommandText>SELECT pools_id, pools_title FROM dbo.pools2</CommandText> <Parameters> </Parameters> </DbCommand> </SelectCommand> <UpdateCommand> <DbCommand CommandType="Text" ModifiedByUser="False"> <CommandText>UPDATE [dbo].[pools2] SET [pools_title] = @pools_title WHERE (([pools_id] = @Original_pools_id) AND ([pools_title] = @Original_pools_title)); SELECT pools_id, pools_title FROM pools2 WHERE (pools_id = @pools_id)</CommandText> <Parameters> <Parameter AllowDbNull="False" AutogeneratedName="" DataSourceName="" DbType="AnsiString" Direction="Input" ParameterName="@pools_title" Precision="0" ProviderType="VarChar" Scale="0" Size="0" SourceColumn="pools_title" SourceColumnNullMapping="False" SourceVersion="Current"> </Parameter> <Parameter AllowDbNull="False" AutogeneratedName="" DataSourceName="" DbType="Int32" Direction="Input" ParameterName="@Original_pools_id" Precision="0" ProviderType="Int" Scale="0" Size="0" SourceColumn="pools_id" SourceColumnNullMapping="False" SourceVersion="Original"> </Parameter> <Parameter AllowDbNull="False" AutogeneratedName="" DataSourceName="" DbType="AnsiString" Direction="Input" ParameterName="@Original_pools_title" Precision="0" ProviderType="VarChar" Scale="0" Size="0" SourceColumn="pools_title" SourceColumnNullMapping="False" SourceVersion="Original"> </Parameter> <Parameter AllowDbNull="False" AutogeneratedName="pools_id" ColumnName="pools_id" DataSourceName="" DataTypeServer="int" DbType="Int32" Direction="Input" ParameterName="@pools_id" Precision="0" ProviderType="Int" Scale="0" Size="4" SourceColumn="pools_id" SourceColumnNullMapping="False" SourceVersion="Current"> </Parameter> </Parameters> </DbCommand> </UpdateCommand> </DbSource> </MainSource> <Mappings> <Mapping SourceColumn="pools_id" DataSetColumn="pools_id" /> <Mapping SourceColumn="pools_title" DataSetColumn="pools_title" /> </Mappings> <Sources> <DbSource ConnectionRef="ConnStr (Web.config)" DbObjectType="Unknown" FillMethodModifier="Public" FillMethodName="FillBy2" GenerateMethods="Both" GenerateShortCommands="True" GeneratorGetMethodName="GetDataBy2" GeneratorSourceName="FillBy2" GetMethodModifier="Public" GetMethodName="GetDataBy2" QueryType="Rowset" ScalarCallRetval="System.Object, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" UseOptimisticConcurrency="True" UserGetMethodName="GetDataBy2" UserSourceName="FillBy2"> <SelectCommand> <DbCommand CommandType="Text" ModifiedByUser="True"> <CommandText>SELECT pools2.pools_id, pools2.pools_title, pools_questions2.pools_questions_votes, pools_questions2.pools_questions_question, pools_questions2.pools_id AS Expr1, pools_questions2.pools_questions_id FROM pools2 INNER JOIN pools_questions2 ON pools2.pools_id = pools_questions2.pools_id</CommandText> <Parameters> </Parameters> </DbCommand> </SelectCommand> </DbSource> </Sources> </TableAdapter> <TableAdapter BaseClass="System.ComponentModel.Component" DataAccessorModifier="AutoLayout, AnsiClass, Class, Public" DataAccessorName="pools_questions2TableAdapter" GeneratorDataComponentClassName="pools_questions2TableAdapter" Name="pools_questions2" UserDataComponentName="pools_questions2TableAdapter"> <MainSource> <DbSource ConnectionRef="ConnStr (Web.config)" DbObjectName="Dxcommerce.dbo.pools_questions2" DbObjectType="Table" FillMethodModifier="Public" FillMethodName="Fill" GenerateMethods="Both" GenerateShortCommands="True" GeneratorGetMethodName="GetData" GeneratorSourceName="Fill" GetMethodModifier="Public" GetMethodName="GetData" QueryType="Rowset" ScalarCallRetval="System.Object, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" UseOptimisticConcurrency="True" UserGetMethodName="GetData" UserSourceName="Fill"> <DeleteCommand> <DbCommand CommandType="Text" ModifiedByUser="False"> <CommandText>DELETE FROM [dbo].[pools_questions2] WHERE (([pools_questions_id] = @Original_pools_questions_id) AND ([pools_id] = @Original_pools_id) AND ([pools_questions_question] = @Original_pools_questions_question) AND ([pools_questions_votes] = @Original_pools_questions_votes))</CommandText> <Parameters> <Parameter AllowDbNull="False" AutogeneratedName="" DataSourceName="" DbType="Int32" Direction="Input" ParameterName="@Original_pools_questions_id" Precision="0" ProviderType="Int" Scale="0" Size="0" SourceColumn="pools_questions_id" SourceColumnNullMapping="False" SourceVersion="Original"> </Parameter> <Parameter AllowDbNull="False" AutogeneratedName="" DataSourceName="" DbType="Int32" Direction="Input" ParameterName="@Original_pools_id" Precision="0" ProviderType="Int" Scale="0" Size="0" SourceColumn="pools_id" SourceColumnNullMapping="False" SourceVersion="Original"> </Parameter> <Parameter AllowDbNull="False" AutogeneratedName="" DataSourceName="" DbType="AnsiString" Direction="Input" ParameterName="@Original_pools_questions_question" Precision="0" ProviderType="VarChar" Scale="0" Size="0" SourceColumn="pools_questions_question" SourceColumnNullMapping="False" SourceVersion="Original"> </Parameter> <Parameter AllowDbNull="False" AutogeneratedName="" DataSourceName="" DbType="Int32" Direction="Input" ParameterName="@Original_pools_questions_votes" Precision="0" ProviderType="Int" Scale="0" Size="0" SourceColumn="pools_questions_votes" SourceColumnNullMapping="False" SourceVersion="Original"> </Parameter> </Parameters> </DbCommand> </DeleteCommand> <InsertCommand> <DbCommand CommandType="Text" ModifiedByUser="False"> <CommandText>INSERT INTO [dbo].[pools_questions2] ([pools_id], [pools_questions_question], [pools_questions_votes]) VALUES (@pools_id, @pools_questions_question, @pools_questions_votes); SELECT pools_questions_id, pools_id, pools_questions_question, pools_questions_votes FROM pools_questions2 WHERE (pools_questions_id = SCOPE_IDENTITY())</CommandText> <Parameters> <Parameter AllowDbNull="False" AutogeneratedName="" DataSourceName="" DbType="Int32" Direction="Input" ParameterName="@pools_id" Precision="0" ProviderType="Int" Scale="0" Size="0" SourceColumn="pools_id" SourceColumnNullMapping="False" SourceVersion="Current"> </Parameter> <Parameter AllowDbNull="False" AutogeneratedName="" DataSourceName="" DbType="AnsiString" Direction="Input" ParameterName="@pools_questions_question" Precision="0" ProviderType="VarChar" Scale="0" Size="0" SourceColumn="pools_questions_question" SourceColumnNullMapping="False" SourceVersion="Current"> </Parameter> <Parameter AllowDbNull="False" AutogeneratedName="" DataSourceName="" DbType="Int32" Direction="Input" ParameterName="@pools_questions_votes" Precision="0" ProviderType="Int" Scale="0" Size="0" SourceColumn="pools_questions_votes" SourceColumnNullMapping="False" SourceVersion="Current"> </Parameter> </Parameters> </DbCommand> </InsertCommand> <SelectCommand> <DbCommand CommandType="Text" ModifiedByUser="False"> <CommandText>SELECT pools_questions_id, pools_id, pools_questions_question, pools_questions_votes FROM dbo.pools_questions2</CommandText> <Parameters> </Parameters> </DbCommand> </SelectCommand> <UpdateCommand> <DbCommand CommandType="Text" ModifiedByUser="False"> <CommandText>UPDATE [dbo].[pools_questions2] SET [pools_id] = @pools_id, [pools_questions_question] = @pools_questions_question, [pools_questions_votes] = @pools_questions_votes WHERE (([pools_questions_id] = @Original_pools_questions_id) AND ([pools_id] = @Original_pools_id) AND ([pools_questions_question] = @Original_pools_questions_question) AND ([pools_questions_votes] = @Original_pools_questions_votes)); SELECT pools_questions_id, pools_id, pools_questions_question, pools_questions_votes FROM pools_questions2 WHERE (pools_questions_id = @pools_questions_id)</CommandText> <Parameters> <Parameter AllowDbNull="False" AutogeneratedName="" DataSourceName="" DbType="Int32" Direction="Input" ParameterName="@pools_id" Precision="0" ProviderType="Int" Scale="0" Size="0" SourceColumn="pools_id" SourceColumnNullMapping="False" SourceVersion="Current"> </Parameter> <Parameter AllowDbNull="False" AutogeneratedName="" DataSourceName="" DbType="AnsiString" Direction="Input" ParameterName="@pools_questions_question" Precision="0" ProviderType="VarChar" Scale="0" Size="0" SourceColumn="pools_questions_question" SourceColumnNullMapping="False" SourceVersion="Current"> </Parameter> <Parameter AllowDbNull="False" AutogeneratedName="" DataSourceName="" DbType="Int32" Direction="Input" ParameterName="@pools_questions_votes" Precision="0" ProviderType="Int" Scale="0" Size="0" SourceColumn="pools_questions_votes" SourceColumnNullMapping="False" SourceVersion="Current"> </Parameter> <Parameter AllowDbNull="False" AutogeneratedName="" DataSourceName="" DbType="Int32" Direction="Input" ParameterName="@Original_pools_questions_id" Precision="0" ProviderType="Int" Scale="0" Size="0" SourceColumn="pools_questions_id" SourceColumnNullMapping="False" SourceVersion="Original"> </Parameter> <Parameter AllowDbNull="False" AutogeneratedName="" DataSourceName="" DbType="Int32" Direction="Input" ParameterName="@Original_pools_id" Precision="0" ProviderType="Int" Scale="0" Size="0" SourceColumn="pools_id" SourceColumnNullMapping="False" SourceVersion="Original"> </Parameter> <Parameter AllowDbNull="False" AutogeneratedName="" DataSourceName="" DbType="AnsiString" Direction="Input" ParameterName="@Original_pools_questions_question" Precision="0" ProviderType="VarChar" Scale="0" Size="0" SourceColumn="pools_questions_question" SourceColumnNullMapping="False" SourceVersion="Original"> </Parameter> <Parameter AllowDbNull="False" AutogeneratedName="" DataSourceName="" DbType="Int32" Direction="Input" ParameterName="@Original_pools_questions_votes" Precision="0" ProviderType="Int" Scale="0" Size="0" SourceColumn="pools_questions_votes" SourceColumnNullMapping="False" SourceVersion="Original"> </Parameter> <Parameter AllowDbNull="False" AutogeneratedName="pools_questions_id" ColumnName="pools_questions_id" DataSourceName="" DataTypeServer="int" DbType="Int32" Direction="Input" ParameterName="@pools_questions_id" Precision="0" ProviderType="Int" Scale="0" Size="4" SourceColumn="pools_questions_id" SourceColumnNullMapping="False" SourceVersion="Current"> </Parameter> </Parameters> </DbCommand> </UpdateCommand> </DbSource> </MainSource> <Mappings> <Mapping SourceColumn="pools_questions_id" DataSetColumn="pools_questions_id" /> <Mapping SourceColumn="pools_id" DataSetColumn="pools_id" /> <Mapping SourceColumn="pools_questions_question" DataSetColumn="pools_questions_question" /> <Mapping SourceColumn="pools_questions_votes" DataSetColumn="pools_questions_votes" /> </Mappings> <Sources> </Sources> </TableAdapter> "DariuszTarczynski" <dtarczyn***@gmail.com> wrote in message This is TableAdapter, not strong typed dataset...news:1155758848.063050.10240@p79g2000cwp.googlegroups.com... > STDS looks like this (tables: pools2, pools_questions2): > > <TableAdapter BaseClass="System.ComponentModel.Component" -- Miha Markic [MVP C#, INETA Country Leader for Slovenia] RightHand .NET consulting & development www.rthand.com Blog: http://cs.rthand.com/blogs/blog_with_righthand/ Thanks for response Misha. Plesase look. I was create new website for
better look of this problem. There is DataSet1.xsd code, sql scripts for data tables are above: <?xml version="1.0" encoding="utf-8"?> <xs:schema id="DataSet1" targetNamespace="http://tempuri.org/DataSet1.xsd" xmlns:mstns="http://tempuri.org/DataSet1.xsd" xmlns="http://tempuri.org/DataSet1.xsd" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata" xmlns:msprop="urn:schemas-microsoft-com:xml-msprop" attributeFormDefault="qualified" elementFormDefault="qualified"> <xs:annotation> <xs:appinfo source="urn:schemas-microsoft-com:xml-msdatasource"> <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="ConnectionString" ConnectionStringObject="" IsAppSettingsProperty="True" Modifier="Assembly" Name="ConnectionString (Web.config)" ParameterPrefix="@" PropertyReference="AppConfig.System.Configuration.ConfigurationManager.0.ConnectionStrings.ConnectionString.ConnectionString" Provider="System.Data.SqlClient"> </Connection> </Connections> <Tables> <TableAdapter BaseClass="System.ComponentModel.Component" DataAccessorModifier="AutoLayout, AnsiClass, Class, Public" DataAccessorName="pools2TableAdapter" GeneratorDataComponentClassName="pools2TableAdapter" Name="pools2" UserDataComponentName="pools2TableAdapter"> <MainSource> <DbSource ConnectionRef="ConnectionString (Web.config)" DbObjectType="Unknown" FillMethodModifier="Public" FillMethodName="Fill" GenerateMethods="Both" GenerateShortCommands="False" GeneratorGetMethodName="GetData" GeneratorSourceName="Fill" GetMethodModifier="Public" GetMethodName="GetData" QueryType="Rowset" ScalarCallRetval="System.Object, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" UseOptimisticConcurrency="False" UserGetMethodName="GetData" UserSourceName="Fill"> <SelectCommand> <DbCommand CommandType="Text" ModifiedByUser="True"> <CommandText>SELECT pools2.pools_id, pools2.pools_title, pools_questions2.pools_questions_question, pools_questions2.pools_questions_votes FROM pools2 INNER JOIN pools_questions2 ON pools2.pools_id = pools_questions2.pools_id</CommandText> <Parameters> </Parameters> </DbCommand> </SelectCommand> </DbSource> </MainSource> <Mappings> <Mapping SourceColumn="pools_id" DataSetColumn="pools_id" /> <Mapping SourceColumn="pools_title" DataSetColumn="pools_title" /> <Mapping SourceColumn="pools_questions_question" DataSetColumn="pools_questions_question" /> <Mapping SourceColumn="pools_questions_votes" DataSetColumn="pools_questions_votes" /> </Mappings> <Sources> </Sources> </TableAdapter> <TableAdapter BaseClass="System.ComponentModel.Component" DataAccessorModifier="AutoLayout, AnsiClass, Class, Public" DataAccessorName="pools_questions2TableAdapter" GeneratorDataComponentClassName="pools_questions2TableAdapter" Name="pools_questions2" UserDataComponentName="pools_questions2TableAdapter"> <MainSource> <DbSource ConnectionRef="ConnectionString (Web.config)" DbObjectName="Dxcommerce.dbo.pools_questions2" DbObjectType="Table" FillMethodModifier="Public" FillMethodName="Fill" GenerateMethods="Both" GenerateShortCommands="True" GeneratorGetMethodName="GetData" GeneratorSourceName="Fill" GetMethodModifier="Public" GetMethodName="GetData" QueryType="Rowset" ScalarCallRetval="System.Object, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" UseOptimisticConcurrency="True" UserGetMethodName="GetData" UserSourceName="Fill"> <DeleteCommand> <DbCommand CommandType="Text" ModifiedByUser="False"> <CommandText>DELETE FROM [dbo].[pools_questions2] WHERE (([pools_questions_id] = @Original_pools_questions_id) AND ([pools_id] = @Original_pools_id) AND ([pools_questions_question] = @Original_pools_questions_question) AND ([pools_questions_votes] = @Original_pools_questions_votes))</CommandText> <Parameters> <Parameter AllowDbNull="False" AutogeneratedName="" DataSourceName="" DbType="Int32" Direction="Input" ParameterName="@Original_pools_questions_id" Precision="0" ProviderType="Int" Scale="0" Size="0" SourceColumn="pools_questions_id" SourceColumnNullMapping="False" SourceVersion="Original"> </Parameter> <Parameter AllowDbNull="False" AutogeneratedName="" DataSourceName="" DbType="Int32" Direction="Input" ParameterName="@Original_pools_id" Precision="0" ProviderType="Int" Scale="0" Size="0" SourceColumn="pools_id" SourceColumnNullMapping="False" SourceVersion="Original"> </Parameter> <Parameter AllowDbNull="False" AutogeneratedName="" DataSourceName="" DbType="AnsiString" Direction="Input" ParameterName="@Original_pools_questions_question" Precision="0" ProviderType="VarChar" Scale="0" Size="0" SourceColumn="pools_questions_question" SourceColumnNullMapping="False" SourceVersion="Original"> </Parameter> <Parameter AllowDbNull="False" AutogeneratedName="" DataSourceName="" DbType="Int32" Direction="Input" ParameterName="@Original_pools_questions_votes" Precision="0" ProviderType="Int" Scale="0" Size="0" SourceColumn="pools_questions_votes" SourceColumnNullMapping="False" SourceVersion="Original"> </Parameter> </Parameters> </DbCommand> </DeleteCommand> <InsertCommand> <DbCommand CommandType="Text" ModifiedByUser="False"> <CommandText>INSERT INTO [dbo].[pools_questions2] ([pools_id], [pools_questions_question], [pools_questions_votes]) VALUES (@pools_id, @pools_questions_question, @pools_questions_votes); SELECT pools_questions_id, pools_id, pools_questions_question, pools_questions_votes FROM pools_questions2 WHERE (pools_questions_id = SCOPE_IDENTITY())</CommandText> <Parameters> <Parameter AllowDbNull="False" AutogeneratedName="" DataSourceName="" DbType="Int32" Direction="Input" ParameterName="@pools_id" Precision="0" ProviderType="Int" Scale="0" Size="0" SourceColumn="pools_id" SourceColumnNullMapping="False" SourceVersion="Current"> </Parameter> <Parameter AllowDbNull="False" AutogeneratedName="" DataSourceName="" DbType="AnsiString" Direction="Input" ParameterName="@pools_questions_question" Precision="0" ProviderType="VarChar" Scale="0" Size="0" SourceColumn="pools_questions_question" SourceColumnNullMapping="False" SourceVersion="Current"> </Parameter> <Parameter AllowDbNull="False" AutogeneratedName="" DataSourceName="" DbType="Int32" Direction="Input" ParameterName="@pools_questions_votes" Precision="0" ProviderType="Int" Scale="0" Size="0" SourceColumn="pools_questions_votes" SourceColumnNullMapping="False" SourceVersion="Current"> </Parameter> </Parameters> </DbCommand> </InsertCommand> <SelectCommand> <DbCommand CommandType="Text" ModifiedByUser="False"> <CommandText>SELECT pools_questions_id, pools_id, pools_questions_question, pools_questions_votes FROM dbo.pools_questions2</CommandText> <Parameters> </Parameters> </DbCommand> </SelectCommand> <UpdateCommand> <DbCommand CommandType="Text" ModifiedByUser="False"> <CommandText>UPDATE [dbo].[pools_questions2] SET [pools_id] = @pools_id, [pools_questions_question] = @pools_questions_question, [pools_questions_votes] = @pools_questions_votes WHERE (([pools_questions_id] = @Original_pools_questions_id) AND ([pools_id] = @Original_pools_id) AND ([pools_questions_question] = @Original_pools_questions_question) AND ([pools_questions_votes] = @Original_pools_questions_votes)); SELECT pools_questions_id, pools_id, pools_questions_question, pools_questions_votes FROM pools_questions2 WHERE (pools_questions_id = @pools_questions_id)</CommandText> <Parameters> <Parameter AllowDbNull="False" AutogeneratedName="" DataSourceName="" DbType="Int32" Direction="Input" ParameterName="@pools_id" Precision="0" ProviderType="Int" Scale="0" Size="0" SourceColumn="pools_id" SourceColumnNullMapping="False" SourceVersion="Current"> </Parameter> <Parameter AllowDbNull="False" AutogeneratedName="" DataSourceName="" DbType="AnsiString" Direction="Input" ParameterName="@pools_questions_question" Precision="0" ProviderType="VarChar" Scale="0" Size="0" SourceColumn="pools_questions_question" SourceColumnNullMapping="False" SourceVersion="Current"> </Parameter> <Parameter AllowDbNull="False" AutogeneratedName="" DataSourceName="" DbType="Int32" Direction="Input" ParameterName="@pools_questions_votes" Precision="0" ProviderType="Int" Scale="0" Size="0" SourceColumn="pools_questions_votes" SourceColumnNullMapping="False" SourceVersion="Current"> </Parameter> <Parameter AllowDbNull="False" AutogeneratedName="" DataSourceName="" DbType="Int32" Direction="Input" ParameterName="@Original_pools_questions_id" Precision="0" ProviderType="Int" Scale="0" Size="0" SourceColumn="pools_questions_id" SourceColumnNullMapping="False" SourceVersion="Original"> </Parameter> <Parameter AllowDbNull="False" AutogeneratedName="" DataSourceName="" DbType="Int32" Direction="Input" ParameterName="@Original_pools_id" Precision="0" ProviderType="Int" Scale="0" Size="0" SourceColumn="pools_id" SourceColumnNullMapping="False" SourceVersion="Original"> </Parameter> <Parameter AllowDbNull="False" AutogeneratedName="" DataSourceName="" DbType="AnsiString" Direction="Input" ParameterName="@Original_pools_questions_question" Precision="0" ProviderType="VarChar" Scale="0" Size="0" SourceColumn="pools_questions_question" SourceColumnNullMapping="False" SourceVersion="Original"> </Parameter> <Parameter AllowDbNull="False" AutogeneratedName="" DataSourceName="" DbType="Int32" Direction="Input" ParameterName="@Original_pools_questions_votes" Precision="0" ProviderType="Int" Scale="0" Size="0" SourceColumn="pools_questions_votes" SourceColumnNullMapping="False" SourceVersion="Original"> </Parameter> <Parameter AllowDbNull="False" AutogeneratedName="pools_questions_id" ColumnName="pools_questions_id" DataSourceName="" DataTypeServer="int" DbType="Int32" Direction="Input" ParameterName="@pools_questions_id" Precision="0" ProviderType="Int" Scale="0" Size="4" SourceColumn="pools_questions_id" SourceColumnNullMapping="False" SourceVersion="Current"> </Parameter> </Parameters> </DbCommand> </UpdateCommand> </DbSource> </MainSource> <Mappings> <Mapping SourceColumn="pools_questions_id" DataSetColumn="pools_questions_id" /> <Mapping SourceColumn="pools_id" DataSetColumn="pools_id" /> <Mapping SourceColumn="pools_questions_question" DataSetColumn="pools_questions_question" /> <Mapping SourceColumn="pools_questions_votes" DataSetColumn="pools_questions_votes" /> </Mappings> <Sources> </Sources> </TableAdapter> </Tables> <Sources> </Sources> </DataSource> </xs:appinfo> </xs:annotation> <xs:element name="DataSet1" msdata:IsDataSet="true" msdata:UseCurrentLocale="true" msprop:Generator_UserDSName="DataSet1" msprop:Generator_DataSetName="DataSet1"> <xs:complexType> <xs:choice minOccurs="0" maxOccurs="unbounded"> <xs:element name="pools2" msprop:Generator_UserTableName="pools2" msprop:Generator_RowDeletedName="pools2RowDeleted" msprop:Generator_TableClassName="pools2DataTable" msprop:Generator_RowChangedName="pools2RowChanged" msprop:Generator_RowClassName="pools2Row" msprop:Generator_RowChangingName="pools2RowChanging" msprop:Generator_RowEvArgName="pools2RowChangeEvent" msprop:Generator_RowEvHandlerName="pools2RowChangeEventHandler" msprop:Generator_TablePropName="pools2" msprop:Generator_TableVarName="tablepools2" msprop:Generator_RowDeletingName="pools2RowDeleting"> <xs:complexType> <xs:sequence> <xs:element name="pools_id" msdata:ReadOnly="true" msdata:AutoIncrement="true" msprop:Generator_UserColumnName="pools_id" msprop:Generator_ColumnPropNameInRow="pools_id" msprop:Generator_ColumnVarNameInTable="columnpools_id" msprop:Generator_ColumnPropNameInTable="pools_idColumn" type="xs:int" /> <xs:element name="pools_title" msprop:Generator_UserColumnName="pools_title" msprop:Generator_ColumnPropNameInRow="pools_title" msprop:Generator_ColumnVarNameInTable="columnpools_title" msprop:Generator_ColumnPropNameInTable="pools_titleColumn"> <xs:simpleType> <xs:restriction base="xs:string"> <xs:maxLength value="50" /> </xs:restriction> </xs:simpleType> </xs:element> <xs:element name="pools_questions_question" msprop:Generator_UserColumnName="pools_questions_question" msprop:Generator_ColumnPropNameInRow="pools_questions_question" msprop:Generator_ColumnVarNameInTable="columnpools_questions_question" msprop:Generator_ColumnPropNameInTable="pools_questions_questionColumn"> <xs:simpleType> <xs:restriction base="xs:string"> <xs:maxLength value="50" /> </xs:restriction> </xs:simpleType> </xs:element> <xs:element name="pools_questions_votes" msprop:Generator_UserColumnName="pools_questions_votes" msprop:Generator_ColumnPropNameInRow="pools_questions_votes" msprop:Generator_ColumnVarNameInTable="columnpools_questions_votes" msprop:Generator_ColumnPropNameInTable="pools_questions_votesColumn" type="xs:int" /> </xs:sequence> </xs:complexType> </xs:element> <xs:element name="pools_questions2" msprop:Generator_UserTableName="pools_questions2" msprop:Generator_RowDeletedName="pools_questions2RowDeleted" msprop:Generator_TableClassName="pools_questions2DataTable" msprop:Generator_RowChangedName="pools_questions2RowChanged" msprop:Generator_RowClassName="pools_questions2Row" msprop:Generator_RowChangingName="pools_questions2RowChanging" msprop:Generator_RowEvArgName="pools_questions2RowChangeEvent" msprop:Generator_RowEvHandlerName="pools_questions2RowChangeEventHandler" msprop:Generator_TablePropName="pools_questions2" msprop:Generator_TableVarName="tablepools_questions2" msprop:Generator_RowDeletingName="pools_questions2RowDeleting"> <xs:complexType> <xs:sequence> <xs:element name="pools_questions_id" msdata:ReadOnly="true" msdata:AutoIncrement="true" msprop:Generator_UserColumnName="pools_questions_id" msprop:Generator_ColumnPropNameInRow="pools_questions_id" msprop:Generator_ColumnVarNameInTable="columnpools_questions_id" msprop:Generator_ColumnPropNameInTable="pools_questions_idColumn" type="xs:int" /> <xs:element name="pools_id" msprop:Generator_UserColumnName="pools_id" msprop:Generator_ColumnPropNameInRow="pools_id" msprop:Generator_ColumnVarNameInTable="columnpools_id" msprop:Generator_ColumnPropNameInTable="pools_idColumn" type="xs:int" /> <xs:element name="pools_questions_question" msprop:Generator_UserColumnName="pools_questions_question" msprop:Generator_ColumnPropNameInRow="pools_questions_question" msprop:Generator_ColumnVarNameInTable="columnpools_questions_question" msprop:Generator_ColumnPropNameInTable="pools_questions_questionColumn"> <xs:simpleType> <xs:restriction base="xs:string"> <xs:maxLength value="50" /> </xs:restriction> </xs:simpleType> </xs:element> <xs:element name="pools_questions_votes" msprop:Generator_UserColumnName="pools_questions_votes" msprop:Generator_ColumnPropNameInRow="pools_questions_votes" msprop:Generator_ColumnVarNameInTable="columnpools_questions_votes" msprop:Generator_ColumnPropNameInTable="pools_questions_votesColumn" type="xs:int" /> </xs:sequence> </xs:complexType> </xs:element> </xs:choice> </xs:complexType> <xs:unique name="Constraint1" msdata:PrimaryKey="true"> <xs:selector xpath=".//mstns:pools2" /> <xs:field xpath="mstns:pools_id" /> </xs:unique> <xs:unique name="pools_questions2_Constraint1" msdata:ConstraintName="Constraint1" msdata:PrimaryKey="true"> <xs:selector xpath=".//mstns:pools_questions2" /> <xs:field xpath="mstns:pools_questions_id" /> </xs:unique> </xs:element> <xs:annotation> <xs:appinfo> <msdata:Relationship name="FK_pools_questions2_pools2" msdata:parent="pools2" msdata:child="pools_questions2" msdata:parentkey="pools_id" msdata:childkey="pools_id" msprop:Generator_UserRelationName="FK_pools_questions2_pools2" msprop:Generator_RelationVarName="relationFK_pools_questions2_pools2" msprop:Generator_UserChildTable="pools_questions2" msprop:Generator_UserParentTable="pools2" msprop:Generator_ParentPropName="pools2Row" msprop:Generator_ChildPropName="Getpools_questions2Rows" /> </xs:appinfo> </xs:annotation> </xs:schema> |
|||||||||||||||||||||||