Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Register | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
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 tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developersí questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Reply
 
Thread Tools Display Modes
  #1 (permalink)  
Old December 10th, 2003, 05:13 PM
Friend of Wrox
 
Join Date: Nov 2003
Location: , NJ, USA.
Posts: 1,346
Thanks: 0
Thanked 5 Times in 5 Posts
Default 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

Reply With Quote
  #2 (permalink)  
Old December 11th, 2003, 08:15 AM
Friend of Wrox
 
Join Date: Jun 2003
Location: , , USA.
Posts: 1,111
Thanks: 0
Thanked 3 Times in 3 Posts
Default

In your sql statement just use:

SELECT column_name FROM table_name

Reply With Quote
  #3 (permalink)  
Old December 11th, 2003, 09:16 AM
Friend of Wrox
 
Join Date: Nov 2003
Location: , NJ, USA.
Posts: 1,346
Thanks: 0
Thanked 5 Times in 5 Posts
Default

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

Reply With Quote
  #4 (permalink)  
Old December 13th, 2003, 09:07 AM
Friend of Wrox
 
Join Date: Oct 2003
Location: Cairo, , Egypt.
Posts: 336
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to alyeng2000
Default

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
Reply With Quote
  #5 (permalink)  
Old December 15th, 2003, 03:06 PM
Friend of Wrox
 
Join Date: Nov 2003
Location: , NJ, USA.
Posts: 1,346
Thanks: 0
Thanked 5 Times in 5 Posts
Default

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


Reply With Quote
  #6 (permalink)  
Old December 15th, 2003, 03:45 PM
planoie's Avatar
Friend of Wrox
Points: 16,481, Level: 55
Points: 16,481, Level: 55 Points: 16,481, Level: 55 Points: 16,481, Level: 55
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Aug 2003
Location: Clifton Park, New York, USA.
Posts: 5,413
Thanks: 0
Thanked 16 Times in 16 Posts
Default

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.
Reply With Quote
  #7 (permalink)  
Old December 18th, 2003, 11:13 AM
Friend of Wrox
 
Join Date: Nov 2003
Location: , NJ, USA.
Posts: 1,346
Thanks: 0
Thanked 5 Times in 5 Posts
Default

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.

Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
filling the combobox using sql data adapter kumaran BOOK: Professional .NET 2.0 Generics 3 May 13th, 2007 03:25 AM
Data Adapter k_kosaraju ADO.NET 1 October 31st, 2004 08:51 AM
Sql statements in data adapter Raif ASP.NET 1.0 and 1.1 Basics 1 July 14th, 2004 08:50 AM
Adapter for SQL erisa Biztalk 3 February 25th, 2004 08:28 AM



All times are GMT -4. The time now is 03:53 PM.


Powered by vBulletin® Version 3.7.0
Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.