473,395 Members | 2,468 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

Searching a Table Column

Using an SqlDataReader what is the best way to determine if a table column
has specified value?

Thanks, Justin.
Nov 19 '05 #1
4 1037
Any Ideas?

"Justin" wrote:
Using an SqlDataReader what is the best way to determine if a table column
has specified value?

Thanks, Justin.

Nov 19 '05 #2
If the column is of type of string use

if (!reader.IsDBNull(i) && (reader.GetString(i)=='myValue'))

Eliyahu

"Justin" <Ju****@discussions.microsoft.com> wrote in message
news:5B**********************************@microsof t.com...
Using an SqlDataReader what is the best way to determine if a table column
has specified value?

Thanks, Justin.

Nov 19 '05 #3
What is i representing?

"Eliyahu Goldin" wrote:
If the column is of type of string use

if (!reader.IsDBNull(i) && (reader.GetString(i)=='myValue'))

Eliyahu

"Justin" <Ju****@discussions.microsoft.com> wrote in message
news:5B**********************************@microsof t.com...
Using an SqlDataReader what is the best way to determine if a table column
has specified value?

Thanks, Justin.


Nov 19 '05 #4
the column index, starting from 0.

--
Eliyahu

"Justin" <Ju****@discussions.microsoft.com> wrote in message
news:76**********************************@microsof t.com...
What is i representing?

"Eliyahu Goldin" wrote:
If the column is of type of string use

if (!reader.IsDBNull(i) && (reader.GetString(i)=='myValue'))

Eliyahu

"Justin" <Ju****@discussions.microsoft.com> wrote in message
news:5B**********************************@microsof t.com...
Using an SqlDataReader what is the best way to determine if a table column has specified value?

Thanks, Justin.


Nov 19 '05 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
by: ingsms | last post by:
Hi, Does anyone have any suggestions on an approach to speed this up please? I need to check a given column in a given table to see whether there are any characters within any of the records...
2
by: theintrepidfox | last post by:
Dear Group Can anyone provide a sample query for the following scenario? Let's assume I want to search for an order someone placed which might be an individual or company. An individuals first...
1
by: Will | last post by:
I have a combo box on a form which is based on table tblMachine. On that combo box I have four columns visible MachineNumber, description, location and type. The bound column is the MachineNumber...
5
by: David Wender | last post by:
I want to create a dataview with a sort on multiple columns. However, when I use FindRows, I only want to search some of the columns, not all. Is this possible? I have not been able to make it...
33
by: Geoff Jones | last post by:
Hiya I have a DataTable containing thousands of records. Each record has a primary key field called "ID" and another field called "PRODUCT" I want to retrieve the rows that satisy the following...
5
by: sree078 | last post by:
Hi I've a list of Values with varchar field in main in a table. I wanted to have fast search as there are very less insertions/updations. Thought to do a FullText Searching on that varchar field....
3
by: db2admin | last post by:
Hello all, I have table with CLOB column length of ~65K. application is searching from this table by CLOB and i can not create index on it. I know IBM recommends using DB2 Net Search Extender...
0
by: Kelii | last post by:
Yeah, I get it; I do something similar each week at work. This is what I've done. 1. Create a simple query that shows all of your fields in your access table, name that query something like:...
20
by: tkip | last post by:
Hello everyone. I have been working on this DB for quite some time and still can't figure out a way to do what I want to do. It's a database that keep track of drawings and engineering change etc....
2
by: dibblm | last post by:
I'll start this hopefully simple and add code where needed or requested. Im using a combobox that bound to a DataSet. The Dataset retreives it's values from SQL. I can retreive the values...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.