473,511 Members | 16,068 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

how can i know column have identity true in runtimes

Hi all.
I have stuck at a strange point.in Database some master table have
identity column and some havenot. Then How can i know at runtimes that
which table have identity column.
According to this i have to write query string.

I got dataset from table.
and
write
ds.Tables[0].Columns[0].AutoIncrement
which always gives false.

If youmhave any idea please share with me

Thanks
Neeraj

May 23 '07 #1
1 1829


"Neeraj" <kn*******@gmail.comwrote in message
news:11**********************@o5g2000hsb.googlegro ups.com...
Hi all.
I have stuck at a strange point.in Database some master table have
identity column and some havenot. Then How can i know at runtimes that
which table have identity column.
According to this i have to write query string.

I got dataset from table.
and
write
ds.Tables[0].Columns[0].AutoIncrement
which always gives false.

If youmhave any idea please share with me

Thanks
Neeraj
Quite a few people see this property as what you thought, an identity field
in the database. What they don't see clearly is that the property means to
auto-increment for the DataRow being added to the DataTable (not for the
dbms, but for the .Net DataTable).

What type of database are you using? If SQL Server, then you can use the
stored procedure sp_columns to return a dataset/table that contains all of
the column definitions (including whether they are an identity field).

HTH,
Mythran
May 23 '07 #2

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

Similar topics

0
676
by: Damon | last post by:
Hi, I need to query each column's constraint and name of a table in postgreSQL v7.3.4 with a single SQL query but don't know how. Would appreciate any pointers! Thank you. Regards, Damon
2
5582
by: Elmar Grandel | last post by:
Hello, i just updated my mysql database from 4.0.x to 4.1 because i like to have the possibility to create subqueries. My problem with the new release is the following: In my running project i...
2
2901
by: Andrew Grandison | last post by:
We are converting a legacy visual foxpro system to use a SQL back-end. A number of (existing DBF) tables currently have a zero-filled primary key eg. '000255' which is just an auto-incrementing...
3
2108
by: José Joye | last post by:
I have written a .NET remoting app and I would like to know the identity of the client that calls my Server. Is there a way to do it? Or do I have to pass it as parameter in each of the method...
2
5448
by: WhiteEagl | last post by:
Hello, I would need some help with this identity column problem in SQLServer. I have a database with two tables. The Parent table has an Identity column. Parent (ParentID IDENTITY, Name)...
3
1969
by: Hunter Hillegas | last post by:
I have two varchars on my table... I tried to run the following: VMGEngine=# update user_account set editor_status = 'true' and administrator_status = 'true' where rec_num = 20; ERROR: ...
3
2834
by: Susanne Klemm | last post by:
Hello! I use a procedure to insert a new row into a table with an identity column. The procedure has an output parameter which gives me the inserted identity value. This worked well for a long...
13
5765
by: PinkBishop | last post by:
I am using VS 2005 with a formview control trying to insert a record to my access db. The data is submitted to the main table no problem, but I need to carry the catID to the bridge table...
1
2342
nirmalsingh
by: nirmalsingh | last post by:
hai all, table : country primary key: country_id (identity not set) my question is. i want to change country_id property to set identity, and insert a record and then i want to release...
0
7242
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,...
0
7353
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
7418
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...
1
7075
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
5662
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
5063
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...
0
3222
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...
0
1572
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 ...
0
446
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

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.