.Net Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me

The Shed is going Social! Join us on FaceBook and Twitter and chime in on the conversation.

Go Back   Dev Shed ForumsProgramming Languages - More.Net Development

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old September 28th, 2003, 10:44 AM
slconsult slconsult is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Aug 2003
Location: Essex, ON
Posts: 18 slconsult User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 1 h 5 m 35 sec
Reputation Power: 0
making a listview column of Integer type

Here's my diffculty. I have a fully functional listview except for one thing. I have written a remove button click event but I get the following error.

Error message is:

Syntax error converting the vchar value 'ID' to a column of data type int


In my SQL database, I have the Field ID set as Integer and as my unique.

This is the code i am using for the click event

SQL = "DELETE FROM ttimeoff WHERE ID = 'ID'"

Try
CN_SDURWARD.RETURN_CONNECTION.Execute(SQL)
Catch ex As Exception
MsgBox(ex.Message()) 'In case something goes wrong
End Try


and this is the code I use to Load the ID column into the listview


ListView1.Columns.Add("ID", 40, HorizontalAlignment.Center)


any suggestions?

Thanks in advance

Reply With Quote
  #2  
Old September 30th, 2003, 03:02 PM
emladris emladris is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Sep 2003
Location: SC
Posts: 26 emladris User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Talking I'm going to try!

ok, I dont' remember exactly my issue, but I do remember this same sorta thing happening to me.

To reidderate:

You have a list bound control, and you want to delete the selected item?

First off, you have to look closely at the attributes of you listcontrol. The data for it is actually set up like an ARRAY. So you have to find the "SelectedITEM" first. If you are using VS.NET, you can see in the drop down that there are like 3 items used for SELECTEDITEM. Do a display of each item to a label control, so you can see the value of each. Then you can be sure you are not only populating it correctly, but you can see what is being returned as well. If I remember correctly, it's a bit confusing until you actually print out the results, then you will understand the issue.

My guess, is you are just not getting the ID you think you are.

Good Luck!
Comments on this post
Gran Roguismo agrees!

Reply With Quote
Reply

Viewing: Dev Shed ForumsProgramming Languages - More.Net Development > making a listview column of Integer type

Developer Shed Advertisers and Affiliates



Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


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

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump

Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 


Powered by: vBulletin Version 3.0.5
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.

© 2003-2013 by Developer Shed. All rights reserved. DS Cluster - Follow our Sitemap