473,320 Members | 1,978 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,320 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 1583
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: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

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.