471,594 Members | 2,488 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 471,594 software developers and data experts.

How to fill a Dataset with case sensitive primary keys using a OleDbDataAdapter

Hello;

I was wondering if anyone can assist me with this problem. Here are
the tools I am using:

Language: C#
Database: MS SQL Server 2000
Application: Visual Studio 2005

1. I have a table whose primary key is a varchar data type.
-- Since this key is case-sensitive, these two IDs are unique:
asp_temp1
ASP_Temp1

2. I created a OleDbDataAdapter and generated a dataSet for this table
-- I receive an error stating that the constraints are not unique. The
errors pointed to the two rows above since it does not see a difference
between "asp_temp1" and "ASP_Temp1".
Does anyone know how to setup a DataAdapter to read case sensitive
data?

Thank you

Monty

Oct 25 '06 #1
5 5169
Hi Monty,

DataTable.CaseSensitive property on MSDN:
http://msdn2.microsoft.com/en-us/lib...sensitive.aspx

The property inherits its value from DataSet.CaseSensitive, which is false by
default. When created without a DataSet, the property is false by default as
well.

You should set it to true before filling the table.

--
Dave Sexton

"Monty M." <dj*******@hotmail.comwrote in message
news:11**********************@m73g2000cwd.googlegr oups.com...
Hello;

I was wondering if anyone can assist me with this problem. Here are
the tools I am using:

Language: C#
Database: MS SQL Server 2000
Application: Visual Studio 2005

1. I have a table whose primary key is a varchar data type.
-- Since this key is case-sensitive, these two IDs are unique:
asp_temp1
ASP_Temp1

2. I created a OleDbDataAdapter and generated a dataSet for this table
-- I receive an error stating that the constraints are not unique. The
errors pointed to the two rows above since it does not see a difference
between "asp_temp1" and "ASP_Temp1".
Does anyone know how to setup a DataAdapter to read case sensitive
data?

Thank you

Monty

Oct 25 '06 #2
Thank you for the help.

Now I have a different problem. I should have given more background
info to my problem. Here are the details.

-- I am using a strongly typed dataset. Therefore it contains
relationships, primary keys, etc.
-- I want to fill this dataset with data by looping through all of its
tables, creating a data adapter and filling the table with data from a
SQL Server database.
-- When I attempt to fill the data table, I get the following error:

"Cannot change CaseSensitive or Locale property. This change would lead
to at least one DataRelation or Constraint to have different Locale or
CaseSensitive settings between its related tables."

I know that if I set the EnforceConstraints property to false, I will
be able to get around this error. However I do not want to disable
constraints. Does anyone know how to disable the CaseSensitive
property for a relationship in a strongly typed dataset?

Thank you

Monty
Dave Sexton wrote:
Hi Monty,

DataTable.CaseSensitive property on MSDN:
http://msdn2.microsoft.com/en-us/lib...sensitive.aspx

The property inherits its value from DataSet.CaseSensitive, which is false by
default. When created without a DataSet, the property is false by default as
well.

You should set it to true before filling the table.

--
Dave Sexton

"Monty M." <dj*******@hotmail.comwrote in message
news:11**********************@m73g2000cwd.googlegr oups.com...
Hello;

I was wondering if anyone can assist me with this problem. Here are
the tools I am using:

Language: C#
Database: MS SQL Server 2000
Application: Visual Studio 2005

1. I have a table whose primary key is a varchar data type.
-- Since this key is case-sensitive, these two IDs are unique:
asp_temp1
ASP_Temp1

2. I created a OleDbDataAdapter and generated a dataSet for this table
-- I receive an error stating that the constraints are not unique. The
errors pointed to the two rows above since it does not see a difference
between "asp_temp1" and "ASP_Temp1".
Does anyone know how to setup a DataAdapter to read case sensitive
data?

Thank you

Monty
Oct 30 '06 #3
Hi Monty,

I assume you're setting the DataTable.CaseSensitive property in code?

Open your DataSet in the XSD designer in Visual Studio, as usual. Open the
Properites window and select the DataSet from the component drop-down (or just
focus the empty area with the mouse, but not an object such as a table).
Switch CaseSensitive to false.

HTH

--
Dave Sexton

"Monty M." <dj*******@hotmail.comwrote in message
news:11**********************@m73g2000cwd.googlegr oups.com...
Thank you for the help.

Now I have a different problem. I should have given more background
info to my problem. Here are the details.

-- I am using a strongly typed dataset. Therefore it contains
relationships, primary keys, etc.
-- I want to fill this dataset with data by looping through all of its
tables, creating a data adapter and filling the table with data from a
SQL Server database.
-- When I attempt to fill the data table, I get the following error:

"Cannot change CaseSensitive or Locale property. This change would lead
to at least one DataRelation or Constraint to have different Locale or
CaseSensitive settings between its related tables."

I know that if I set the EnforceConstraints property to false, I will
be able to get around this error. However I do not want to disable
constraints. Does anyone know how to disable the CaseSensitive
property for a relationship in a strongly typed dataset?

Thank you

Monty
Dave Sexton wrote:
>Hi Monty,

DataTable.CaseSensitive property on MSDN:
http://msdn2.microsoft.com/en-us/lib...sensitive.aspx

The property inherits its value from DataSet.CaseSensitive, which is false
by
default. When created without a DataSet, the property is false by default
as
well.

You should set it to true before filling the table.

--
Dave Sexton

"Monty M." <dj*******@hotmail.comwrote in message
news:11**********************@m73g2000cwd.googleg roups.com...
Hello;

I was wondering if anyone can assist me with this problem. Here are
the tools I am using:

Language: C#
Database: MS SQL Server 2000
Application: Visual Studio 2005

1. I have a table whose primary key is a varchar data type.
-- Since this key is case-sensitive, these two IDs are unique:
asp_temp1
ASP_Temp1

2. I created a OleDbDataAdapter and generated a dataSet for this table
-- I receive an error stating that the constraints are not unique. The
errors pointed to the two rows above since it does not see a difference
between "asp_temp1" and "ASP_Temp1".
Does anyone know how to setup a DataAdapter to read case sensitive
data?

Thank you

Monty

Oct 30 '06 #4
- Switch CaseSensitive to true - :)

--
Dave Sexton

"Dave Sexton" <dave@jwa[remove.this]online.comwrote in message
news:uk**************@TK2MSFTNGP03.phx.gbl...
Hi Monty,

I assume you're setting the DataTable.CaseSensitive property in code?

Open your DataSet in the XSD designer in Visual Studio, as usual. Open the
Properites window and select the DataSet from the component drop-down (or
just focus the empty area with the mouse, but not an object such as a
table). Switch CaseSensitive to false.

HTH

--
Dave Sexton

"Monty M." <dj*******@hotmail.comwrote in message
news:11**********************@m73g2000cwd.googlegr oups.com...
>Thank you for the help.

Now I have a different problem. I should have given more background
info to my problem. Here are the details.

-- I am using a strongly typed dataset. Therefore it contains
relationships, primary keys, etc.
-- I want to fill this dataset with data by looping through all of its
tables, creating a data adapter and filling the table with data from a
SQL Server database.
-- When I attempt to fill the data table, I get the following error:

"Cannot change CaseSensitive or Locale property. This change would lead
to at least one DataRelation or Constraint to have different Locale or
CaseSensitive settings between its related tables."

I know that if I set the EnforceConstraints property to false, I will
be able to get around this error. However I do not want to disable
constraints. Does anyone know how to disable the CaseSensitive
property for a relationship in a strongly typed dataset?

Thank you

Monty
Dave Sexton wrote:
>>Hi Monty,

DataTable.CaseSensitive property on MSDN:
http://msdn2.microsoft.com/en-us/lib...sensitive.aspx

The property inherits its value from DataSet.CaseSensitive, which is false
by
default. When created without a DataSet, the property is false by default
as
well.

You should set it to true before filling the table.

--
Dave Sexton

"Monty M." <dj*******@hotmail.comwrote in message
news:11**********************@m73g2000cwd.google groups.com...
Hello;

I was wondering if anyone can assist me with this problem. Here are
the tools I am using:

Language: C#
Database: MS SQL Server 2000
Application: Visual Studio 2005

1. I have a table whose primary key is a varchar data type.
-- Since this key is case-sensitive, these two IDs are unique:
asp_temp1
ASP_Temp1

2. I created a OleDbDataAdapter and generated a dataSet for this table
-- I receive an error stating that the constraints are not unique. The
errors pointed to the two rows above since it does not see a difference
between "asp_temp1" and "ASP_Temp1".
Does anyone know how to setup a DataAdapter to read case sensitive
data?

Thank you

Monty


Oct 30 '06 #5
Hi Monty,

I just realized that it might work if you set CaseSensitive to true on all of
the DataTables (which you can do in the XSD designer as well) that reference
the table with the case-sensitive primary key, without having to enable the
property on the DataSet. I've never tried this myself though. If it doesn't
work you might want to create a special DataSet for that table and its related
tables so that you can preserve the case-sensitivity without having a negative
affect on the remaining tables in the DataSet that may require
case-insensitivity.

--
Dave Sexton

"Dave Sexton" <dave@jwa[remove.this]online.comwrote in message
news:%2****************@TK2MSFTNGP02.phx.gbl...
>- Switch CaseSensitive to true - :)

--
Dave Sexton

"Dave Sexton" <dave@jwa[remove.this]online.comwrote in message
news:uk**************@TK2MSFTNGP03.phx.gbl...
>Hi Monty,

I assume you're setting the DataTable.CaseSensitive property in code?

Open your DataSet in the XSD designer in Visual Studio, as usual. Open the
Properites window and select the DataSet from the component drop-down (or
just focus the empty area with the mouse, but not an object such as a
table). Switch CaseSensitive to false.

HTH

--
Dave Sexton

"Monty M." <dj*******@hotmail.comwrote in message
news:11**********************@m73g2000cwd.googleg roups.com...
>>Thank you for the help.

Now I have a different problem. I should have given more background
info to my problem. Here are the details.

-- I am using a strongly typed dataset. Therefore it contains
relationships, primary keys, etc.
-- I want to fill this dataset with data by looping through all of its
tables, creating a data adapter and filling the table with data from a
SQL Server database.
-- When I attempt to fill the data table, I get the following error:

"Cannot change CaseSensitive or Locale property. This change would lead
to at least one DataRelation or Constraint to have different Locale or
CaseSensitive settings between its related tables."

I know that if I set the EnforceConstraints property to false, I will
be able to get around this error. However I do not want to disable
constraints. Does anyone know how to disable the CaseSensitive
property for a relationship in a strongly typed dataset?

Thank you

Monty
Dave Sexton wrote:
Hi Monty,

DataTable.CaseSensitive property on MSDN:
http://msdn2.microsoft.com/en-us/lib...sensitive.aspx

The property inherits its value from DataSet.CaseSensitive, which is
false by
default. When created without a DataSet, the property is false by
default as
well.

You should set it to true before filling the table.

--
Dave Sexton

"Monty M." <dj*******@hotmail.comwrote in message
news:11**********************@m73g2000cwd.googl egroups.com...
Hello;

I was wondering if anyone can assist me with this problem. Here are
the tools I am using:

Language: C#
Database: MS SQL Server 2000
Application: Visual Studio 2005

1. I have a table whose primary key is a varchar data type.
-- Since this key is case-sensitive, these two IDs are unique:
asp_temp1
ASP_Temp1

2. I created a OleDbDataAdapter and generated a dataSet for this table
-- I receive an error stating that the constraints are not unique. The
errors pointed to the two rows above since it does not see a difference
between "asp_temp1" and "ASP_Temp1".
Does anyone know how to setup a DataAdapter to read case sensitive
data?

Thank you

Monty




Oct 30 '06 #6

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

3 posts views Thread by Marc Llenas | last post: by
10 posts views Thread by dauphian | last post: by
4 posts views Thread by Andre | last post: by
2 posts views Thread by slinky | last post: by
reply views Thread by XIAOLAOHU | last post: by
reply views Thread by leo001 | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.