473,606 Members | 2,080 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

How to fill a Dataset with case sensitive primary keys using a OleDbDataAdapte r

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 OleDbDataAdapte r 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 5341
Hi Monty,

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

The property inherits its value from DataSet.CaseSen sitive, 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*******@hotm ail.comwrote in message
news:11******** **************@ m73g2000cwd.goo glegroups.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 OleDbDataAdapte r 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 EnforceConstrai nts 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.CaseS ensitive property on MSDN:
http://msdn2.microsoft.com/en-us/lib...sensitive.aspx

The property inherits its value from DataSet.CaseSen sitive, 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*******@hotm ail.comwrote in message
news:11******** **************@ m73g2000cwd.goo glegroups.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 OleDbDataAdapte r 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.CaseS ensitive 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*******@hotm ail.comwrote in message
news:11******** **************@ m73g2000cwd.goo glegroups.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 EnforceConstrai nts 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.Case Sensitive property on MSDN:
http://msdn2.microsoft.com/en-us/lib...sensitive.aspx

The property inherits its value from DataSet.CaseSen sitive, 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*******@hotm ail.comwrote in message
news:11******* *************** @m73g2000cwd.go oglegroups.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 OleDbDataAdapte r 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******** ******@TK2MSFTN GP03.phx.gbl...
Hi Monty,

I assume you're setting the DataTable.CaseS ensitive 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*******@hotm ail.comwrote in message
news:11******** **************@ m73g2000cwd.goo glegroups.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
relationship s, 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
CaseSensitiv e settings between its related tables."

I know that if I set the EnforceConstrai nts 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.Cas eSensitive property on MSDN:
http://msdn2.microsoft.com/en-us/lib...sensitive.aspx

The property inherits its value from DataSet.CaseSen sitive, 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*******@hotm ail.comwrote in message
news:11****** *************** *@m73g2000cwd.g ooglegroups.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 OleDbDataAdapte r 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******** ********@TK2MSF TNGP02.phx.gbl. ..
>- Switch CaseSensitive to true - :)

--
Dave Sexton

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

I assume you're setting the DataTable.CaseS ensitive 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*******@hotm ail.comwrote in message
news:11******* *************** @m73g2000cwd.go oglegroups.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
CaseSensiti ve settings between its related tables."

I know that if I set the EnforceConstrai nts 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.Ca seSensitive property on MSDN:
http://msdn2.microsoft.com/en-us/lib...sensitive.aspx

The property inherits its value from DataSet.CaseSen sitive, 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*******@hotm ail.comwrote in message
news:11***** *************** **@m73g2000cwd. googlegroups.co m...
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 OleDbDataAdapte r 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
1690
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 this connection string "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" + filename and everything is working fine with that. My table in the database is simple. 10 columns of text or numbers. No joining or anything else. It has a autonumber as...
0
1877
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
5806
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 which indexes computer magazine articles for personal reference. I am developing a Visual Basic.NET program whose sole purpose is to enter new records into the database. No updates to existing entries, no deletions, and no display
3
1545
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 strConn As String
10
6522
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 have one querie that grabs all of the id's I need for the other 4 queries, but I am not sure how to get them into a DataTable or DataSet, or if that is the best way to do this. Seperately the queries all work with no problems.
4
3081
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() As DataSet
4
3199
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 with a number. When I run the following code Imports System.Data Imports System.Data.OleDb Sub Session_Start......
1
1730
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 is that for some reason, the fill method seems to miss out on exactly one row from the database even though that row still conforms to the query criteria. Regardless of how many rows are selected as a result of the query, only the last row...
2
4197
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 causing the error... Thanks!!! Server Error in '/' Application. ---------------------------------------------------------------------------­----- Multiple-step OLE DB operation generated errors. Check each OLE DB
0
8009
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
7938
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8427
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
8298
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
5892
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5452
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
3914
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
3962
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2441
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system

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.