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

C# Inner join error

ASp 2.0, C#, Access 2000 database

Ok I have a weird problem. I am trying to do a c# innerjoin and I am getting an error. Here is the inner join code:

OleDbCommand TenMileCmd = new OleDbCommand("SELECT Race.RaceTime FROM (Race INNER JOIN Registered ON Race.BibNum = Registered.BibNum AND Race.RaceYear = Registered.RaceYear)WHERE Race.RaceYear = @RaceYear AND Registered.RunnerID = @RunnerID AND Race.RaceNum = @RaceNum", conn);

TenMileCmd.Parameters.Add("@RaceYear", OleDbType.Integer);
TenMileCmd.Parameters["@RaceYear"].Value = ddlRaceYear.Text;
TenMileCmd.Parameters.Add("@RunnerID", OleDbType.Integer);
TenMileCmd.Parameters["@RunnerID"].Value = lblRunnerID.Text;
TenMileCmd.Parameters.Add("@RaceNum", OleDbType.Integer);
TenMileCmd.Parameters["@RaceNum"].Value = 10;

The error I get is: Input string was not in a correct format.

The weird thing is if I create this as an Access Data Source it works (granted the @fields are ? that I point to the proper controls.)

So if this is the correct syntax in the access data source why doesn't it work when I put it in the code behind file?

I'm lost here. Any help would be greatly appreciated!! Thanks!
Jul 7 '07 #1
1 1547
Never Mind. I figured it out. It had nothing to do with my SQL statement but my parameters.
Jul 7 '07 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

3
by: Prem | last post by:
Hi, I am having many problems with inner join. my first problem is : 1) I want to know the precedance while evaluating query with multiple joins. eg. select Employees.FirstName,...
8
by: kieran | last post by:
Hi, I have the following sql statement. I originally had the statement with two INNER JOINS but in some situations was getting an error so changed the last INNER JOIN to a LEFT OUTER JOIN (as...
3
by: mheydman | last post by:
I apologize if this has been asked before- I searched google but could not find a concrete answer. I recently inherited a database whose t-sql code is written in a format that I find difficult...
4
by: Nathan | last post by:
I have an application that uses an Access database to gather information on students' test scores. In the database there are three tables which are joined by one- to-many relationships: ...
52
by: MP | last post by:
Hi trying to begin to learn database using vb6, ado/adox, mdb format, sql (not using access...just mdb format via ado) i need to group the values of multiple fields - get their possible...
3
by: janko.klemensek | last post by:
Hello. In the following query: SELECT tblDokumentiDetails.ID_Artikel, - tblDokumentiDetails.Kolicina AS Kolicina FROM (tblDokumenti INNER JOIN tblDokumentiDetails ON tblDokumenti.ID_Dokument...
3
by: Anila | last post by:
Hi Friends, My problem with Inner join is ... first i joined two tables and i got the result. after that iam trying to join one more table its giving syn tax error in JOIN condition. ...
4
by: shapper | last post by:
Hello, I have 2 tables: Aid, Aname ... Bid, Aid, Bname ... I need to get the records in B given a Bname and a Aname. I think I should use Inner Join. I wrote the following code:
0
by: stanlew | last post by:
Happy New Year everyone! I'm new to both T-SQL and this forum. I'm currently doing an internship and my first task was to create a small program which will send an email detailing the sales of the...
4
by: AXESMI59 | last post by:
I created a query in the Access Query Builder that I modified to use with VBA Code so I could reuse it for any record I choose. The one that I created with the Access Query builder works beautifully...
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:
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
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,...
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.