473,326 Members | 2,124 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,326 software developers and data experts.

the primarykey property on the datatable object

Hi
Does primarykey property on the datatable object always need to be set in your code (for use with datarow.find) or should this be set automatically from your database tables primary key coz this dosnt seem to happening for me??

Ta
Jul 21 '05 #1
2 1433
Hi,

The even if your database has a primary key you must add it to your
datatable with code.

Ken
------------
"alan" <an*******@discussions.microsoft.com> wrote in message
news:31**********************************@microsof t.com...
Hi
Does primarykey property on the datatable object always need to be set in your code (for use with datarow.find) or should this be set automatically
from your database tables primary key coz this dosnt seem to happening for
me??
Ta

Jul 21 '05 #2
Cor
Hi Alan,

In addition to Ken, one of the kind of code you could use to set before your
daadapter.fill is

Mydataadapter.MissingSchemaAction = MissingSchemaAction.AddWithKey

I hope this helps

Cor
Does primarykey property on the datatable object always need to be set in

your code (for use with datarow.find) or should this be set automatically
from your database tables primary key coz this dosnt seem to happening for
me??
Jul 21 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: João Santa Bárbara | last post by:
hi all i have create my own usercontrol and i create this property <BindableAttribute(True), _ DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden), _ DefaultValue(Nothing,...
7
by: _e_ | last post by:
I'm trying to set custom widths and headings for DataGrid columns, but they keep displaying as defaults. I did configure the params via the TableStyles collection -> ColumnStyles collection. ...
2
by: Boniek | last post by:
Hi, How I can create property to binding with other objects. I want to create a data object which work as a DataTable. DataTable contains columns and dataTable is used to binding with a textBox...
0
by: MuZZy | last post by:
Hi, I wonder if anybody could help me here: i'm trying to set a primary key on a table DataTable dt = new DataTable; FillTable(dt); dt.PrimaryKey = myDataColumn; , and in case if the...
7
by: Raymond Lewallen | last post by:
Which would be the proper way or the reason for using any of the following or combinations of the following? These are the 3 ways I've figured I can do what I want to do, I just don't know which...
1
by: nate axtell | last post by:
I have a custom class with a Private DataTable member and a Public Property that returns this DataTable in its Get call. Is the DataTable that is returned from the Property's Get a reference to...
2
by: alan | last post by:
Hi Does primarykey property on the datatable object always need to be set in your code (for use with datarow.find) or should this be set automatically from your database tables primary key coz this...
4
by: Lars E | last post by:
Hi all How can i set primarykey to a datatable. This datatable is in a dataset i get from a backend system. My datatable contains several fields, and i want to make the fields "c-custno1",...
0
by: Indra Bisen | last post by:
Hi, I want to determine column names of Primary Key Columns of a SQL Server Table. To do this I've found following example in MSDN under PrimaryKey property of DataTable. I've add some lines of...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you

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.