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

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

Parameter Data changing between DataSource_Inserting and the BLL call

Posted By:      Posted Date: August 27, 2010    Points: 0   Category :ASP.Net


I have a problem when trying to validate data on insertion (and possibly update, didnt try it yet) .

I use a formview in insert mode, linking to a custom BLL that then link to a DAL to insert data into a table. The problem is the parameter data is changing between the Datasource inserting event and when the BLL insert method is called. 2 field, that cannot be null in the database, have default value added to them. Bot sure how to explain so well so 'ill post some picture explaining :

This is the form I use, I enter only test in the textbox for the value Nom

this is the trace for my DataSource_Inserting event, as you can see, only the "Nom" value is non-null

But then, right after the event is done and the call is made to the BLL, the value for "Sexe" and "DateDeNaissance" has been changed to some default value, namely 0 and Jan 1, year 1.

This of course is causing problem because if the user does not provide value for "Sexe" and "DateDeNaissance" then I want t

View Complete Post

More Related Resource Links

Invalid web service call, missing value for parameter: \u0027prefixo\u0027 (AutoCompleteExtender)


Good afternoon.

I'm trying to put an AutoCompleteExtender working, but i'm having an error, that i discovered with Fiddler, that is the reason that the autocomplete doesn't work:

> **{"Message":"Invalid web service call,
> missing value for parameter:
> \u0027prefixo\u0027."**,"StackTrace":"
> at
> System.Web.Script.Services.WebServiceMethodData.CallMethod(Object
> target, IDictionary`2 parameters)\r\n
> at
> System.Web.Script.Services.WebServiceMethodData.CallMethodFromRawParams(Object
> target, IDictionary`2 parameters)\r\n
> at
> System.Web.Script.Services.RestHandler.InvokeMethod(HttpContext
> context, WebServiceMethodData
> methodData, IDictionary`2
> rawParams)\r\n at
> System.Web.Script.Services.RestHandler.ExecuteWebServiceCall(HttpContext
> context, WebServiceMethodData
> methodData)","ExceptionType":"System.InvalidOperationException"}

This is the webservice code:

    Imports System.Web.Services
    Imports System.Web.Services.Protocols
    Imports System.ComponentModel
    Imports GcpBE750
    Imports ErpBS750
    Imports StdBE750
    ' To allow this Web Service to be called fro

Changing aspx page causes session data to be lost...


Strange but true. Any ideas what might be causing this?


Data validation for datetime parameter in SSRS

Hi,   I wanted to know more about validation of SSRS parameters. I have a simple report which has a parameter called startdate of DateTime datatype. The datetime parameter in SSRS takes manual input as well. So, the user can enter any junk value. I want to ensure that the input parameter is in correct format and I want to display an error msg when the format is incorrect. My report has the following VB code for validation:   Public Function Validate( ByVal startdate As String) As BooleanIf IsDate(startdate) = True Then Return TrueElse Return FalseEnd IfEnd Function   And my report has a textbox which has the expression property set to; =Code.Validate(Parameters!startdate.Value) the textbox on the report has to display if the entered date is valid or not.   But, when i enter an erroneous date, SSRS doesn't render the report and throws a generic error. This happens even before the code written for validating the parameter executes.   Also couldn't find a way to disable the manual input for the datetime parameter. Even that would solve the problem.   Another alternative was to make the startdate parameter as string, but i want the calendar control button to be provided for the user.

Displaying a Parameter Value in the report footer that corresponds with the parameterized data on ea

I've got a report that has only one parameter, it determines the department (or departments) to base the report on, the parameter is set to allow for multiple values. The report returns only on page per department, so the report could be anywhere from one to a hundred pages, one page per department. I've included a text box in the report footer that displays the report name and the parameter value, the expression looks like this: =Globals!ReportName & " For Department " & Parameters!Dept.Value(0)    I know that in this example the zero inside of the parenthesis of the parameter value is what is returning the actual value when the report is rendered, and I understand that the zero is value in the array of parameter values. What I'm looking to do is adapt this expression so that the parameter value rendered on each page corresponds with the data (departement) displayed on the specific page. So using the example of the data, if the user selected three departments in the parameter drop down, then each page that displayed the different department’s information would also display that departments name in the page footer text box. I'm thinking that each time a page is rendered that there is a group or global variable that can be called to provide this dynamically but I can't seem to find the information. Appreciate any help, Dan

SSRS 2008 Export to PDF fails for large data with System.Exception: Parameter is not valid

Hi, We are working on Range Bar Chart using SSRS 2008. The report has huge data. It is properly displaying the data, but when we tried to export to pdf it is failing with the following exception. Exporting to excel works fine. Also if the report has small/medium data it is property exporting to PDF. It is failing only in case of huge data (we have custom page size of 28" X 14"). Of course the report has lot of expressions we used to customize the colors/text as per our requirements.   Server Error in '/Reports_SQLDEV2008' Application. Parameter is not valid. 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.Exception: Parameter is not valid. 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. Stack Trace:   [Exception: Parameter is not valid.]   [Exception: An error occurred during rendering of the report.]   [Exception: An error occurred during rendering of the report.]    Microsoft.Reporting.WebForms.ServerReport.ServerUrlRequest(Boolean isAbortable, String url, Stream ou

Multivalued parameter & Data driven subscription for SSRS 2005

I need to create data driven subscription for our reports. Most our reports have multi valued parameters (7-12 parameters with at least 4-5 with multiple values)and need to be send to a users between the range of 25-200. So standard subscription is really not a choice.I have gone through most of the threads before. Question 1:Does any one have a solution for the SSRS 2005 regarding passing mutiple values for a parameter for the Data subscription table. If yes, could you please share the information. Question 2:I found some solutions using the SOAP API. Can any one explain that in detail- how we can do it ?Reference:http://social.msdn.microsoft.com/forums/en-US/sqlreportingservices/thread/8ab615b4-1373-4258-bf49-c2843cfea8e9/http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=516735&SiteID=1 Question 3:Here is the other solution I found in one of the postsApparently passing in values like {A, B, C} only works when you configure the parameter values not to come from a dataset so that SSRS doesnt check for ValidValues.Reference: http://social.msdn.microsoft.com/forums/en-US/sqlreportingservices/thread/b2c50aea-2032-4025-a155-306c00fcb856/Any commends about this solution?Thanks

Cannot delete external data list column due "Parameter name: combinedEncoded" error

Hello!   I migrated a Sharepoint 2007 to a Sharepoint 2010 by dbattach method. And now I want to delete the BDC list columns, but I'm getting this exception: System.ArgumentException:   Parameter name: combinedEncoded    at Microsoft.SharePoint.BdcClientUtil.SplitStrings(String combinedEncoded) What should I do to delete properly this columns?   Many thanks!

changing font color on a data column field based on the contents

I am trying to change font color if the datafield has the string EMERGENCY. This is my original template field: <asp:TemplateField HeaderText="Type" SortExpression="DigType"> <EditItemTemplate> <asp:Label ID="Label1" runat="server" Text='<%# Eval("DigType") %>' ></asp:Label> </EditItemTemplate> <ItemTemplate> <asp:Label ID="Label1" runat="server" Text='<%# Eval("DigType") %>' ></asp:Label> </ItemTemplate> </asp:TemplateField>   and this is what I thought would work: <EditItemTemplate> <asp:Label ID="Label1" runat="server" Text='<%# Eval("DigType") %>' ForeColor='<%# IIf(Eval("DigType")="EMERGENCY","Black", "Red") %>'></asp:Label> </EditItemTemplate> <ItemTemplate> <asp:Label ID="Label1" runat="server" Text='<%# Eval("DigType") %>' ForeColor='<%# IIf(Eval(&quo

Calling a method with a class object as parameter data type.

   [WebMethod]    public string GetInfo(Customer inCust)    {        // Code in here    } I have a web service that resides on a remote server. I want to call a public method of theweb service named  "GetInfo". The method is shown above. The web service method expects a class object oftype "Customer". What I did to create a Customer object was to define in my asp.net project my own class named "Customer" which is exactlythe same as the class that belongs to the web service project on the remote server. I then created an instance of Customerand tried to call the web service passing in an object of type customer : my.Service ws = new my.Service(); // Get web service connectionCustomer aCustomer = new Customer();aCustomer.Initialize();ws.GetInfo(aCustomer) // call web service passing in a Customer object The problem is that the compiler gives me the following error: Value of type '_Default.Customer' cannot be converted to 'ws.Class1'. Here Default is refering to my Default.aspx.cs code. Why is this? Do I need to Cast my "aCustomer" class object to a type ofws.Customer ? How do I do that?

Hi.How I can to transfer data from object to parameter?

Hi to All. I have class with object wich populated with data from Users Interface  now I need to transfer the data to Store Procedure SQL but i can to transfer the data only using Parameters how I can to get the data from object and to put it in @parameter? Thanks/

Database vs XML for complex changing data

Hello, I'm researching and experimenting with aspects of a new project before final design.  It will be in two parts: 1. a designer interface (like visio)2. client to display the content created within the designer interface. We have the design outline in place, the client will be in many forms, via the web using Flash or Silverlight (depending what's installed) and via windows using a WPF application. I would like to know what people think regarding storing information from the designer, all the clients will need to access the information via the internet so a database storage solution seems the first choice. But another alternative is exporting the information from the designer in something such as XML and storing that as a physical file. The designer will be an application allowing the users to create multiple pages (like PowerPoint slides), each of which they have control over placement objects (images, text, buttons etc). A database approach will require a lot of work when changes are made with update, delete and inserts every time a page (slide) is changed. The XML approach seems easier to manage because each time the page (slide) is amended the XML file can either be delete and recreated or the content inside replaced with the new designer layout. It would be great to hear what other people think. I was thinking for XML to separate each slide into a separate

Parameter names ending with "specified" added to web service method call

Hello,I am new to WCF. I created a wcf web service and the generated web method exposed by wcf has some additional boolean parameters with names that end with "Specified".I am trying to understand why are these additional parameters necessary and how to get rid of them. Thanks!David

Exposing data contract without passing as input or output parameter for any operation contract


I have a method in  wcf which returns stream of custom object. I need to deserialize this stream at client side, but my custom class which is exposed as data contract is not visible through client proxy. When I add a dummy operation contract which returns the custome object I am able to get this custom class. I dont want to write this dummy method as there are many such custom classes.

Is there any way to expose data contract without writing any operation contract that returns or accepts data contract type object?





Exposing data contract without passing as input or output parameter for any operation contract


I have a method in  wcf which returns stream of custom object. I need to deserialize this stream at client side, but my custom class which is exposed as data contract is not visible through client proxy. When I add a dummy operation contract which returns the custome object I am able to get this custom class. I dont want to write this dummy method as there are many such custom classes.

Is there any way to expose data contract without writing any operation contract that returns or accepts data contract type object?

How to send parameter in query string on ajax call in asp.net mvc


I want to send selected page value on querystring while navigating through paging. URL that is generating on paging are like this

Link/Index?page=2  or Link/Index?page=3

but on my URL it only shows Link/Index and perform Ajax call but if i disable my Javascript and then navigate through paging it gets Postback and have URL like


which is perfect. But i want this type of URL in Ajax call as well how can i do this? Issue is if we navigate through pages when Javascript is enable it shows Link/Index and when user goes to page no 2 then 3 then 4 and press back button it goes to press page instead of page 3 then page 2. For reference if writing the code which generate paging

<%= Ajax.Pager(new AjaxOptions { UpdateTargetId = "divGrid", LoadingElementId = "divLoading" }, ViewData.Model.PageSize, ViewData.Model.PageNumber,
    ViewData.Model.TotalItemCount, new { controller = "LinkManagement", action = "Index" })%>

Changing data in Db using EF4



I'm trying to write an edit page to my db  (with EF4), using the controller  only (Homecontroller )

On the page and on the controller everything is working fine only (!) that the action it self is not writing the changes to the db


This is the code I'm using  in the controller :

  // GET: /Home/Edit/5
        public ActionResult Edit(int id)
            var productToedit = (from p in _entities.Products
                                 where p.Id == id
                                 select p).FirstOrDefault();
            return View(productToedit);

        // POST: /Home/Edit/5

        public ActionResult Edit(Product productToedit)
                var originalProduct = (from p in _entities.Products
                                       where p.Id == productToedit.Id
                                       select p).FirstOrDefault();
                _entities.ApplyOriginalValues(originalProduct.EntityKey.EntitySetName, productToedit);
                return RedirectToAction("index");
                return View();


If &nb

JSON data disappears on call



I have a problem with a AJAX call I do in a application.
It's a MVC application (ASP.net c#) with a lot of javascript.

When I do a call from my javascript to a controller (through a ajax call) the call gets to the class and function, but the data isn't there.
The data is send in JSON.

I found a few of the same problem but most of the time they used another name voor de parameter then it is in there json. That's not my problem.

Here is the code

            type: "POST",
            url: "/Event/Home/UserInfo",
            data: jsonString,
            contentType: "application/json; charset=utf-8",
            dataType: "json",
            success: function (result) {
            error: function (xhr, msg, e) {

public JsonResult UserInfo(string json)
            DateTime theDate = DateTime.Parse(json);
            int HomeTimeZoneIndex = VisitContext.TimezoneIndex;
            double HomeTimeZoneOffset = TzConvert.ToLocalExt(theDate, VisitContext.TimezoneIndex).Offset.TotalMinutes;
            string PublicName = VisitContext.PublishMember.PublicName;
            string Id = VisitContext.PublishMember.ID.
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