.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

Capture and pass "abc\xyz" as a string into my WCF method

Posted By:      Posted Date: August 30, 2010    Points: 0   Category :ASP.Net
Hi All, I am trying to implement WCF Method where client has to pass like "abc\xyz" as a string i have to capture it and pass to my method. I am not able to do it. In our application we can split the string  and we can do what ever we can do . but string comes from client site so who do i capture into my method. I am very much new in WCF. Could u please help me. Thanks Shekhar  

View Complete Post

More Related Resource Links

What pattern do I use to capture an entire C# method definition with all modifiers, method name and

Hello all,Given a C# method named MyMethod, what pattern do I use to capture the entire definition, including modifiers, method name and opening and closing braces, irrespective of bracket styles, given that the method will probably contain 1-n other pairs of braces, embedded or not, etc? In this case, I don't care about the actual method definition, I just need to capture it all in one chunk.    a. public int MyMethod(int parm){            if (...) {            }       }    b. public int MyMethod(int parm)       {            if (...) {            }       }Thanks in advance for any ideas and/or suggestions!

How to Pass higher Length of Byte Array to the remoting method

Dear all,I am using a windows application and the businness logic is present in the remote server.Once particular method takes bytearray as input parameter...Whenever the method call is made the function returns value .This is limited for the particular bytearray length. (4109228 bytes).If the length of bytearray crosses 4109228 bytes.I am getting an error that "input stream is not valid binary format".How to Pass higher Length of Byte Array to the remoting method... Greater than 4 MB?I believe something is missing in web.config or app.config...?What could be the issue...? Any sugesstions are welcome....ThanksRavikumar

How to pass parameters from Application Main method to modules.

Hi , We created Prism WPF application.we have to pass some parameters(some information) to modules(they are instantiated by Bootstrapper) from Main method of App.xaml  Thanks in Advance.

Pass XSL "Currently Selected" Value via Query String

Hi, I have a DVWP with an ID column, that's connected to other webparts on the page to filter their values accordingly.   I also have a "Print" button that opens a custom ASP page that's essentially a print-friendly single item data view.  How do I pass the "selected item" value to the URL when a user hits the print button? I've already set up the "ID" parameter and filters on the target page, just need to know how to get the value info from the list ID field inserted into the URL upon button click.  Thanks in advance

How to pass a String and convert to xml

A Simple Query Pass to connection String 1 My Query is SELECT a.HD, a.HEAD, a.SH, a.SUBHEAD, a.TRK, a.TRACK, a.TGT, a.TARGET, a.PDC, a.DT_RELEASE, a.STATUS, a.COFROM V_HIERARCHY1 a   2,My Data is HD    HEAD    SH    SUBHEAD    TRK    TRACK    TGT    TARGET    PDC    DT_RELEASE    STATUS    COHR    HR    Rec    Records    Leave    Leave Records    HRL.0002    Quarterly Review    01.07.2010    04.07.2010    Planned    EdlinkHR    HR1    DB    Database    SAL    Salary    DDS.0001    Calculation of Monthly salary    08.08.2010    09.08.2010    WIP    EdlinkHR    HR    Rec    Records    Ind    Induction Records    HRI.0001    Completion of dossiers.    08.07.2010    10.07.2010    WIP    EdlinkHR    HR  

Can't pass string to javascript function(unterminated string)

Hello,I have a problem. I can't pass string like this  ": Mar 15 2004 12:00AM  Refnr: 20040315!m>N0"to javascript function because I have symbols like these >, <, % ?tc.Situation:I have a Grid and I have column with DataItemTemplate,Within my dataitemtemplate I have <a href="javascript:void(0);"  onclick="ShowAccountStatementNote(document.getElementById('<%= lblHiddenNoteText.ClientID %>').value);" >                                                          Bekijken...                                                      </a><a href="javascript:void(0);"  onclick="ShowNote('<%# EncodeStringToHTML(Eval("Note")) %>');" > Notes </a>ShowNote function just show popup with text = NoteEncodeStringToHTML do Server.HtmlEncode(); But It doesn't help because even if we change text on server .... e.g. "dfdf%" convert to "dfdf&#37;"  anyway on client it becomes again "dfdf%" and problem still exists.On clien

How to pass string values to parameterized sql query in Clause?

Hi,I'm using parameterized sql query to get data from database string query = "Select * from employee where employee_city in (@value)";strign city ="'NewDelhi','Bangalore','Mumbai'";I'm using following code to achive thisDataSet ds = new DataSet();SqlConnection con = new SqlConnection("Server=localhost;....");SqlCommand cmd = new SqlCommand();cmd.CommandText =query;SqlParameter param = cmd.Parameters.Add("@value",SqlDbType.VarChar);param.Value = city;SqlDataAdapter dap = new SqlDataAdapter();dap.SelectCommand = cmd;dap.Fill(ds);But this is not giving the result.If run the query in SQLServer query window as "Select * from employee where employee_city in ('NewDelhi','Bangalore','Mumbai')", records are there.But the same query will not return any records from ADO.Net.How to solve this?Thanks,Ashokan

how to get a class reference as a reference and not a string to send for a generic method

I got some property that i get using generic method, there for I dont have it's <T>and I want to send it to another generic method but , how the heck do I get it's <T> :P?please look at the code below to understandit gets an entity framework objects, scan all it's properties and if the property is another entity framework object it would send it back to him self , the issue is that i dont know the new object <T> to send it back to him self :(search for the bold part to see what i'm missing//contains objects which we added so there wont be double adding private List<object> _addedObjects; public FakeGenericRepositoryExtension() { _addedObjects = new List<object>(); } public void Create<T>(T entity) where T : class { //add to created objects _addedObjects.Add(entity); //do something with object //... //start recircle process Type entityType = typeof(T); //run thrue each member of Type foreach (var member in typeof(Type).GetProperties()) { //get member value var member_value = member.GetValue(entity, null); //if not null //we must test this otherwise we can't get .BaseType if (member_value != null) { //get current member's base type string memberBaseType = member.GetValue(entity, null).GetType().BaseTyp

Call specific web service method by matching string value to method name?

I am getting a value in string format.  Then, I call a web service and try to dynamically call the method that corresponds to the string's value.  It doesn't work.  Any ideas?              Dim methodname As String = "getquotes"                 Dim track As localhost.Tracker = New localhost.Tracker()                 'the below line is where it fails                 track.methodname(parameter)               

Capture query string value in javascript in aspx page


I have a simple problem that I cannot remember how to solve.  I am sure it is very easy.  Following is my code:

<asp:Image id="btnAddNew" runat="server" ImageUrl="~/images/btnAdd.png" OnClick="javascript:window.open('DetailLocation.aspx?projectID=&locationID=','newWindow','width=600,height=600,scrollbars=yes');" />

In the OnClick event I have embeded a javascript function that works as expected. However, I need to embed a querystring value into the javascript function variable:


I thought I could just embed <%=Request("projectID") %> in there, but the compiler does not like it. 

Thanks in Advance.



pass a dynamic parameter in a WCF method on HTTP GET


i have a WCF method with 2 known parameters and another one thats supposed to include a Key:Value pairs (dynamic parameter that will include an unknown number of key:value pairs).

the first question is :

i don't want to use XML as the dynamic parameter. what is the common way to pass the dynamic parameter in a WCF method? Dictionary<string,String>? json string? array of complex types? or other? ( my client - the one that uses my service, doesn't have Framework 3.5, so i suggested a framework 2.0 ways to send the parameter)

the second question :

the method  supports HTTP GET , should a dynamic parameter be passed in the URL itself or in the Header? i prefer the URL itself....


thank guys, please help ....

Best Method to remove special character from string

I am trying to remove the special characters from a string that was entered by the user.  I am not sure the best method to do this.  i can get a foreach of all the characters but what do i check it against?
Christian - developer

Pass string to Javascript function from code-behind...



I'm trying to send a error message to a javascript function from code-behind, but it's not working. When the javascript is executed the output error is: [object Object]

Here's my Javascript:

function Error(error) 
            document.getElementById("<%= errorText.ClientID %>").innerText = error;

And my C#:

        textError = "This is not working!!!";

        ScriptManager.RegisterStartupScript(Page, this.GetType(), "Error", "javascript:Error('" + textError + "');", true);                

Even if i pass the string instead of the 'textError' variable i still get the same error :(

Can anyone help me?

Pass delivery method, email address to create SSRS subscription using VS2005



I have created SSRS reports and built a user UI to run these reports. Now when creating SSRS subscriptions in report Manager, is it even possible to programmatically pass the delivery method (email or file share), To email address, scheduled time and date, etc from my front-end UI to the Report Manager?

Any help will be greatly appreciated. Thanks

Pass index number and find the char in a string?


How do i find the charactors in teh first index and the last index number of a string? 


BDC Models - Pass parameters to ReadList() method?


Hi Guys,

I have some BDC models built and they work great within Sharepoint. I have one list, for example, which lists all Institutions listed in the DB.
On the following page (Everything you need to know about BDC) they show a customers list with search options at the top of it. Is it possible to get that working in Visual Studio? I've tried using filters, but it appears as those values are hard-coded from the List Settings page.
Any thoughts on how to achieve something similar?

Next challenge is to figure out how to get one-to-many relations ships working for reading data, and then for writing data (an institution can have multiple addresses, for example). But that's for another day :)


I wrote a book :) http://www.amazon.com/Microsoft-Visual-Studio-2008-Programming/dp/0071604081

Exception Handling: StackFrame Capture not capturing last level method call in release mode


I am trying print the exception details frame by frame along with other debug info (code below). In the code as you can see the DummyCall3 throws and ApplicationException and the expectation is that the stack trace will have information regarding DummyCall3. Below are the behavior I am getting with .NET 4.

  • Using the "Debug" build, when I run it, I get expected results (DummyCall3 > DummyCall2 > DummyCall > RunTest)
  • Using the "Release" build however, the DummyCall3 method is somehow missing from the stack trace. Now I only get (DummyCall2 > DummyCall > RunTest)
  • I add a dummy statement in the DummCall3 method before I throw the exception, and rerun using "Release" mode and now it works as expected with strack trace info (DummyCall3 > DummyCall2 > DummyCall > RunTest)
  • If I switch the framework version to .NET 3.5 it works as expected in both Release and Debug modes?

I would like to know if this behavior is by design or a bug? if it is by design, what was the reasoning behind it. Appreciate any input on this.


  class StackFrameTest
    public void RunTest()
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