Very Strange Programming...
Dear all,
how may I list all the forms names on my project, if specifically, I have put the form into a number of folders, how do I get the name of the forms from that particular folder?
I am unable to google through as there aren't people will do such thing, but for me, this is quite essential.
Please help...
Thanks
PlayKid
Re: Very Strange Programming...
I'm not sure that I understand this question. Will you be wanting to programmatically move the files for the forms into different folders? Are the names already in existence? It seems to me that if you are going to be routinely moving this type of file, it would be easiest if the file name had some identifying characteristic (like it began with frm or some such). However, I'll stop there, cause I may not even be talking about the right thing.
Re: Very Strange Programming...
You know, I can create folders on design mode in solution explorer, and I grouped the related forms into one folder.
I don't want to move the forms anywhere, I just want the (name) of the form that are from that particular folder.
Re: Very Strange Programming...
Very strange question, you mean.
You want to retrieve the names of the forms... through code? What are you attempting to accomplish?
Re: Very Strange Programming...
To make a reference to the database, where a data is represent a form's control, try to do combine a number of databases variables where they share the same screen.
Re: Very Strange Programming...
This is getting stranger all the time.
Do you expect the names to change dynamically, or will you know them all at design time. If that is the case, I would suggest that you make a table in the database (or possibly hardcode them into an array) to hold them, but I'm still not understanding.
Re: Very Strange Programming...
From a coding standpoint, those folders you make for your forms at design time in the solution explorer mean absolutely NOTHING.
The ability to create those folders and organize your forms and stuff, is simply a way to keep the solution in order while you are coding it. when you create a new folder, VS actually creates that folder on your hard drive (under the root of the project) and sticks the .vb files for the form into that directory.
When you compile your application, all those .vb files are compiled into the exe. The exe has no notion of the source code it was created from as far as how the files were organized before the compile was done.
I am with Shaggy and Medhak in that I really am unsure of what you are trying to accomplish
Re: Very Strange Programming...
I'm not sure whether or not this is pertinent to the question, but what's the relationship (if there is one) between the folders & DLL's? The app I'm working with is one solution with 9 projects, organized as folders. One project is the .exe while the others are DLL's. I assumed (based solely on the evidence in my app) that organizing them into folders was part of the process of splitting the app into separate DLL's.
1 Attachment(s)
Re: Very Strange Programming...
Quote:
Originally Posted by calvin-c
I'm not sure whether or not this is pertinent to the question, but what's the relationship (if there is one) between the folders & DLL's? The app I'm working with is one solution with 9 projects, organized as folders. One project is the .exe while the others are DLL's. I assumed (based solely on the evidence in my app) that organizing them into folders was part of the process of splitting the app into separate DLL's.
Yes what you are saying is correct, but that is at the top level of a solution. He is talking about folders you can create withing a project (not a solution) to organize your code. Check the screen shot, it shows 3 projects in the solution, but the vbdotnet project has folders to seperate its classes and forms. You can drag items between folders (even between projects) and it will move them on the hard drive (just dont drag a vb form into a C# project.. it will work, but it wont compile ;))
Re: Very Strange Programming...
Thank you! Didn't realize that capability was there at all-I think I can use it to help organize the project I'm trying to modify, too. The original programmers organized things by assigning prefixes-but they helpfully neglected to document what the prefixes mean!
Re: Very Strange Programming...
yes, the ability to customize the solution files in the solution explorer is an awesome feature of VS.NET. Especially when dealing with big projects
Re: Very Strange Programming...
I would like to create a reference on a database which can reference all other database, the variable name of the textboxes could be one of the easiest way to create that reference, but to get the textboxes' name, first need to know the name of the form, so I need to somehow get the name of the form.
It's quite a strange idea, but in my head, it seems working, so wanna try.
Re: Very Strange Programming...
are you saying you want to create a database that holds all the information about whats in your project? like form names, control names on the form, their properties etc???
Since we can't crawl in your head and see what you are talking about.. you really need to explain your thoughts in detail for us to be able to try to provide an answer
Re: Very Strange Programming...
Okay, I am having a number of different databases, and they are extreamly messy, everything works on Access, all the forms from Access are similar, not 100%, the problem here is:
1. Cannot change the entire database structure, as everyone is working on it for a number of years.
2. The speed of using Access is very very slow, since the database hold a very large data.
3. Every time I change something on one form, have to do 30 times, as there are 30 different databases.
As everything that constraint on the design, I decide to create a common database which hold the value of the textboxes name, reference back to the database that needed to be used, then on the runtime, I select a database, then open the data from the common database, reference to the particular database, and load the data from that database(The messy one).
Here is the situation I am facing, I think this is the best way to solve the current problem then re-create the entire database structure.
Re: Very Strange Programming...
well, (and I am sure you feel this way too a little), that is a horrible design for a database. I know you didn't design it, and it sucks to be put in a position to work on someone elses mess.
Can I ask why there are 30 different databases? do they all hold different types of data? are they merged into 1 master database at night or something like that?
I honestly think you are in for a good amount of a rewrite, but you may find that you can do a few small things to improve your situation.
Obviously you dont want to change 1 thing 30 times. You say "all forms from access are simliar", does this mean that the actual forms you are using are infact access forms, and not a program you wrote in .NET?
Re: Very Strange Programming...
Currently, everything is in Access, in terms of speed and security, Access can't handle it very nicely, they are similar, but they hold different data, and they are not normalised, a database can contain something like:
Here1
Here2
Here3
..
Here10
God, when I first look at that database structure, I am actually can't believe how they survive all these years with such strcuture.
I am here to improve the situation, try to combine every database forms into one form, first of all, the development team can save a huge amount of time to re-code the same code 30 times, as well as the naming of each form are different, so which means I am not only copy and paste, also editing, that's insane.
Creating a .Net application is not the only option, because that's the language I know the best, and in terms of performance and security, it is much better than Access.
I can't think of anything but this, but this little thing already giving me problems, feeling a bit hopeless, although my thought can still prove workable.
Re: Very Strange Programming...
are you looking to do something like implement a change that will automatically update all the database forms with that update?
Re: Very Strange Programming...
I am trying to create a profile for each database with the same form by referencing the controls and the database fields.
In that case, I can "combine" 30 into 1, that way can improve performance and security, as well as design time.
Re: Very Strange Programming...
That's a pretty ugly situation you have found yourself in. No solution will be simple, but you can probably tame it to some extent.
I seems to me that you will get the most benefit from creating some information about each database (such as fields to use, what fields go with what controls, etc.). Fortunately, the databases sound like they are all in existence, and fixed as far as size, number, fields, field names, etc. This gives you a couple of options. You could create all the information in a database, or you could create it all in code, or in a text file, or whatever. Your needs for dynamic updates of this schema information is basically zero.
Re: Very Strange Programming...
Access sounds like it has outgrown your business needs, so think you should think about changing to SQL Server Express.
Access is fine database but you have to use dynamic queries and then watch youe user level, dont over normalise (in some case denormalise for speed!!!)
If I was u I would look for general forms...... search forms that can be passed to all databases....change the data loading for each but looks same and is driven by same SQL builder....that way things will improve. I have standard database template that I use