Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

ASP.NET Forum


You are currently viewing our ASP.NET Forum as a guest. Please register to participate.
Login



Reply
No value given for one or more required parameters.
Old 03-16-2007, 08:28 AM No value given for one or more required parameters.
Novice Talker

Posts: 10
Name: Nabeel
Trades: 0
when i tried to debug or upload the project in "visual studio 2005" in the "C#" language.
this problem view to me :-
No value given for one or more required parameters.

i need a help plz quickly
i will be thankful to any answer.
nabz00 is offline
Reply With Quote
View Public Profile
 
 
Register now for full access!
Old 03-16-2007, 08:37 AM Re: No value given for one or more required parameters.
chrishirst's Avatar
Missing! presumed drunk.

Posts: 41,517
Name: Chris Hirst
Location: Blackpool. UK
Trades: 0
this is ASP c# is .net

and the error is in some code we can't see

but it is a database query that is missing something
__________________
Chris. ->> Links are advertising NOT optimising!! <<-
A foolish consistency is the hobgoblin of little minds
Thought for today:- I SEO the only industry where all the cowboys are Indians?
chrishirst is offline
Reply With Quote
View Public Profile Visit chrishirst's homepage!
 
Old 03-16-2007, 09:46 AM Re: No value given for one or more required parameters.
Novice Talker

Posts: 10
Name: Nabeel
Trades: 0
i dont exactly what is needed maybe this :-
OleDbConnection cn = newOleDbConnection();
cn.ConnectionString =
" data source= C:\\Inetpub\\wwwroot\\insite\\App_data\\Database.m db;provider=microsoft.jet.oledb.4.0";
OleDbCommand cmd = newOleDbCommand();
cmd.Connection = cn;
cmd.CommandText =
" select * from Attorneys where id='" + id + "'";
OleDbDataAdapter da = newOleDbDataAdapter();
da.SelectCommand = cmd;
DataSet ds = newDataSet();
da.Fill(ds);
return ds;

maybe this if not tell me i will put what u need but i wanna solve plz .
thank you 4 uor help i apperciate it.
nabz00 is offline
Reply With Quote
View Public Profile
 
Old 03-16-2007, 09:49 AM Re: No value given for one or more required parameters.
Novice Talker

Posts: 10
Name: Nabeel
Trades: 0
Quote:
Originally Posted by chrishirst View Post
this is ASP c# is .net

and the error is in some code we can't see

but it is a database query that is missing something
i dont know exactly what is needed maybe this :-
OleDbConnection cn = newOleDbConnection();
cn.ConnectionString =
" data source= C:\\Inetpub\\wwwroot\\insite\\App_data\\Database.m db;provider=microsoft.jet.oledb.4.0";
OleDbCommand cmd = newOleDbCommand();
cmd.Connection = cn;
cmd.CommandText =
" select * from Attorneys where id='" + id + "'";
OleDbDataAdapter da = newOleDbDataAdapter();
da.SelectCommand = cmd;
DataSet ds = newDataSet();
da.Fill(ds);
return ds;

maybe this if not tell me i will put what u need but i wanna solve plz .
thank you 4 uor help i apperciate it.
nabz00 is offline
Reply With Quote
View Public Profile
 
Old 03-16-2007, 03:14 PM Re: No value given for one or more required parameters.
Learning Newbie's Avatar
Defies a Status

Latest Blog Post:
Astounding Republican Paranoia
Posts: 5,662
Name: John Alexander
Trades: 0
Change this line:

cmd.CommandText = " select * from Attorneys where id='" + id + "'";

to:

Response.Write(" select * from Attorneys where id='" + id + "'");
return null;

And then copy the text from the web page, paste it into a new Access query, try to run it, and you'll understand what's going on.

Ideal way to debug.
Learning Newbie is offline
Reply With Quote
View Public Profile
 
Old 03-16-2007, 05:40 PM Re: No value given for one or more required parameters.
ADAM Web Design's Avatar
Canadastaninianite

Posts: 5,938
Name: Adam for web page design, not program
Location: Toronto, Ontario, Canada
Trades: 0
You're missing the value for id itself. Chances are that it isn't being retrieved or passed from whatever you're trying to retrieve or pass it from at some point...or you're wiping it out.
__________________

Please login or register to view this content. Registration is FREE
|
Please login or register to view this content. Registration is FREE
(my blog)


Please login or register to view this content. Registration is FREE
(with proof)
ADAM Web Design is offline
Reply With Quote
View Public Profile Visit ADAM Web Design's homepage!
 
Old 03-16-2007, 06:16 PM Re: No value given for one or more required parameters.
Learning Newbie's Avatar
Defies a Status

Latest Blog Post:
Astounding Republican Paranoia
Posts: 5,662
Name: John Alexander
Trades: 0
Aha! Three days in the relevant link exchange forum!

If he wasn't passing the id variable it would return a blank string, and send the query select * from attorneys where id='' to the database. That could provoke an error for implicit conversions if id is a numeric field, because you can't turn an empty string into a number, but if it's against an Access database, the "required parameters" error means something that looks like a field from SQL syntax hasn't been assigned a value.

Basically, the field is probably AttorneyID and not ID; if the field id doesn't exist in the query, Access assumes it's a parameter, and if you try to run the query in Access, it will give you an InputBox asking you to supply a value for id. Then it would run a query like Select * from attorneys where [value you typed]='' and not return any results. Unless you just hit enter, and it would return all rows.

But Response.Write is the magic debug injecter in asp. And if you have some dynamically generated SQL, the best way to debug is to see exactly what query is being generated, and test it in the database directly.

An even better idea, though, is that dynamic SQL must die.
Learning Newbie is offline
Reply With Quote
View Public Profile
 
Old 03-16-2007, 06:35 PM Re: No value given for one or more required parameters.
ADAM Web Design's Avatar
Canadastaninianite

Posts: 5,938
Name: Adam for web page design, not program
Location: Toronto, Ontario, Canada
Trades: 0
This is true. Response.Write is a wonderful thing. I was actually thinking about something else when I wrote that answer.

I'll go serve my time like a good boy. (****, I'm pissed off at myself for coming up with that punishment. )
__________________

Please login or register to view this content. Registration is FREE
|
Please login or register to view this content. Registration is FREE
(my blog)


Please login or register to view this content. Registration is FREE
(with proof)
ADAM Web Design is offline
Reply With Quote
View Public Profile Visit ADAM Web Design's homepage!
 
Old 03-16-2007, 06:46 PM Re: No value given for one or more required parameters.
Learning Newbie's Avatar
Defies a Status

Latest Blog Post:
Astounding Republican Paranoia
Posts: 5,662
Name: John Alexander
Trades: 0
It's okay, I think you can get a pardon in this case because it's Friday. And, funny as it is, it's sort of cruel and unusual punishment!
Learning Newbie is offline
Reply With Quote
View Public Profile
 
Old 03-17-2007, 09:39 AM Re: No value given for one or more required parameters.
Novice Talker

Posts: 10
Name: Nabeel
Trades: 0
thank you for all the replies thanx a lot .
u r a good team
nabz00 is offline
Reply With Quote
View Public Profile
 
Reply     « Reply to No value given for one or more required parameters.
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 0.33320 seconds with 12 queries