473,406 Members | 2,633 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,406 software developers and data experts.

Weird problem with accessing accessdb

OleDbConnection con;
OleDbCommand cmd;
OleDbDataReader reader;

con = new
OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0; Data Source=" +
Server.MapPath("App_Data\\db.mdb") + ";");
con.Open();

cmd = new OleDbCommand("Select tblUsers.userID from tblUsers
WHERE tblUsers.Login = ? AND tblUsers.Password = ?", con);

cmd.Parameters.Add("Login", txtUser.Text.ToString());
cmd.Parameters.Add("Password", txtPass.Text.ToString());
reader = cmd.ExecuteReader();
---------------------------------------------------------

After this is executed I get the following error:

No value given for one or more required parameters.
Description: An unhandled exception occurred during the execution of
the current web request. Please review the stack trace for more
information about the error and where it originated in the code.

Exception Details: System.Data.OleDb.OleDbException: No value given for
one or more required parameters.

Source Error:
Line 42:
Line 43:
Line 44: reader = cmd.ExecuteReader();
Line 45:
Line 46:

What could be the cause of it?
Yossi.

May 29 '06 #1
1 940
Yossi,
There is nothing wrong with your code. That means either there is / are no
values for "txtUser.Text.ToString());" etc., or that the names of the
parameters are incorrect.

Peter

--
Co-founder, Eggheadcafe.com developer portal:
http://www.eggheadcafe.com
UnBlog:
http://petesbloggerama.blogspot.com


"yo********@gmail.com" wrote:
OleDbConnection con;
OleDbCommand cmd;
OleDbDataReader reader;

con = new
OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0; Data Source=" +
Server.MapPath("App_Data\\db.mdb") + ";");
con.Open();

cmd = new OleDbCommand("Select tblUsers.userID from tblUsers
WHERE tblUsers.Login = ? AND tblUsers.Password = ?", con);

cmd.Parameters.Add("Login", txtUser.Text.ToString());
cmd.Parameters.Add("Password", txtPass.Text.ToString());
reader = cmd.ExecuteReader();
---------------------------------------------------------

After this is executed I get the following error:

No value given for one or more required parameters.
Description: An unhandled exception occurred during the execution of
the current web request. Please review the stack trace for more
information about the error and where it originated in the code.

Exception Details: System.Data.OleDb.OleDbException: No value given for
one or more required parameters.

Source Error:
Line 42:
Line 43:
Line 44: reader = cmd.ExecuteReader();
Line 45:
Line 46:

What could be the cause of it?
Yossi.

May 29 '06 #2

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

Similar topics

4
by: news | last post by:
I have two IP Web pages, both on the same server, and both I am accessing with the same browser. On both pages I have this code: if(getenv("HTTP_CLIENT_IP")) { $ip = getenv("HTTP_CLIENT_IP");...
1
by: Robertb | last post by:
I'm driving myself crazy trying to figure this one out. So much so that I think I'm within walking distance now! The program is written and compiled in Visual Basic 6 with SP5. The OS is...
1
by: A P | last post by:
I receive error when connecting to MS access DB with password. Microsoft JET Database Engine error '80004005' Could not find installable ISAM. /lpo/common/cnlocalpo.asp, line 4
0
by: Bing | last post by:
Hi, I am configuring the same DB2 v8.1 JDBC universal driver (db2jcc.jar and db2jcc_license_cisuz.jar) from DB2 SP5 fix pack under WSAD 5.1.x environment and WebSphere application Server 5.0.2...
0
by: Richard Mathis | last post by:
My problem is rather complicated (for me), so I'm going to post my problem here as well as what I've done so far to solve my problem. Any assistance would be appreciated. I originally posted this...
2
by: M. Simioni | last post by:
Hi, the webserver is a HP ProLiant DL380 G3 1GB RAM Dual U320 SCSI COMPAQ Smart Array 5i + Battery Pack installed N°2 (RAID 1) COMPAQ BD072863B2 - 72.8GB Ultra320, 10K Hot-pluggable, 1"...
3
by: Richard Morton | last post by:
Hi, This is my first posting to this list, I guess a small intro should be first, been developing in PHP for sometime, mainly with Mysql and nearly always on Windows (oops, sorry). I have...
5
by: Jim Strathmeyer | last post by:
So I'm having some weird problems with file output. If I try to boil this problem down to a small, simple program to just show what problems I'm having, I can't get the same problematic behavior. I...
2
by: WisTex | last post by:
I've come across a very weird problem. Virtual includes work on all my ASP pages on the entire website, including those in subdirectories, yet they won't work on a particular page I created, even...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
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
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
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...
0
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...

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.