.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Win Surprise Gifts!!!

Top 5 Contributors of the Month
Gaurav Pal
Post New Web Links

No value given for one or more required parameters.

Posted By:      Posted Date: August 29, 2010    Points: 0   Category :ASP.Net
Hello, I am getting the "No value given for one or more required parameters." when importing an Excel 2003 spreadsheet into my web site. I have pinpointed the problem to be the last column in my SELECT statement. This column does not seem to be a reserved word and the the data in the column 'POS' and 'HMO' seems fine as well. The SELECT code is posted below as well as 4 other columns I am having the same problem (they are commented out for now). Any help solving this problem would be greatly appreciated.Dim objCommand As New OleDbCommand("SELECT [Employee Name] as Employee, " & _ "[Residence Zip Code] as ZipCode, " & _ "[Position] as EmpPos, " & _ "[FT Exempt, FT Non Exempt, PT Exempt, PT Non Exempt] as Exempt, " & _ "[Annual Salary OR Hourly Rate] as Rate, " & _ "[Hours Per Pay Cycle] as HoursPerPayCycle, " & _ "[Date of Birth] as DateOfBirth, " & _ "[Gender] as Gender, " & _ "[Status: Active or COBRA] as AorCStatus, " & _ "[Plan Name] as PlnName " & _ "FROM [Census$]", objXConn) ' "[Workers Comp Category] as WorkersComp, " & _ ' "[Medical Tier: EE Only, EE & Child(ren), EE

View Complete Post

More Related Resource Links

Error: No value given for one or more required parameters


Hi.. Im getting error: No value given for one or more required parameters. in following code. I checked the code n found that if i remove cmd.Parameters.AddWithValue("PERIOD", period); from code and [period] = ? from command text, everything works fine. I am not getting what is wrong with period.
I am using access database and every field in database is text.
string period;
public void calc()

No value given for one or more required parameters


I have a form that has 5 text boxes on it and 2 command buttons. One of the command buttons inserts data into the database and the other command button gets data from the database. I made a ms access database that has 6 fields(id, Ticket, UserID, Date, Time, Description). I am able to connect to the database and insert data from the text boxes on my form but i am having  problems getting the data from the database and displaying the information in text boxes located on my windows form. When i hit the "Get Data" command button a input box comes so i can type in the ticket number "IN403256" to retrieve the data, but everytime i type one of the ticket numbers in the input box it says "No value given for one or more required parameters." I want to be able to input a ticket number and bring up all the information that pertains to that unique ticket number and see the information from the database in the text boxes on the windows forms.

here is my code:

Private Sub btnRetrieve_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnRetrieve.Click

txtTicket.text = ""


How do I move the parameters required for a report into my winform?


I have a SQL Server Report which I have run off the SSRS 2008 Instance Intranet Webpage, however, I would like to embed the report in a winform in C#.  I have been able to successfully do that, and the report runs fine.  However, the reason I did as such was so I can manipulate what the parameter input fields look like and arrange them accordingly.  I want them in 5 columns rather being limited to 2. 

So, how do I do that?  I have the drop downs populated with the data I would want to input. I can't logically figure out the next step..



Linq: how to share parameters between lambda expressions ?

When using Linq to objects, you will quickly feel the need to pass some parameters from a method to another but it's not so easy because each Linq method is not calling the following one. In a Linq sequence, each method is using the result computed by the previous one. So, local contexts are not visible from one method to another.
The compiler is using two technical different ways to let parameters go out of a method.

How to Encrypt Query String Parameters in ASP.NET

Encrypt Query String Parameters in ASP.NET.u can send secure data one page another page u can also use query string to encrypt

view state vs request parameters


If  the view state is the data entered into the form fields then they are supposed to be available in the request parameters or request body. Then why would we need view state for?


FormView -- Parameters and asp:Table


I've already solved this problem to my satisfaction, I just want to know WHY it works this way.

I have a FormView control bound to an ObjectDataSource.  Let's say our data source is a hypothetical table with three columns:  id, name, age.  Why is it that when I use the <asp:Table> element inside of the FormView, the parameter values are not set, but when I use the standard <table> tag, it works fine?

This seems like a .NET problem to me.  I expect the <asp:Table> element to work in the same way as <table> because they are, for all intents and purposes, the same thing.  Am I missing something?

linqdatasource parameters question



I'm currently getting to know the linqdatasource control. What would happen if several WHERE parameters are added to the linqdatasource control declaritively in the aspx page but no WHERE clause is defined? 

1. is there any issue with setting up multiple WHERE parameters in the aspx markup for linqdatasource but then deciding which ones actually get used at runtime by setting the actual WHERE clause at run time? Would the unused parameters simply be ignored and cause no issues?

2. when you need to modify WHERE clause or WHERE parameters at runtime do you need to do so in an event handler? such as linqdatasource.selecting?
I see from the above link it is possible, but is that the standard way to handle controlling filtering in code behind for linqdatasource?

2b. if you use an event such as linqdatasource.selecting to add where parameters and/or modify the where clause in code will that also break the builtin sorting and paging support of the linqdatasource with a gridview? 

sql server 2005 enterprise edition is required


sql serve 2005 enterprise edition is required to work with microsoft enterprise blocks


Export Dataset to excel sheet in a required format?



I know how to export a grid view to excel.

But here i have a Dataset which consists of data like below and also it need to display in a required format like below.

pno psubno pstate pdetailid pdetails

 12    1          CA         1           cbsdjcbdjc     

12     1          CA          2        cndcnjdcjcj

12     2           VA         4          xcndwkfcgygry

13     1            AL        1           ncdcnjdcndj

My excel sheet  should like this.

pid       pstate     

 12/1      CA             &nb

Required permissions cannot be acquired when host asp.net 3.5 application in godaddy


I got the following error when click print report button.

Application : asp.net 3.5

Crystal report : 10.5

Host: godaddy

Please help me.


Required permissions cannot be acquired.

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.Security.Policy.PolicyException: Required permissions cannot be acquired.

Source Error: 

An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.

Optional named parameters work pretty well

Rob has found a use for dynamic: http://blog.wekeroad.com/2010/08/06/flexible-parameters-with-csharp Yay! Let's celebrate! Well, I was a little puzzled because I don't think it quite adds up in the specific example he chose (although please see no aggressiveness here: Rob's a friend; peace!). The idea is to have the same flexibility that a dynamic language can offer in terms of evolution of an API. Here's his original Ruby example: def my_method(args)   thing_one = args["thing1"]   thing_two = args["thing2"] end my_method :thing1 => "value", :thing2 = Time.now The idea, which is quite common in dynamic languages, is that instead of passing a list of predetermined parameters in a specific order, you...(read more)

SqlDataSource and Parameters query


Hi everyone,

I'm on the edge wondering is it possible ? I have got 2 questions. Please help me out.

1. I have a GridView on my page and it uses sqldatasource with parameterized query. What I want to do is, on page load (where nothing has been selected so no parameter supplied), I want it to query everything (something like SELECT * FROM [this_table]) but since my SelectCommand is something like

SELECT * FROM [this_table] WHERE [this_column] = @someParameters AND [that_column] = @someParameters.

Can I play around with default value to achieve something like that but how ? Now, when the page loads, it doesn't show anything (No Gridview).

2. On my page, I made something like (username, gender, address, and more) and one single search button. That means, no single control enable auto postback. What I am trying to accomplish is building dynamic query

(if username specifed -> SELECT * FROM [this_table] WHERE [username] LIKE @username).

If both username and gender are specified (SELECT * FROM [this_table] WHERE [username] LIKE @username AND [gender] = @gender) and you know the rest. How can I do this using GridView and SqlDataSource ? To my knowledge, I can only specify one SELECT statement in a sqldatasource.  I am stucked and desparately looking for help. Thanks all.

WCF DataService - Global Parameters


Greetings.  I am searching for a way to provide a couple "global" parameters to my WCF DataService.

What I would like to be able to do is set a couple properties on the server which will be held onto by the server for future queries by the client. 

For example, it would be great when I create my client if in the constructor I can just say: 

MyDataService service = new MyDataService("http://somurl/myservice.svc?param1=value1¶m2=value2


 I can then use param1 and param2 when a client calls my service and use QueryInterceptors to provide filters to the queries.  I want to avoid having to write custom WebGet methods.

If there is a way to accomplish this; great!

If there is a way to accomplish this with just 1 call; even better!

Passing Parameters through sub reports



I am trying to use a parameter field where there is a subreport in my main report but i keep getting the error "subreport cannot be shown" when running the report. Any ideas please.

p.s - I have just set the parameters the same in the subreport as the main report.



Passing report parameters by report viewer


I have 4 parameters in which 3 are passed in report and 1 is passed through report viewer. I have made a parameter in SSRS called CandidateId to which I want to pass the value. The code for report viewer is:

 intReportID = Convert.ToInt32(Request.QueryString["ReportID"
 CandId = Convert.ToString(Session["CandidateId"
lblReportName.Text = dtReport.Rows[0]["ReportName"
SSRSReportViewer.ShowCredentialPrompts =false

 SSRSReportViewer.ServerReport.ReportServerCredentials = new
SSRSReportViewer.ProcessingMode = Microsoft.Reporting.WebForms.


 SSRSReportViewer.ServerReport.ReportServerUrl = new

SSRSReportViewer.ServerReport.ReportPath = dtReport.Rows[0]


 Microsoft.Reporting.WebForms.ReportParameter[] theparams = new

theparams[0] = new
, CandId);
theparams[0].Visible = false
ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  Silverlight  Others  All   

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend