473,804 Members | 3,675 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 1062
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.IsDBNu ll(i) && (reader.GetStri ng(i)=='myValue '))

Eliyahu

"Justin" <Ju****@discuss ions.microsoft. com> wrote in message
news:5B******** *************** ***********@mic rosoft.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.IsDBNu ll(i) && (reader.GetStri ng(i)=='myValue '))

Eliyahu

"Justin" <Ju****@discuss ions.microsoft. com> wrote in message
news:5B******** *************** ***********@mic rosoft.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****@discuss ions.microsoft. com> wrote in message
news:76******** *************** ***********@mic rosoft.com...
What is i representing?

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

if (!reader.IsDBNu ll(i) && (reader.GetStri ng(i)=='myValue '))

Eliyahu

"Justin" <Ju****@discuss ions.microsoft. com> wrote in message
news:5B******** *************** ***********@mic rosoft.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
2527
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 that fall outside of a range of valid ASCII characters. My problem is that of speed. The approach I have taken is to write a
2
1092
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 name is stored in column FirstName And the individuls last name in column LastName of the contact table and the company name is stored in column CompanyName of the company table.
1
6179
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 and this is not set to 0 as the machines have its number on which means the user should know the machine number. My problem is if the user doesn't know the number. I have a button which changes the row source of the combo box to order by...
5
8835
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 happen. Dim objKeys(2) as Object objKeys(0) = "CL" objKeys(2) = 4000 Dim posView As DataView = New DataView(posDS.Tables("Positions"), _
33
2523
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 criteria: I have a list of about 100 numbers which correspond to the ID field and also another 40 say numbers corresponding to the numbers in the PRODUCT field. I want to show the rows that correspond to both these criteria.
5
1598
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. Imp Note: The name column can be a phrase too. I want to search on the key stroke from front end. so should be able to search the name column on single charater or words. declare @a varchar(10)
3
7393
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 or DB2 UDB Text Information Extender for searching CLOBS but what are the other solutions out there. can i use some other data type and create index on it ? any ideas ?
0
1124
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: qryExport. 2. Open up your excel file, create a new sheet called something like: ImportData 3. While in your ImportData sheet, Select Data>Import External Data>Import Data 4. At this point you should be in the MS wizard, navigate to and
20
2541
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. Aslo, the tables for drawings are grouped by year. I have a Main Form and on that main form, several cmd buttons to initialize sub forms are located. There are a quite a few tables and the names are quite simple. For example, for drawing that are...
2
3373
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 fine. However only displaying (1) Column. Which is fine. Here's where it gets complicated for me. The dataset has 2 other columns that get filled. I need the resulting columns to be sent to text boxes when I select a value from the combobox. ...
0
9707
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
10338
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
10082
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
9161
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
6856
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5525
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5658
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4301
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3823
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.