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
Dean
NA
3
0
How to use query parameters to access a datatable?
Nov 6 2012 9:59 AM
I have a datatable called "PostCodes", and I'm trying to retrieve a row that matches a name for the suburb that is currently displayed in a combo box. The code is very simple:
DataRow[] result = PostCodes.Select("Locality = '" + cbSuburb.Text + "'");
foreach (DataRow row in result)
{
tbPostCode.Text = row[0].ToString();
tbState.Text = row[2].ToString();
}
However even though this works quite well, I want to use query parameters to get around the age-old problem of quotation marks in the Locality field.
Is there a simple way to do this? I can't seem to find anything relating to using query parameters on a datatable.
Reply
Answers (
3
)
Timeout not being respected
C# various values in app.config