TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
Tania Emmerechts
NA
4
33.3k
using combobox.selectedvalue in a query
Oct 13 2010 4:04 PM
Hello everybody,
I'm just starting to discover C#.
I have a form with a combobox.
This combobox is filled from a database like this :
combobox .SelectedIndex = -1;
combobox .SelectedValue = -1;
combobox .DataSource = sqlDataHelper.DataSet.Tables[0];
combobox .ValueMember = "ShipyardID";
combobox .DisplayMember = "ShipyardName";
When the user makes a choice, this will happen :
object m_shipyardID = combobox .SelectedValue;
Because my Value is an int.
I tried "string m_shipyardID = combobox .SelectedValue;" but that doesn't work.
Now I want to use the m_shipyardID in a query like this :
SELECT * FROM Shipyards WHERE shipyardID = m_shipyardID
But this doesn't work.
Please can somebody help me?
Thanks,
Tania
Reply
Answers (
1
)
configure sharepoint & logging framework
Reminder