C# - .NET Multiple Namespaces For Single Class

Sep 27, 2010

Is it possible to have a single class reside within two name-spaces and how can I do this?

To clarify: We have a class library (let say root namespace is classLib1), which has grown over time (more classes) and I want to logically group classes into different namespaces. However some of the older classes need to be grouped into these new namespaces (e.g classLib1.section1) and doing so will break legacy code in other assemblys that use this class library. So I want to be able to refer to a class using both name-spaces until we can phase the old ones out.

I can't find any information on this, which suggests there is a reason that people would not want to do this!?!

View 3 Replies


ADVERTISEMENT

One Class With Two Different Namespaces?

Jul 13, 2010

Is something like this possible?

Namespace Transaction, Document
Class Signer
Public Sub New()

[Code].....

I basically want to be able to instantiate the Signer class from either Namespace. The reason is that I mistakenly set it up in the Transaction class and need to migrate it over to the Document class without breaking existing legacy code. I'd prefer to not have the same Signer class duplicated in both Namespaces if possible.

View 3 Replies

Keeping Class Namespaces In Sync With Folder Structure

Oct 13, 2009

After being spoiled for years with C# automatically setting the default namespace for new classes to match my folder structure, I'm wondering if there is any way to get VB.NET to do the same?

I've been aware for awhile that it doesn't do this automatically but I've never really researched alternatives. keep my VB.NET class namespaces in sync with my project folder structures?

View 1 Replies

Multiple Namespaces Causing Conflict With Calling A Function

Jan 19, 2009

For a project I am working on there are two namespaces. Currently,[code]...

The problem is that when I have the button click inside the ScreenCapture Namespace, it gives me an error with the Handles Button1.Click saying " Handles clause requires a With Events Variable defined in the containing type or one of its base types". If I move it out of the namespace however, it tells me that Function1 is not defined.

View 2 Replies

Namespaces - Including Common Code In Multiple Files?

Jun 19, 2012

I'm new to the .NET platform (old-time ASPer) and for a project have a simple pair of .aspx scripts that take some querystring data and process it. They both make use of the same Subs, Functions in them, so naturally I'd like to move the code to a common resource.vb file. Having done some reading, it looks like my options are a Code-Behind type setup, and placing the Subs, Functions in a .vb file and placing that file in App_Code.So, the Code-Behind model doesn't seem to make sense here, as the functions are shared by both files. Placing the Subs and Functions in /App_Code/resources.vb and I am getting the following error when trying to call any of the routines:

View 2 Replies

Is Running Multiple Threads Faster Then A Single Thread On A Single Core Cpu

Dec 23, 2009

Say I have a code with 3 methods that do some pretty intensive work. Would executing these methods on 3 seperate threads be faster then executing them one after the other on a single core cpu? And what if it's a dual core or HT?

View 8 Replies

VS 2008 Bind A Single DGV Cell To A Single Class Property?

May 7, 2010

I am trying to use the DGV to view various properties from a variety of different class instances. Is it possible to bind each cell individually?

View 9 Replies

Define A Class Such That There Can Be Only A Single Instance Of That Class?

Jan 20, 2012

Is there a way to define a class such that there can be only a single instance of that class?

View 5 Replies

Merging Multiple Sheets From Multiple Workbooks Into New Sheets In A Single Work Book

Dec 13, 2011

I am looking for the code to consolidate multiple .xls sheets from within multiple work books in a file all containing the same format of information. Each sheet needs to be coppied to a new sheet within a single work book.

Once in a single sheet I need to then copy data from a range of fields into one consolidated sheet.

View 1 Replies

Why Does .NET Class Library Show "My" And "My.Resources" Namespaces In Reflector

Jan 16, 2009

I have no intention of using "My" for anything in any of my projects. I haven't done anything with it (that I know of). But every one of class libraries shows a "My" namespace in Reflector and NDepend. This adds a lot of unnecessary clutter.

1) Why does it show up?

2) How can I remove it?

View 2 Replies

Defining A Class For Multiple Child Class Instances?

Feb 10, 2011

I have created a class for a Sports Facility. A facility has a Name, Status, Notes, etc as members of the class. This works well, I can create a new instance of an exisitng Sports Facility from the database, create a new instance, etc. All working well.What I am stuck on is accessing a list of Sports Facilities. I know I can create a new list by doing

Dim List As New List(Of Facility)

For Each fRow As DataRow In ds.Tables("Facilities").Rows

List.Add(New Facility(fRow.Item("FacilityID"))

Next

View 4 Replies

C# - Using A Single DataSource On Multiple .NET Forms

Sep 16, 2010

My program has two forms which get data from the same data source. After binding controls to tables and fields on both forms, I noticed each form has it's own apparently duplicate DataSet. Is it standard practice for each form to have its own DataSet even though they use the same ConnectionString and connect to the same database at the same time?

View 1 Replies

Combining Multiple Projects Into A Single One

Apr 19, 2008

I originally developed a simple application software [VB.Net + MS Access] (Lets call this project A) but now I want to include more functionality in it. I have an encryption/ decryption software utility (Lets call this project B ) and a Text to speech generation utility(Lets call this project C) . That is, I want to add Projects B and C to project A. [Such that clicking on the main form of project A calls a form from project B or C as desired].In solution explorer, I right clicked--Add Existing Project--and added both the above mentioned projects 1 by 1. (Added B and C to the solution explorer with the already present A).As the application software's (Project A's) main form is the main form of my project, I want to have a menu option on the main form (Of Project A) so that a user could click on one of the menu options and the main form of my other projects ( Project B or Project C or Encrypt/Decrypt or Voice Generation) should open by him doing so. To this effect, I tried the following:

1. I dragged the form simply from one of the projects (From B or C ) into the folder of my Application Software (Project A).This generated a lot of Build errors and the Voice Generation utility (Prj. C) would not work like this.

2. Tried to reference a dll, however the authors of Projects B and C did not include a dll in their projects.

3. Now I came to know that to call a form residing in another project folder or even another folder within the same project, you have to give a path for the form. HOW DO WE DO THIS?

As you can understand, I cannot copy the entire code of the 3 projects here....I will try attaching my project here though..Here it is: http: rapidshare.co...MY_Prj.zip.html[Dear Administrator: The downloading option on the webpage does not allow files bigger than I mb, thts why I used an external link]As I said, in the application, Project A is TMS.NET ; Project B is EncryptFile and Project is C.I encountered a problem while adding project C [spoken word], so the project contains only projects B and A. I will try to attach project C seperately.That is, TMS contains proj A+B and Speech contains C.

View 4 Replies

How To Combine Multiple Matrices Into A Single One

Jan 12, 2011

I am trying to understand transformation matrices (not just their implementation in VB, but in general) and I've put about 3 full days into this so far. I believe I have the data in my matrices correct. Applying any single matrix to an array of points does a correct transformation.I am wondering if I understand how to combine multiple matrices into a single one.I understand you just have to multiply them together.I took this to mean you just have to multiply each element with its corresponding element in the second to make a third matrix?[code]

View 5 Replies

MDI Single Form Or Multiple Forms

Mar 7, 2010

I've written an application with about 30 forms and am almost ready to publish, my biggest concern though is that i'm not sure if its a normal thing to do having all these forms and hiding, disposing and showing forms throughout the use of the application.I've toyed with the idea of converting to a MDI Child / Parent interface as well as having one form with lots of subcontainers that are hidden and then hiding / showing them as the navigational buttons are shown.Ive worked on this application for about 8 months now, but would be happy to rewrite the interface and appearance of it if i know that it is not generally an acceptable practice having forms flashing open and closed while navigating through the application.

View 3 Replies

Multiple Operations Using Single RecordSet?

Jun 18, 2012

I have some task regarding do operations on database using ADODB in Vb.NET.regarding using the same record set multiple times?

I have tried on this topic just by closing the recordset after performing First operation and doing second operation e.t.c.

In ADO.NET we have "MultipleActiveResultSets=True" in ConnectionString for SqlDataReader.Do we have any property like this in ADODB?

View 1 Replies

Multiple Thumbs On Single Scrollbar?

May 10, 2011

I'm working on a project that involves using multiple scrollbars. Scrollbar1 displays the medium value and its thumb is disable, scrollbar2 displays min value and scrollbar3 displays max value. I can try to use three separate scrollbars to accomplish thetask but that doesn't look nice. Therefore,

View 3 Replies

Save Multiple Textboxes In A Single .txt?

Dec 4, 2011

ok i need a code to save multiple textboxes in a single .txt..

EX:
TextBox1.Text = ("Michael Rittenburg")
TextBox2.Text = ("United States")
TextBox4.Text = ("Nashville")
TextBox3.Text = ("Tennessee")
TextBox5.Text = ("37203")

View 3 Replies

Single File To Multiple Subdirectories?

Jun 7, 2009

basically im looking to have two textboxs with 3 buttons

TextBox1.text contains the path to the new file and

TextBox2.text contains the path folder to subdirectories

i have everything i need working, haha i know not much, this is only my second day with vb.I just needed a button now to carry out the function of copying the file i tried using simple file copy but i had to specify a file output in that and it only gave me option to copy it to one directory.For instance

C:index.php TextBox1.text <- loaded in from button 1

C:www* TextBox2.text <- button 2 loading subdirs

now i need a button 3 that would carry out the function of copying textbox1.text to all subdirs in textbox2.text.i thought i would have been able to use simple copy as stated above with wildcard in my program but no joy

View 6 Replies

Single Form With Multiple Instances

Aug 12, 2010

I have a form which displays temperature and humidity data for a device in the field. I have multiple devices. Rather than creating a separate form for each device, obviously it is much better to have a single form that I instantiate, pass data to, and display. The devices are listed in a treeview, and when the user double-clicks the node, I create an instance of the form, pass the device's data to the instance of the form, and display the form. All of this works perfectly. However, I have a challenge: If the form for a particular device is already open, I don't want another one opened when the user double-clicks the node.

However, whenever I place logic in the program to check for the existence of the form and only allow another instance to be created if one doesn't already exist, it prevents me from creating a form instance for any other device that I may wish to view, simultaneously. So, I have a dilemma -- allow the user to display the data for multiple devices, including allowing multiple forms to be open for a single device, OR only allowing one device to be displayed at any given time.

View 2 Replies

VS 2010 Single Or Multiple Datasources?

Sep 23, 2010

Is it better to add just one datasource to your project that holds all your database tables and queries that you use as typed datasets. Or, create a datasource for each individual form or situation where your using the database tables as typed datasets. It seems simplier to have just one datasource but is there a down side. We're talking about @25 database tables/queries.

View 8 Replies

Employee Class Single Error Identification

Feb 15, 2011

I'm currently taking a newbie VB course (online) and in this program that I am writing, I am getting one error (red) that when double clicked in the Error List, takes me to the Application.Designer window and states that "Employee is a type in 'WindowsApplication1' and cannot be used as an expression." The only solution it gives me is to generate the Employee Class (in the designer). When I select that, it gives me 3 more errors (all yellow). The Employee class has been made, so I don't really know where else to go from here.[code]...

View 1 Replies

Employee Class Single Error Identification?

Feb 15, 2011

I'm currently taking a newbie VB course (online) and in this program that I am writing, I am getting one error (red) that when double clicked in the Error List, takes me to the Application.Designer window and states that "Employee is a type in 'WindowsApplication1' and cannot be used as an expression." The only solution it gives me is to generate the Employee Class (in the designer). When I select that, it gives me 3 more errors (all yellow).

Option Strict On
Public Class Employee
Private firstName As String ' employee first name

[code]....

View 3 Replies

How To Compile Single Class Into Existing Project

Mar 18, 2010

I have a VB.NET solution (call it S1) which produces a .vb file (say File1.vb) to be compiled and then included in another solution (S2). S2 is a console app which I want to run from a cmd prompt, not VS. My plan is to shell out from S1 to run a batch file to do the compile and then copy the .dll file, overwriting the old one in S2 (then I can run S2 in a separate operation). Here's the batch file for the compile:

View 4 Replies

VB 10 Class Project/Single Array Usage?

Mar 11, 2012

I'm doing a project for my beginners programming,logic, and design class. The project is a Sales Solution/Bonus Calculator. I really just want to know if I actually coded the array correctly. I've found the same project on here but I wasn't even really sure if what they had up was correct. I have a pretty solid idea of how to get through this I'm just feeling a bit overwhelmed. If you notice any other errors please point them out. I'm not looking for the answer I'm just looking for the path to get there on my own merit. Here's what I have so far:

Public Class Form1
Private Sub Report_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles CreateReport.Click

[code]......

View 2 Replies

Accessing Multiple Projects In A Single Solution

Jun 17, 2009

I've developed a couple of different stand-alone projects, myRibbonRTF and myRibbonCalendar and have them functioning well. I want to tie these together with other projects in a single solution called myMain. When I add these projects to the solution, their forms are not accessible in myMain (e.g. myRibbonRTF.frmMain.Show()). I've searched high and low for the last week trying to solve this and the only nearby solution is to turn the other projects into .dlls and access them in myMain that way.

View 7 Replies

Asp.net - Prevent Multiple Logins For A Single User?

Jun 9, 2011

How can I prevent a single user from logging in to my asp.net website from more than one computer at the same time?I have tried using the application server side state managenment but it is not work properly.

View 1 Replies

Building A Single Setup For Multiple Applications

Apr 7, 2010

I have been working with Visual Studio 2005 for about a year and a half but the deployment task was never left to me. So now I'm being asked at my company to build a setup which will prompt to install up to 4 applications, which can be chosen by the user using checkboxes.

All of the 4 share the same dependencies, so I created a merge modules package for that purpose. But I still don't know how can I build a single setup to install these 4 applications.

View 5 Replies

Cannot Attach Multiple Pictures In A Single Picturebox

Jun 21, 2010

i am trying to make screen saver in vb.net i m using picturebox and timer (for separation of time), but i cannot attach multiple pictures in a single picturebox.

View 1 Replies

Format Sql To Allow Multiple Rows In A Single Column?

Oct 11, 2011

i have a project and i want to insert multiple rows into a single column and then display them into a single text box...

this is what I'm going for:

DATABASE: column 1
| column 2 | column 3
| column 4 |

[Code]....

yes i know I've posted this in 3 different forums but no one seems to know either

View 2 Replies







Copyrights 2005-15 www.BigResource.com, All rights reserved