PRIMARY KEY required for WRITING data to SQL DATABASE using DA

dotnet framework

    Next

  • 1. Reporting
    Hello, I guess this group is the closest to the subject. I have a report and a form with the reportviewer on it + a dataset in a classlibrary. I do that because I want to be able to update that assembly whenever I please. Now when I call upon the form in the classlibrary from the main application it will throw an exception telling me 'the report definition for report foo has not been specified'. What does that mean? Do I need to share something in the main app? (I have the datasource connection in there) regards, yves
  • 2. main objects of ADO
    Does anyone know what are main objects of ADO? thx
  • 3. datagridcolumnstyle mappingname
    Hi there, I have a 'User' class that has a property 'UserProfile' this property is an instance of a class 'UserProfile' wich in turn has a 'Name' property. In a DatagridColumnStyle i'd like to display UserProfile.Name : DataGridTableStyle ts = new DataGridTableStyle(); ts.MappingName = "User[]"; DataGridColumnStyle userTypeCol = new DataGridTextBoxColumn(); userTypeCol.MappingName = "UserProfile.Name"; userTypeCol.HeaderText = "Tipo de usuario"; userTypeCol.Width = 150; ts.GridColumnStyles.Add(userTypeCol); this show nothing. However, setting the mapping name to "UserProfile" shows up the 'UserProfile' class full name. Is there any way to get UserProfile.Name to show up ?
  • 4. Dataset Merge Problem
    Hello, I have an issue with respect to the DataSet Merge function. I have a function defined that takes a dataset as a parameter and is called in two different scenarios, locally and remotely. Inside this function I do the following: DataSet dsModified = ds.GetChanges(DataRowState.Modified); if (dsModified != null) { // ... Update the database ds.Merge(dsModified) } If I call this function locally, it works perfectly. However, if this function is called remotely for the exact same scenario, the function throws an exception when Merge is called. The only difference in the two calls is that locally, the dataset is passed by reference (because it's an object), whereas remotely, the same dataset is serialized before it is passed into the function. Are there any known issues with respect to serialization of a dataset? That is the only thing that I can think of that is causing this ConstraitException to be thrown. Thanks, Hammad

RE: PRIMARY KEY required for WRITING data to SQL DATABASE using DA

Postby cG11ZA » Thu, 30 Dec 2004 05:59:02 GMT

Hi Gregory,

Even when I added the identity to an int column in the database, I cant use 
it for editing tha datagrid & writing the values back to the SQL database.

I am too confused at the moment.please help








Re: PRIMARY KEY required for WRITING data to SQL DATABASE using DA

Postby W.G. Ryan eMVP » Thu, 30 Dec 2004 06:59:47 GMT

After you added the identity column - did you make it the key?  I'm guessing
the problem is that your table isn't keyed, in which case neither the
CommandBuilder or the configuration wizard is of any use for Updates.

-- 
W.G. Ryan, MVP

www.tibasolutions.com | www.devbuzz.com | www.knowdotnet.com




use

multiple
IDENTITY
although

posted
the
table
have one.
of MS
not ,



Re: PRIMARY KEY required for WRITING data to SQL DATABASE using DA

Postby cG11ZA » Thu, 30 Dec 2004 07:09:01 GMT

Yes Ryan , the problem is that my table isnt Keyed. Thats bcoz when i try to 
create a field in the table as the primary key , it is not made bcoz i get 
the alert message that aTEXT DATA TYPE cant be made a primary key.  I have 
that field as TEXT DATA TYPE coz that filed should have voth numeric digits & 
characters. Is there any other data type which supports both numeric & 
character values?










Re: PRIMARY KEY required for WRITING data to SQL DATABASE using DA

Postby W.G. Ryan eMVP » Thu, 30 Dec 2004 12:51:23 GMT

f you use Varchar (I'm assuming you're using Sql Server?) that should work.
If not, create a composite key - one of Varchar and one of int - that'll do
it for you.

--
W.G. Ryan MVP (Windows Embedded)

TiBA Solutions
www.tibasolutions.com | www.devbuzz.com | www.knowdotnet.com
"pmud" < XXXX@XXXXX.COM > wrote in message
news: XXXX@XXXXX.COM ...
to
digits &
guessing
cant
database.
had
in
the
Number
If



Similar Threads:

1.PRIMARY KEY required for WRITING data to SQL DATABASE using DATA G

I am posting this question here too coz I was not sure whether I had posted 
this earlier in the right group.

I need an editable datagrid. But for editing a datagrid as shown in the 
walkthrough: Using a DataGrid Web Control to Read and Write Data,  the table 
in the SQL database should have a primary key. But my table doesnt have one. 
So what is the best way I can create primary key in SQL database? 

Is UNIQUE IDENTIFIER a good option? Is it something like Auro Number of MS 
Access which is automatically filled by the database for each row? If not , 
how can i make a primary key for that SQL table?

-- 
pmud

2.PRIMARY KEY required for WRITING to SQL DATABASE using DATA GRID?

I need an editable datagrid. But for editing a datagrid as shown in the 
walkthrough: Using a DataGrid Web Control to Read and Write Data,  the table 
in the SQL database should have a primary key. But my table doesnt have one. 
So what is the best way I can create primary key in SQL database? 

Is UNIQUE IDENTIFIER a good option? Is it something like Auro Number of MS 
Access which is automatically filled by the database for each row? If not , 
how can i make a primary key for that SQL table?
-- 
pmud

3.Primary key and identity fields information got lost by "Import Da

Hi all!

I want to import data from Sql Server 2000 into Sql Server 2005.
When i select "Import Data" in 2005 and import tables directly from the 2000 
Data Source, the primary keys and the identity fields information is lost in 
2005.

Who knows why?

Best regards
Ulrich Schumacher


4.delete one secondary data file and increase size of primary da

5.Cannot add primary key constraint since primary key is already set for the table

Hi,

I am getting the following error when I run my Visual Basic
application:

"Cannot add primary key constraint since primary key is
already set for the table"

I am using datasets with primary keys which are filled from
an SQL Server database. These datasets were automatically
generated in Visual Studio.

Now, the application worked fine for a while until I added
buttons onto a form. I did not touch any datasets or the
data in the database. I did not touch the file in which the
error is thrown.

Does anybody know what causes this error? I have searched
extensively on Microsoft and Google, and the only solution
I can find is to remove the primary key constraints in the
dataset. I would be grateful if there was another solution
to this rather frustrating problem.

Thankyou

Stephen.

6. Primary Keys : Distributed Database : Not using GUID or Indentity columns

7. Primary Key fields require index?

8. How to tell if primary key is used as foreign key before deleting



Return to dotnet framework

 

Who is online

Users browsing this forum: No registered users and 96 guest