473,396 Members | 1,864 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

Can I create windows form by using late binding?

Hi,

I have a database table field to store the form name, I want to create the
particular windows form by using the value that read from that DB field. For
examples, the table field has a value "ThisForm", then I want to create the
form with class name "ThisForm" (Suppose I have already defined the class
"ThisForm"). Can I do this by using late bindnig? Any source code for
reference? Thanks!

Steven.
Feb 8 '06 #1
4 1738
Steven,

You have a form and you want to give it from the database the name from this
field. And then?

This sounds for me as

me = dr("ThisForm")

http://msdn2.microsoft.com/system.wi...trol.name.aspx

Not that it does something or is usable in your program, however that is it.

Cor

"Steven" <a@a.com> schreef in bericht
news:Ov**************@TK2MSFTNGP12.phx.gbl...
Hi,

I have a database table field to store the form name, I want to create the
particular windows form by using the value that read from that DB field.
For examples, the table field has a value "ThisForm", then I want to
create the form with class name "ThisForm" (Suppose I have already defined
the class "ThisForm"). Can I do this by using late bindnig? Any source
code for reference? Thanks!

Steven.

Feb 8 '06 #2
oh, sorry. My problem is to create an instance of the form but not just
change the name of the form.

For examples, I defined 3 windows form in my VB code which have name
"Form1", "Form2" and "Form3". Which form I need to display in screen is
depended on the field in the database table. Can I do this by using late
binding? Coz I don't know which form I need to create before doing the
database query.

"Cor Ligthert [MVP]" <no************@planet.nl> wrote in message
news:uk**************@TK2MSFTNGP12.phx.gbl...
Steven,

You have a form and you want to give it from the database the name from
this field. And then?

This sounds for me as

me = dr("ThisForm")

http://msdn2.microsoft.com/system.wi...trol.name.aspx

Not that it does something or is usable in your program, however that is
it.

Cor

"Steven" <a@a.com> schreef in bericht
news:Ov**************@TK2MSFTNGP12.phx.gbl...
Hi,

I have a database table field to store the form name, I want to create
the particular windows form by using the value that read from that DB
field. For examples, the table field has a value "ThisForm", then I want
to create the form with class name "ThisForm" (Suppose I have already
defined the class "ThisForm"). Can I do this by using late bindnig? Any
source code for reference? Thanks!

Steven.


Feb 8 '06 #3
CMM
Activator.CreateInstance(Assembly.GetExecutingAsse mbly().GetType("name"))

Note:
1) "Assembly" is in the System.Reflection namespace.
2) "name" must to be qualified with the namespace of your application (by
default, in VB, it's the same as your project name): "MyAppName.Form1"

"Steven" <a@a.com> wrote in message
news:ep***************@TK2MSFTNGP11.phx.gbl...
oh, sorry. My problem is to create an instance of the form but not just
change the name of the form.

For examples, I defined 3 windows form in my VB code which have name
"Form1", "Form2" and "Form3". Which form I need to display in screen is
depended on the field in the database table. Can I do this by using late
binding? Coz I don't know which form I need to create before doing the
database query.

"Cor Ligthert [MVP]" <no************@planet.nl> wrote in message
news:uk**************@TK2MSFTNGP12.phx.gbl...
Steven,

You have a form and you want to give it from the database the name from
this field. And then?

This sounds for me as

me = dr("ThisForm")

http://msdn2.microsoft.com/system.wi...trol.name.aspx

Not that it does something or is usable in your program, however that is
it.

Cor

"Steven" <a@a.com> schreef in bericht
news:Ov**************@TK2MSFTNGP12.phx.gbl...
Hi,

I have a database table field to store the form name, I want to create
the particular windows form by using the value that read from that DB
field. For examples, the table field has a value "ThisForm", then I want
to create the form with class name "ThisForm" (Suppose I have already
defined the class "ThisForm"). Can I do this by using late bindnig? Any
source code for reference? Thanks!

Steven.



Feb 8 '06 #4
"Steven" <a@a.com> schrieb:
I have a database table field to store the form name, I want to create the
particular windows form by using the value that read from that DB field.
For examples, the table field has a value "ThisForm", then I want to
create the form with class name "ThisForm" (Suppose I have already defined
the class "ThisForm").


<URL:http://dotnet.mvps.org/dotnet/code/techniques/#ClassByName>

--
M S Herfried K. Wagner
M V P <URL:http://dotnet.mvps.org/>
V B <URL:http://classicvb.org/petition/>

Feb 8 '06 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: Barry Edmund Wright | last post by:
Hi All, I am using the code below to assign a form name to a form variable (vFrm). Is there a way to assign the Openargs string directly to vFrm, i.e. vFrm = Openargs ? Private Sub...
4
by: dave | last post by:
I have an Access 97 application running quite happily in Windows 2000. If I upgrade a machine to Windows 2000 SP4 then I get an error in one area which is this - I use Automation to run an instance...
8
by: Rich | last post by:
Hello, If I leave Option Strict Off I can use the following syntax to read data from a Lotus Notes application (a NotesViewEntry object represents a row of data from a Lotus Notes View - like a...
13
by: Just Me | last post by:
I have two forms. Each contains a property, say Prop. I do Public FormBeingUsed as Form .. .. .. Then I do FormBeingUsed= Form1 or maybe
1
by: Rocio | last post by:
I have a windows app. written in VB6, now we need to expose some of its classes through a web service. I am only able to expose the classes using late binding becasue that's the way the original...
7
by: pmclinn | last post by:
I was wondering if it is possible to dynamically create a structure. Something like this: public sub main sql = "Select Col1, Col2 from Table a" dim al as new arraylist al =...
30
by: lgbjr | last post by:
hi All, I've decided to use Options Strict ON in one of my apps and now I'm trying to fix a late binding issue. I have 5 integer arrays: dim IA1(500), IA2(500), IA3(500), IA4(500), IA5(500) as...
7
by: jwang | last post by:
I am trying to instantiate a COM component in C# via late binding. The component appears to be launched, then it automatically gets unloaded. That is, the instance is unloaded after the...
1
by: Arjan | last post by:
Hello, I am trying to develop a Windows Service that is able to connect to a MS SQL Server 2005 database through late binding. However I am not able to find any information about this. I hope...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.