How to Serialize data before binding to grid ???

25 pts.
Tags:
GridView
I am using the code given below (uses reflections), If (minfo IsNot Nothing) Then gvResult.DataSource = minfo.Invoke(Activator.CreateInstance(classtype), inputParameterStore) gvResult.DataBind() Else lblErrorMsg.Text = "No method available" End If Here minfo is an object of type methodInfo. It is used to store information (metadata) of a function. I am getting minfo before the If (minfo IsNot Nothing) statement. >>> minfo.Invoke(Activator.CreateInstance(classtype), inputParameterStore) causes the function to get invoked where (classtype) is the class which contains the function. >>> Activator.CreateInstance(classtype) creates an instance of the class mentioned in the classtype >>> inputParameterStore is an object array containing all the parameters needed to be passed to the function to invoke it. >>> gvResult is the grid where the result of invoking the function appears ----------------------------------------------------------------------------------------------------------- Now the Problem, There are some functions that return something that cannot be bound to the grid.( Heard but not sure , if its IList or IEnumerable or IDataSource then its fine , else it cant) Now how to do that ??? I tried checking like this Dim myReturnValue As Object = minfo.Invoke(Activator.CreateInstance(classtype), inputParameterStore) But it yields something else …… (Not works) -------------------------------------------------------------------- The next assignment is If the return value from the function can’t be bound to grid then I should Serialize the return data and display in a textarea as a grid …….. How to do that too ???

Answer Wiki

Thanks. We'll let you know when a new response is added.

<b>I am using ASP.NET to code this !!!</b>

Discuss This Question: 1  Reply

 
There was an error processing your information. Please try again later.
Thanks. We'll let you know when a new response is added.
Send me notifications when members answer or reply to this question.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy
  • carlosdl
    I think you should specify what programming language and version you are using. It is a good idea to put those details as tags when creating a question, so the appropriate experts will have a look at it.
    69,510 pointsBadges:
    report

Forgot Password

No problem! Submit your e-mail address below. We'll send you an e-mail containing your password.

Your password has been sent to:

To follow this tag...

There was an error processing your information. Please try again later.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy

Thanks! We'll email you when relevant content is added and updated.

Following