473,387 Members | 1,493 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,387 software developers and data experts.

Select command and test for number

Hi All

I have two questions, if someone can help me or point me
in the right direction.

1. I have an OleDbDataadapter, OledbConnection and
DataSet. Now the select command for my DataAdapter has a
select command like the following : SELECT fields FROM
table WHERE certainfield = aVariable

I pass a variable into a function to satisfy the Where
statement, btw the data type of the field in the WHERE
statement is a long. When I pass a valid number like
340995, the select command works fine and I am able to
populate the DataSet, but if I pass a * then I get a
System.FormatException error. Bsically I would like this
select command to cater for a specific number, or all
numbers, is there a way to keep the same SQL SELECT
statement and just pass the specific number or the *?

2. How to I test if a string, not Char, is numeric or not?

TIA for any help
Much aprreciated
Kevin
Nov 15 '05 #1
1 1585
Kevin wrote:
but if I pass a * then I get a System.FormatException error.


I don't think you can wildcard on a numeric field. Try passing in
something like this:

string.Format(">= {0} AND <= {1}", int.MinValue, int.MaxValue);

--
There are 10 kinds of people. Those who understand binary and those who
don't.

http://code.acadx.com
(Pull the pin to reply)
Nov 15 '05 #2

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

Similar topics

5
by: | last post by:
Is it possible to extend this function to dynamically create a combo boxes from the db table....How would do this...I tried passing a 'Select' type to the function but got a blank entry....Any...
0
by: Jan | last post by:
I store sql-commands in a database table. In the first step I get the sql command out of the database table with embedded sql. In the second step I try to execute the command, which i got from the...
2
by: Kevin | last post by:
Hi All, I am new to MS SQL Server.I am using MS SQL 2000.I have a problem in creating a table by using Select command.I have table called "test" and i want to create another table with the same...
2
by: David Nedrow | last post by:
OK, I have a problem which I'm guessing is simply my inability to figure out a select pattern in XSL. I have an XML file similar to the following: <?xml version="1.0"?> <?xml-stylesheet...
14
by: deko | last post by:
Can the DROP TABLE statement be used with a select or where statement? DROP TABLE SELECT * FROM tblTablesImported WHERE Import_ID Not In (SELECT FROM tblTablesInternal); Or do I have to...
1
by: Kevin | last post by:
Hi All I have two questions, if someone can help me or point me in the right direction. 1. I have an OleDbDataadapter, OledbConnection and DataSet. Now the select command for my DataAdapter...
4
by: Ed L. | last post by:
I think I'm seeing table-level lock contention in the following function when I have many different concurrent callers, each with mutually distinct values for $1. Is there a way to reimplement...
4
by: Ian Richardson | last post by:
Hi, The function I've put together below is a rough idea to extend a SELECT list, starting from: <body> <form name="bambam"> <select id="fred"> <option value="1">1</option> <option...
21
by: Leena P | last post by:
i want to basically take some information for the product and let the user enter the the material required to make this product 1.first page test.php which takes product code and displays...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
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: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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...

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.