.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

Problem Using Invoke and passing multiple byref parameters

Posted By:      Posted Date: September 27, 2010    Points: 0   Category :.NET Framework

I have code, shown below highly simplified that works all except for 1 thing: The variables being passed byRef get passed, but once modified in RecordData, they are never updated in the calling function. The calling function does not receive the updated data that is in the variables custid and amt. When debugging, I see the data in the else section of if me.invokerequired, but once it returns from the callback and is in the latter part of if me.invokerequired the data is missing.

How do I fix this?


Delegate Sub RecordDataCallback(ByRef custid As String, ByRef amt As Double)

Private Sub RecordData(ByRef custid As String, ByRef amt As Double)
    If Me.InvokeRequired Then

View Complete Post

More Related Resource Links

Help Passing Multiple Parameters Via a URL in SSRS 2008

Hello Everyone, I'm totally and completely confused as to how to pass multiple paramters through a URL.  Book Online is absolutely no help because they do not offer any examples of passing multiple paramters within a URL.  Instead, I get confused over RENDER and COMMAND and what should be repeated where with each paramter and on and on and on. Here's my URL: javascript:void(window.open('http://sereporting01.wdig.com/ReportServer?%2fDOL%2fTEST%2fDisney+Sell-Through&rs:Command=Render&SiteName=Disney,InsertionType=300 x 250,Context=ROS','_blank','resizable=yes,toolbar=0,menubar=0')) What happens is that JavaScript opens a new window but I get a "Reporting Services Error".  I'm assuming it's because my URL parameters are not correct.  Can someone please just give me the correct syntax so that I can get on with my work? I'm editing this post to add - I'm also confused as to how paramters are supposed to be passed through to a report when default paramters are set up in the report which i'm trying to open with the URL.  Should I remove the default paramaters from the report or...what? Again, BOL offers no help on this issue and it just seems to generate more questions.  Thanks!!  

Passing Multiple Parameters in NavigateURL Property of Hyperlink

In ASP.NET 3.5, is this the only way to pass Multiple Parameters in NavigateURL Property of Hyperlink ? What about using the HyperlinkField?<asp:TemplateField HeaderText="Form Name">    <ItemTemplate>        <asp:HyperLink ID="HyperLink2" runat="server"         NavigateUrl='<%# "~/Application/" + Eval("FormType") + ".aspx?FormID=" + Eval("FormID") %>'         Text='<%# Eval("FormName") %>'>                </asp:HyperLink>     </ItemTemplate></asp:TemplateField>

Problem : Need to make COM InterOp at runtime using reflections Passing Pointers as parameters?

Hello, I need to make COM IntetrOp at runtime using reflections. My native COM Object's exposed methods have some parameters as pointers (DWORD*) and some double pointers (DWORD**) and some are user defined types(e.g SomeUDTType objSmeUDTType) and vice versa its pointer(i.e. SomeUDTType *pSomeUDTType). Now for dynamic method invocation, we have single option for passing parameters as array of object i.e object[] and filling this array statically. But I need to pass pointers and references and pointers to pointers. For now how can I be able to populate object array as mixed data of simple data types, pointers or references and pointers to pointers. Working Example: Native COM exposed method : STDMETHODIMP MyCallableMethod(DWORD *value_1,BSTR *bstrName,WESContext a_wesContex Translated by tlbimp.exe (COMInterop) UDTINIDLLib.RuntimeCallingClass.MyCallableMethod(ref uint, ref string, UDTINIDLLib Now calling these methods at runtime using reflection at runtime, See here :        Assembly asembly = Assembly.LoadFrom("E:\\UDTInIDL\\Debug\\UDTINIDLLib.dll");         Type[] types = asembly.GetTypes();         Type type = null;    //foreach (Type oType in types)         {             try      &nb

SSRS problem with passing multiple parameter values via URL %2c

Hi, I have a problem with passing multiple parameter values from one report (A) to another report (B).   For example I built a URL string in report (A) with the parameters like &Parameter1=1&Parameter1=2. As soon as I click on that URL the URL parameters look like &Parameter1=1%2c2 and the parameters don’t getting populated on report (B).   If I change the parameter in the URL to &Parameter1=1&Parameter1=2 and execute the URL manual the parameter on report (B) getting populated properly.   Is there a way to disable the coding like %2c (comma) or is there another solution for it?   Thanks

Passing multiple parameters

I want to be able to pass multiple parameters through DataNavigateUrlFormatString both th PONumber and ProjectCode. 
Could someone please help me?
<asp:DetailsView ID="DetailsView8" DataSourceID="AccessDatasource8" 
        runat="server" Height="50px" Width="125px" AutoGenerateRows="False" 
         <asp:HyperLinkField DataNavigateUrlFields="PONumber" 
                  DataTextField="PONumber" HeaderText="PONumber" 
                  NavigateUrl="~/bringPO.aspx" Target="_blank" />

              <asp:BoundField DataField="PONumber" HeaderText="PoNumber" 
                  SortExpression="PONumber" HtmlEncodeFormatString="True" />
                  <asp:BoundField DataField="ProjectCode" HeaderText="ProjectCode" 
                  SortExpression="ProjectCode"  HtmlEncodeForma

Problem passing parameters to controller


I have a problem with getting a parameter in my controller.
My url is: http://localhost:portnr/News/Details/43

My Global.asax:

    null, // Route name 
    "{controller}/{action}/{newsid}", // URL with parameters 
    new { controller = "News", action = "Details", newsid = "" } // Parameter defaults 

My controller code:

public class NewsController : Controller 
    public ActionResult Details(int? newsid) 
        //some code 

My controller is never getting the value out the url, how can i fix it ?
I don't want to use: /Details?newsid=43

Facing problem in Passing Multiple values to a DataSet


Hi all,


I have a report parameter(@rptParameter), which allows only single value.

The Main Data Set query :

Select * From XXXX 

Where Title like @rptParameter+'%'

This is how i'm handling till now.

but now i need to allow users to select multiple values at report param,

and need to generate report based on that.


I'm totally lost, i don't have any idea that hw can i use "like" and "in" at a time in my Data set.


Please help me out.


If you not clear with question, let me know i will give you some example.


Thanks in Advance.


Passing Multiple Parameters to Access Database


I have had a lot of trouble passing multiple parameters from Microsoft Visual Studio 2010 to a query on a Microsoft Access 2010 database. I am coding in C# in Visual Studio. After hours of searching, I have not found a forum topic on my particular issue.

The main problem is, I do not know the number of parameters I will need to pass into to the query before I run the file (but I could potentially know this number before I run the query). Because of this, I cannot hardcode ?'s into my query and pass the corresponding number of parameters using the parameter collection class. The number of parameters I am passing depends on a file searched earlier in my code. So, I could have anywhere from one to hundreds of parameters.

One way around this problem is to call individual queries for each parameter, and compile a table based on each item returned. I would rather not do this because I want to make use of SQL’s ORDER BY function, which I know is more efficient than sorting a table using C# code after I have called the queries. 

The attempt that makes the most sense to me is to u

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

Problem with Finder method with parameters



Could someone explain me how to provide some value to the parameters in a finder method. For exemple I know that the BDC list WP use this method. Is there a way to provide some value for those parameter at runtime? I really don't understand (even after some deep search on the web) where are the values for the parameters from and how we can connect to them. Even with C# code I can't find any information on how it work.

I don't want to define my parameters as filter in the ADF because then I will have this filter section in my BDC list WP (or is there a way to get rid of that?). Actually one of the parameter should be automatically calculated from a value in a SP list, the other parameter should be provided by my own filter web part.

Thank you for your help.

Multiple Submit Connection Problem


Hello everyone,

I have an InfoPath form with two Submit Connections. One of them is a regular submit connection to a SharePoint Document Library. The other is a submit connection to the UpdateListItems web Service.

I have one button using rules that submits the forms fields to the Document Library. Some of those fields have data validation rules like entry must be four digits, and field cannot be blank.

The other submit button uses rules to submit an XML template to the UpdateListItems Template. My problem is that even though this second button does not have the first submit connection as an action, the form will still check all of the forms fields to see if they violate the validation rules before it will submit to the Web Service.

How do I tell InfoPath to ignore the validation rules when I only want to submit to the Web Service? I want the user to be able to enter data into the XML template fields and submit to the Web Service, even if some of the rest of the fields are blank. Right now if any of the other fields fail validation it prevents submittal to the web service even if the fields that failed validation are not being submitted to the web service.

Thanks for any advice that can be offered,
Bill Hurt

passing object values from server to client problem


I get a message that x_login is not declared.  I added Dim login as String = "123", but that didn't help.  What's the problem?

code behind....

Dim Login = "123"
x_login.Value = loginID


<%@ Page Language="vb" AutoEventWireup="false" CodeBehind="Default.aspx.vb" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" >
<form id="simForm" runat="server" method='post' action='https://test.authorize.net/gateway/transact.dll'>
        <input id="HiddenValue" type="hidden" value="Initial Value" runat="server" />
        <input type='hidden' runat="server" name='x_login' id='x_login' />
        <input type='submit' runat="server" id='buttonLabel' />



LINQ query with multiple joins, problem


I am using a LINQ query with multiple joins, the last join does not return any values even though values exist in the database. Below is my code.

when the query returns suiteNameTrg and SuiteTypeTrg are empty, all other values are returned correctly.

string suiteNameTrg = string.Empty;
            string suiteTypeTrg = string.Empty;
            using (DataClassesDataContext db = new DataClassesDataContext())
                    var productQuery = from assets in db.ASSETs
                    join relocatableUnits in db.RELOCATABLE_UNITs on assets.RUID equals relocatableUnits.RUID into assets_units
                    from relocatableUnits in assets_units.DefaultIfEmpty()
                   join build in db.BUILDINGs on assets.BUILDING_ID equals build.BUILDING_ID into assets_bins
                   from build in assets_bins.DefaultIfEmpty()
                   join test in db.TEST_SUITEs on assets.TEST_SUITE_ID equals test.TEST_SUITE_ID into test_bins
                   from test in test_bins.DefaultIfEmpty()
                    join testTrgt in db.TEST_SUITEs on assets.TARGET_TEST_SUITE_ID equals testTrgt.TEST_SUITE_ID into testTrgt_bins
                    from testTrgt in testTrgt_bins.DefaultIfEmpty()

                    select new

Problem with passing an Image as binary through web service



I have a web service that is accessed by a windows forms application and receives updates like facility name, address, image etc. Everything works fine except the image data is not being passed to the windows app. I am saving the images in database on both sides, so when I pull it from the server I use the following code

if (!reader.IsDBNull(floorPlanOrdinal))

facility.FloorPlan = (byte[])reader["FloorPlan"];

I can see the facility.FloorPlan Dimentions as 103840 when I debug this method which means that the data is pulled from the database fine.

On the forms side though the dimentions become 0, all other values pass fine except this. Here is the facility property in the web service on server side.

using System;

using System

Preview Crystal Report from ASP.net without passing parameters


Hi Everyone,

Sorry couldn't think of any better Subject..

I am developing a User Reports Module using C#.Net using Visual Studio 2005. Basic purpose of this module is to allow user to be able to run their own Crystal Reports. i.e. if Users have their own Crystal Reports specific to their needs then we allow them to save them and view them from our user reports module.

So when user saves any report we save it on server and save the Physical path of that report in database. Now when user tries to view the report I get the location from database and load it. Which works ok. The issue now is those reports which have got parameters. 

I am not saving any information about parameters in their reports. So I do not have any information about Report Parameters.

This same application exists in VB6. What that VB application does is opens the Crystal Report and then Crystal report asks for needed parameters exactly as it will do if we try to open a crystal report using crystal report and preview it from there it asks for parameter values. 

How can I do that in C#.Net.

VB has got code like this

Global Appl As New CRAXDRT.Application

Problem passing custom object returned by the same webservice among two separate projects

I am running into casting issue with this scenario: 1. I made a custom object lets call it EmployeeObject.  2. The Employee object is wrapped in the EmployeeWebservice.  3. I have a client application project lets call it EmployeeClientApplication and a class library called DoSomeWorkClassLibrary.  Both EmployeeClientApplication and DoSomeWorkClassLibrary reference the EmployeeWebService and need to be able to pass the EmployeeObject back and forth.  4. The EmployeeClientApplication also references the DoSomeWorkClassLibrary. 5. The employeeObject in the EmployeeClientApplication becomes EmployeeClientApplication.EmployeeWebService.EmployeeObject. 6. The employeeObject in the DoSomeWorkClassLibrary becomes DoSomeWorkClassLibrary.EmployeeWebService.EmployeeObject. 7. The DoSomeWorkClassLibrary has a method called DoSomeWork that takes an EmployeeObject. When I try to pass employeeObject from EmployeeClientApplication to DoSomeWorkClassLibrary by doing something like this: DoSomeWorkClassLibrary.DoSomeWork(EmployeeClientApplication.EmployeeWebService.EmployeeObject), I am getting Unable to convert EmployeeClientApplication.EmployeeWebService.EmployeeObject to DoSomeWorkClassLibrary.EmployeeWebService.EmployeeObject.  I have searched high and low to fix this issue, I have tried changing the namespace of the reference.cs file of the webservice in
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