473,386 Members | 1,748 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 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 5312
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Bryan Masephol | last post by:
Hi All I have a OleDbConnection as the "connection" below. I'm retriving a dataset from an access 2002 db and displaying it in a DataGrid. I'm making the connection to my access db file with...
0
by: Serge Klokov | last post by:
Hi! 1. I have a table (in Oracle 8) with string PK. it is case-sensitive, so possible rows like:
0
by: M. David Johnson | last post by:
I cannot get my OleDbDataAdapter to update my database table from my local dataset table. The Knowledge Base doesn't seem to help - see item 10 below. I have a Microsoft Access 2000 database...
3
by: Marc Llenas | last post by:
Hello all, I'm new to ASP.NET and I have a question regarding the fill method of a dataset. Here is my code 1 Dim objConn As OleDbConnection 2 Dim objAdapt As OleDbDataAdapter 3 Dim...
10
by: dauphian | last post by:
Hello, I am new to .net and am trying to build a report application that queries 4 different tables based on a id, and I need to return them in the same table for easy viewing. Basically, I...
4
by: Cindy H | last post by:
Hi I'm using an access database and vb.net I have been using the following type of function to get data from one table. This is working great - Public Shared Function GetAllLotsForSale()...
4
by: Andre | last post by:
I am ruinning this in the global.asa VIA Visual Studio VB .NET (framework 1.1) I have a access database with a table called tblCounters with a feild called Counters with on row of data in it...
1
by: Deecrypt | last post by:
My issue is that I am communicating data between a website and a webservice using datasets. The datasets created by filling the datasets with results of queries using the DataAdapter. My problem...
2
by: slinky | last post by:
I'm getting a error when I open my . aspx in my browser... line 34: da.Fill(ds, "Assets") Here's the error and my entire code for this .aspx.vb is below that ... I need some clues as to what is...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...

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.