Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 235437
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 11, 20262026-05-11T20:15:53+00:00 2026-05-11T20:15:53+00:00

I have a following code which works fine MsgBox(AddSomething(Of String)(Hello, World)) Public Function AddSomething(Of

  • 0

I have a following code which works fine

MsgBox(AddSomething(Of String)("Hello", "World"))

Public Function AddSomething(Of T)(ByVal FirstValue As T, ByVal SecondValue As T) As String
    Return FirstValue.ToString + SecondValue.ToString
End Function

Now we are redesigning the application to work with parameters of different types which will be provided through XML

  <SomeValues>
    <Add Param1="Somedata" Param2="SomeData" MyType="String"/>
    <Add Param1="Somedata" Param2="SomeData" MyType="MyBusinessObject"/>
  </SomeValues>

If I try to provide the following it gives error as Of accepts only type

    ''''Get DetailsFromXml --- MyType,Param1,Param2
    MsgBox(AddSomething(Of Type.GetType(MyType))(Param1,Param2))

How to solve this issue.

Edit

The above example is given to make the question simple. Actual issue is as follows
I am using SCSF of P&P.
Following is per view code which has to be written for each view

Private Sub tsStudentTableMenuClick()
    Dim _StudentTableListView As StudentListView
    _StudentTableListView = ShowViewInWorkspace(Of StudentListView)("StudentTable List", WorkspaceNames.RightWorkspace)
    _StudentTableListView.Show()
End Sub

Now I want to show the views dynamically.

 Public Sub ShowModalView(ByVal ViewName As String)
        Dim _MasterListView As >>>EmployeeListView<<<<
        _MasterListView = ShowViewInWorkspace(Of >>>EmployeeListView<<<)("Employee List", WorkspaceNames.RightWorkspace)
        _MasterListView.Show()
    End Sub

So the part shown using the arrows above has to be somehow dynamically provided.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-11T20:15:54+00:00Added an answer on May 11, 2026 at 8:15 pm

    The point of generics is to provide extra information at compile-time. You’ve only got that information at execution-time.

    As you’re using VB, you may be able to get away with turning Option Strict off to achieve late binding. I don’t know whether you can turn it off for just a small piece of code – that would be the ideal, really.

    Otherwise, and if you really can’t get the information at compile-time, you’ll need to call it with reflection – fetch the generic “blueprint” of the method, call MethodInfo.MakeGenericMethod and then invoke it.

    I assume that the real method is somewhat more complicated? After all, you can call ToString() on anything…

    (It’s possible that with .NET 4.0 you’ll have more options. You could certainly use dynamic in C# 4.0, and I believe that VB10 will provide the same sort of functionality.)

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Ask A Question

Stats

  • Questions 118k
  • Answers 118k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer Per ipython's docs, and also a run? command from the… May 11, 2026 at 11:35 pm
  • Editorial Team
    Editorial Team added an answer The problem is that you are inserting the arbitrary HTML… May 11, 2026 at 11:35 pm
  • Editorial Team
    Editorial Team added an answer MPI might be what you want: http://en.wikipedia.org/wiki/Message_Passing_Interface There are C++… May 11, 2026 at 11:35 pm

Related Questions

I have the following code where I make an copy of my database that
I have the following code which works just fine when the method is POST,
I have the following jquery code which works fine. $('#onlyTwo').click(function() { $(#textarea3).attr(disabled, true); $(#textarea4).attr(disabled,
I wrote a VB.NET Windows Service, which works fine. I have only one issue

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.