 |
| ASP.NET 1.x and 2.0 Application Design Application design with ASP.NET 1.0, 1.1, and 2.0. |
Welcome to the p2p.wrox.com Forums.
You are currently viewing the ASP.NET 1.x and 2.0 Application Design section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
|
|
|
|

December 10th, 2003, 06:13 PM
|
|
Friend of Wrox
|
|
Join Date: Nov 2003
Posts: 1,348
Thanks: 0
Thanked 5 Times in 5 Posts
|
|
SQL Data Adapter
I am trying to select 1 column from my table, but it keeps automatically adding the ID column of the table. I donw'w want or need this column. Iam using the query builder to do this. I haven't switched any properties that are the defaults for the adapert.
Any ideas???
thanks
JIm
|
|

December 11th, 2003, 09:15 AM
|
|
Friend of Wrox
|
|
Join Date: Jun 2003
Posts: 1,110
Thanks: 0
Thanked 3 Times in 3 Posts
|
|
In your sql statement just use:
SELECT column_name FROM table_name
|
|

December 11th, 2003, 10:16 AM
|
|
Friend of Wrox
|
|
Join Date: Nov 2003
Posts: 1,348
Thanks: 0
Thanked 5 Times in 5 Posts
|
|
Yes, thank you, I know SQL very well .. that is not the issue
The issue is that it is putting the id column there no matter what the select statement is
|
|

December 13th, 2003, 10:07 AM
|
|
Friend of Wrox
|
|
Join Date: Oct 2003
Posts: 336
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
what is the code you are writing so you got a id column instead of of needed column
what data access you are using ADO or ADO.net ?
Ahmed Ali
Software Developer
|
|

December 15th, 2003, 04:06 PM
|
|
Friend of Wrox
|
|
Join Date: Nov 2003
Posts: 1,348
Thanks: 0
Thanked 5 Times in 5 Posts
|
|
I am using ADO.NET
it is a simple select statement of 1 column...
but it keeps putting the ID column, (primary key), in the select statemtent after the fact. So, when I generate a data set the id column is in it..
It is doing this automatically and I don't know why
|
|

December 15th, 2003, 04:45 PM
|
 |
Friend of Wrox
|
|
Join Date: Aug 2003
Posts: 5,407
Thanks: 0
Thanked 16 Times in 16 Posts
|
|
Jim,
When you use a dataadapter it needs the primary key of the table to be able to establish the unique rows for updates and deletes. It sounds like you are creating the data adapter from some of the wizard functionality of VS. Particularly with ASP.net, you may not need the functionality (and overhead) of a data adapter. If you use a data reader to retrieve the data it might be a little faster and easier to work with.
Can you describe in a bit more detail what your code is doing, and how you got to this point? Let's see if we can work out an alternative to this.
Peter
------------------------------------------------------
Work smarter, not harder.
|
|

December 18th, 2003, 12:13 PM
|
|
Friend of Wrox
|
|
Join Date: Nov 2003
Posts: 1,348
Thanks: 0
Thanked 5 Times in 5 Posts
|
|
it has never done this before. I can userstand if I am using it to generate update commands etc, but I am just using it for a Select.
|
|
 |