User Name Password Register
DaniWeb IT Discussion Community
All
What is DaniWeb IT Discussion Community?
You're currently browsing the ASP.NET section within the Web Development category of DaniWeb, a massive community of 429,870 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 2,456 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our ASP.NET advertiser: Lunarpages ASP Web Hosting

Error connecting to database

Join Date: Jan 2006
Location: Its the internet... i am everywhere lol
Posts: 274
Reputation: f1 fan is an unknown quantity at this point 
Rep Power: 3
Solved Threads: 10
f1 fan f1 fan is offline Offline
Posting Whiz in Training

Re: Error connecting to database

  #6  
Jan 30th, 2006
you havent written an insert, update or delete query. Just a select query. your cmd is a "select" command it ONLY knows about getting data. You need a new command for each of the CRUD actions you intend to do (you should in theory write one for each but if you know 100% you will never need a delete then you can leave it out). So you cannot call Update on a command whos SQL is a SELECT query.

Create a new command but this time an Insert Command (with Inser INTO sql or the name of an insert stored proc or query in your database.

I would recommend you use a data adapter and fill all 4 commands in and use this to do everything you need.

If you need more explanation let me know
Reply With Quote  
All times are GMT -4. The time now is 7:43 pm.
Forum system based on vBulletin Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
©2003 - 2008 DaniWeb® LLC