how to write classes. I have been searching and I understand classes a little. What I am confused on is how to write a class that contains more than 1 bit of information. How would I write a class that contains someone First Name, Last Name, Age, Address, City and State they live in. For instance all the information in the class can be retreived if I enter the person last name. And the class has to have more than 1 person infomation in it.
Lets say I wanna write a string "Hello World" into a MemoryStream and read this string to MessageBox.Show() without using Helper objects such as BinaryWriter and BinaryReader and StreamWriter and StreamReader etc.
how to accomplish this with low-level functions of MemoryStream stream object.
Can i write 2 classes for one Script Task editor in SSIS(2008). I tried to access the global variable like below. I created 2 classes and it doesn't show any compile error, but i couldn't access the global variable in class2 which was assigned as 2 in class, ScriptMain.
I just joined the forum and I saw that it's really helpful to a lot of people, so I thought I would get some .So basically, I'm trying to write a constructor so it can "speak" to other classes. For instance, I have two classes: Teacher and Studen
[Code]...
As you can see from above, Student Inherits Teachers. This is similar to what my professor assigned the class to do, but on a bigger scale. So, I just want to the program to loop, adding text to the array. So, I would have one array with 10 "spots." I'm not sure if I'm making sense or not. But our assignment is to create Employees and each employee is either Hourly, Salary or Commission. The Hourly, Salary and Commission are all classes, and there is an Employee class. The Employee class enters in and saves all the information, but I can't get the Hourly class to save anything.
I have two classes, one nested in the other. [code]Neither "Name" or "ID" are unique between operations and records.I wish to construct a dictionary using LINQ = Dictionary(Of String, Of List(Of Integer), whereby the keys are uniqe examples of Names in my collection and the values are the collective set of distinct IDs that are associated with those names.
How can I structure my classes so that the user interfaces though a single class while the supporting classes are hidden from their view? I think its best understood in an example:
Public Class MyInterface Public Economic as EconomicClass Public Sub New() MyBase.New()
[code].....
So you might ask why am I even separating them? It's strictly for others who will be working with this interface. I need to funnel them though a logical structure:
This way everything is already handled for them in the background and they only need to run the method they need. I don't know if I can have it both ways in VB.NET.
code For Each item As Reflection.FieldInfo In GetType(NameSpace.ClassWithNestedClasses).GetFields rtfAppend(item.Name & ":" & Tab & item.GetValue(Me)) Next For Each item As Reflection.PropertyInfo In GetType(NameSpace.ClassWithNestedClasses).GetProperties()
[code]...
which gets me the simple string vars and properties of my top class, but how can i apply this to loop through all sub classes and get there vars and props?
Searching the internet finds no less than 700 different ways and opinions to accomplish what I'm trying to do, and I would just like to know the simplest, most bullet-proof way possible.
[Code]...
I simply want to extract the string "bar," which is inside <hostName></hostName>I can do this easily enough with simple string functions, but I'd like to do it with one of the .NET XML classes/methods.
I have a trouble making this code work. When executed, it just creates a correct (with the correct name) file with the extension .txt but the the actual text inside .
Imports System.IO Public Class Form1
Public mytext As String
[code]...
The strange thing is that while debugging, h, t string variables have the correct values, but somehow mystream.write(t) doesnt work (it doesent write anything to my h.txt text file...
Ok i saw this guy on youtube that made a achievement generator for his computer. For example, he goes to notepad and write something and saves it and gets the xbox 360 achievement pop up saying "Gotta write this down" and all that. Cud this have been coded thru VB.NET or something?
i have a notification j-query plugin .. i taste it in my page (working 100%)but when i want to use it in a event SqlDataSource1_Deleted with the response.write method it does not work
Protected Sub SqlDataSource1_Deleted(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.SqlDataSourceStatusEventArgs) Handles SqlDataSource1.Deleted Response.Write("<script type='text/javascript'> showNotification({message: 'This is a
I find that I write a lot of code within my classes to keep properties in sync with each other. I've read about Events in Classes, but have not been able to wrap my head around how to make them work for what I'm looking for.For example, in this one I always want to keep myColor up to date with any change whatsoever in any or all of the Red, Green or Blue properties.
Class myColors Private Property Red As Byte Private Property Green As Byte
[code]....
If one or more of those changes, I want myColor to be updated. Easy enough as above, but is there a way to work with events that would automatically do this so I don't have to put myColor = Color.FromArgb(Red, Green, Blue) in every sub routine?
How can I create a namespace and classes in it, then save it, and reuse the namespace in other projects? Do I have to click on Create Class Library in Visual Studio?
I am new to .net and was wondering if there are any projects which have sets of vb.net classes online which i can use. For example we have Flourish — PHP Unframework which has lots of php classes therefore a programmer doesn't not to replicate code on each project. Is there a asp.net (vb) resource website or any open source project which has built in vb.net functions.
I have a slew of sub routines that I need to use in my software because each website that I will be accessing don't all use the same methods.....go here...click that...go here...click that...etc etc
So I've divided them into sub routines and call them when I need them but the coding is getting so long that it's becoming confusing to keep up with each sub.
Is it possible to place the sub routines into an independent file like a class and then call them from the file when I need them so I can free up some space to code?
The 1st part of the code required me to write a class definition for a class(Worker). The class should include Private variables and Property procedures for a worker object's name and salary.
The salary may contain a decimal place. The class should also contain two constructors:a default and a parameterized.
The second part for the code indicates that I need add a method named GetNewSalary to the Worker class.The method should calculate a Worker objects new salary, which is based on a raise percentage provided by the application using the object.
Before calculating the new salary, the method should verify that the raise percentage is greater than or equal to zero. If the raise percentage is less than zero the method should assign the number zero as the new salary
There are three text boxes which allows the user to enter the employees name current salary and raise percentage....the calculate button will display the new salary in the new salary label box...so far here is what I have for the worker class.
The Class for the code had to be written from scratch. Can you please look over the class code and see if I need to chang anything....that will allow the program to run.[code...]
I am trying to get to grips with Classes and how to use them "efficiently", So bearing this in mind I decided to create a small class driven application.I am struggling to understand how I can "use" this new instance of this user somewhere else.
Test Data was Name : Joe username : JoeBloggs Password : JoesPassword
[code].....
Now this works and updates the listbox with the new instance of the user but how can I use that instance from the listBox control to retrieve that users details?
IDE: VS2010 Framework.net: 4.0 I created a c# dll project under Visual Studio 2010, with several public classes, and I would like to use its classes inside another dll project, but written in vb.net.
In the vb.net dll project, I referenced the built c# dll, but impossible to import the c# classes. The namespace of the c# dll is even not recognized.
What must I do to see my c# classes? If this is possible.
I've often wondered why would you need to make your own classes in vb.net? What purpose can they serve a typical application that cannot be already down without creating them?
I am trying to do is get interoperability between my "mainwindow" and a class. As far as I know the way to do this is to create an instance of the class (in "mainwindow") for example and then use that instance to call the functions etc... This works. However I want to allow the class to call functions in the "mainwindow" The moment I declare the instance on the class as well it goes into an endless loop.
i have always just bundled code into my main form. I am trying to tidy this up now and start using classes. But when should you use a class?For example. Say we have a function thats called by a button.
[code]...
this is more clutter to the main form, so would i add this to a class? or am i going about this all wrong?If the answer is yes. Then im not quite sure how you call a class function.How would i have this function in a class and be able to call it from formMain?