Communications :: Accessing A Class Function?

Oct 28, 2008

I am working on this project and this question seems to be stupid, but I am not really getting the point.I have the following class:

Code:
Public Class ConnectedServer
Public MYPORT As String = "8000"

[code].....

View 13 Replies


ADVERTISEMENT

Accessing Function In Alother Class From The Main Form?

Feb 12, 2011

I have a new solution with 5 projects inside. a data access layer, database, 2 class libraries, and the main form. These are all components that I had worked on to get to this point of combining into 1 solution. Now what I have run into is I can not the actual functions in the class libraries. I can get to the class level, but that is it. ere is a sample line of code I need to get working. Once I get this one line, the rest will be obvious: Temperature is on the main form. get for options is "Equals, GetHashCode, GetType", etc... Before this I had bult, compiled, and referenced these classes separately, and it worked fine. I know this is going to be an easy answer, I'm just not seeing it for some reason.

View 15 Replies

.net - Accessing Property Of A Class Without Inherting The Class

Apr 7, 2012

I have a class that has the following property that is generated by the methods in the constructor.

Public Class clsLoadTables
Private _ds As New DataSet
Public Property ds() As DataSet
Get

[CODE]........................

My problem is that I do not want to inherit this class, but I have other classes that need to access the ds DataSet property. If at all possible I would like to not use inheritance and not load my datatable more than once in the program.

Here is my failed attempt to access the property inside another class that is not inheriting clsLoadTables:

[CODE].........................

How I can access this dataset that I want to load only once in the program from many classes without using class inheritance or a global module?

View 3 Replies

Database Accessing An Initiated Class From Another Class?

Oct 9, 2011

I have the following defined in my "Form1":So that I can access all my database functions anywhere in the main form (database connection is initialized via the "private sub new()" function in the DatabaseManager class.The works fine for all queries done in form1, however I have many other classes I'd like to be able to access the database from.Does anyone know how to access the initiated class in my example? Since right now it is initiated in the main form, if I try to access any functions inside any ot

View 4 Replies

Communications :: Use Class As Dll?

Jul 21, 2011

I got a piece of code that I have to use as a class. It gets added to the project every time, the accessed from the code of the forms.

It is for ethernet communication to an industrial radio.

So right now it's a just a class called MK

Question:

Is it possible to compile a class into a DLL which then can be just referenced to each application?

View 1 Replies

Accessing The Shared Function?

Mar 1, 2011

i have a function that i have in my data access class now i want to access it then declare and assign parameters and then insert data into database?

'1
'the function
Public Shared Function InsertNewRecord(ByVal myStoredProcedure As String) As Boolean
Dim conn As New SqlConnection

[code]....

View 4 Replies

Accessing Value Returned From Function?

Feb 22, 2010

I'm new to VB.NET and want to parameterise the SQL Connection Strings in my VB.NET App. I've added a function to my Main Form to retrieve the App.config File like:

Imports System.Configuration
Imports System.Configuration.ConfigurationSettings
Public Class MainMenu [code]....

In my other forms when i want to reference the Connection String, i get an error saying getConnStr is not declared?

Private Sub UpdDept_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
Try
myconnection = New SqlConnection(getConnStr()) <=============
Dim mycommand As New SqlCommand()

why i get this when i've declared the Function as Public?

View 1 Replies

Accessing A User Defined Function Or Sub?

Sep 10, 2009

I'm a new user of VB.Net. I do have doubt on accessing a user defined Function or Sub. In some place of program, I do see the term "Call" when using the Function/Sub. In some other place without "Call". But both works perfectly. May I know the difference between the two.

[Code]...

View 9 Replies

Accessing Global Function / Values?

Jun 1, 2009

m using a public variable called globalquery & a global function retriveToDataGrid() it works perfectly fine under same class /form ..... but when i try to access it from a different form , it gives no error and nothing happens

Public Sub retriveDataToDataGrid()
Try
Dim connStr As String = "Database=shahopticals;" & _
"Data Source=localhost;" & _

[code]....

View 16 Replies

Accessing Certain Functions In Class

May 9, 2010

I am currently trying to write classes so that I can access certain functions from any form within my VB project.

My class is defined thus:-
Public Class testclass
Public Function showmes()
MsgBox("Hello everyone"")
Return 0
End Function
End Class

I have added the class into my form using this at the top in the form:
Imports WindowsApplication1.testclass
Obviously, WindowsApplication1 being the name of my project, testclass being within a VB file, saved with my project.

I have attempted to call the function from the form using this:
Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button3.Click
showmes()
End Sub

However I am getting the error "Reference to a non-shared member requires an object reference." I don't understand why there is a problem, since I have used imports to reference the class.

View 6 Replies

Accessing Control Attributes From Static Function?

Sep 16, 2010

Here's what I've got:

<textarea id="TextArea1" rows="6" cols="20" runat="server"></textarea>
and in the code-behind:
partial class _Default : System.Web.UI.Page

[code]....

View 4 Replies

Accessing Cursor Data Returned By PL/SQL Function?

Jul 16, 2009

I am calling an Oracle function PKGDummy.F_EMPDATA using vb.net.

View 1 Replies

Accessing Public Shared Function From Another Form

Mar 1, 2011

[Code]...

i have a function that i have in my data access class now i want to access it then declare and assign parameters and then insert data into database.

View 4 Replies

.net - Accessing Class Properties In Xaml?

Feb 18, 2010

I've currently created the class below. For some reason though I can't access the properties I've created through my xaml style.

Public Class Ribbon : Inherits Button
Private mpopDropdown As Popup
Public Property Dropdown() As Popup

[Code].....

but they don't seem to expose the property either. I've also tagged the property as <Bindable(True)> but that didn't seem to do anything.

View 2 Replies

Accessing And Using Array In Class Module

Mar 1, 2010

Any some simple examples of how arrays can be put in a Class Module? The examples should show how the array is used and accessed in a form.

View 3 Replies

Accessing Arrays In A Class Via Properties?

Apr 8, 2010

Is it possible for one class to access an array of values within another class as a readonly property of the second class? All of the examples and references on class properties imply that one can only retrieve one value by calling a class' property.

View 2 Replies

Accessing Instance Of A Class Through A Variable?

Nov 12, 2010

i have

VariableA as Class1
Variable1 as string
Variable1 = "VariableA"

I want to be able to use Variable1 to get access to VariableA(?).

So i want to able to do something like

VariableA.Property1 = "test"
But like this:
Variable1.Property1 = "test"

View 5 Replies

Accessing Textbox Input In A Class?

Feb 20, 2012

I am new to VB and am having a little trouble with my class assignment. Basically it is supposed to take an invoice subtotal - find the discount percent and give the real total. I cant seem to get my class to access the textbox for user input and it just keeps returning 0's. This is a homework assignment as well... im not asking for the answer just some tips because i am truly at a loss and cannot figure this out

This is my code from the button click event:

[Code]...

View 1 Replies

Accessing Two Dimensional Arrays Within A Class?

Aug 30, 2011

Ive currently got this:

Public Class World
Dim StringA() As String
Property SetString() As String()
Get

[code]....

I need StringA to be a Two-Dimensional Array. I've played around with it and was unable to figure it out..

View 6 Replies

Asp.net - Accessing Httpcontext In Shared Function Thread Safe?

Jan 5, 2012

Im having a problem understanding if accessing httpcontext inside a shared function, without passing in the httpcontext as a parameter is thread safe?

Are the 2 functions in the util class equally thread safe?

Class foo
Sub main()
Dim qs1 = util.getQS(HttpContext.Current)

[Code]....

View 2 Replies

VS 2008 - How To Write Wrapper DLL For Accessing Function Calls

Jul 27, 2011

I have a camera for which the complete source code with header files(.h) and all libraries files(.lib) are given in VC++. Now if I want to access the function calls in the header files and in turn the functions in the library from VB.NET, I am required to write a wrapper DLL for accessing the function calls which I never did till now.

View 1 Replies

.net - Accessing A Public Class From Global.asax?

Aug 5, 2011

I would love to implement the asp.net routing but i have a basic question.

In my Generic handler i have the following Global class

Public Class MyHandlerRouteHandler : Implements IRouteHandler
Public Function GetHttpHandler(requestContext As System.Web.Routing.RequestContext) As System.Web.IHttpHandler Implements

[Code].....

View 1 Replies

.net - Accessing A TextBox Control From Another Class/thread?

Apr 16, 2011

im trying to access a richtextbox from another class and thread then the ui and i cant seem to get it working. I currently have the sub thats handling the the work inside of a public class and its a sharedsub, im going to be calling it from several different classes and threads but again i cant seem to get it working. the code looks like this. Public Class SharedSubs

[code]...

i would be calling sub using SharedSubs.Console("stringstring") when this is called from the ui thread it works fine but when its called from anyother thread or class its does nothing,ive confirmed it going thru this code but its not displaying anything in the textbox and its not thru an exception due to delegates either which i figured it would.

View 2 Replies

Accessing A Class Persisted On A Hard Disk

May 30, 2009

once a class has been persisted on an hard disk with a strem is it neccessary to load the full class to deal with one part of it or is it possible to get just the part of the class i am interested in?

View 2 Replies

Accessing A Public Shared Variable From A Different Class?

Jan 10, 2012

I currently have two forms, and I need to share the value of a variable in one of them.

I declared the variable to be 'Public Shared', and assigned a value to it. However,

when I inspect the value it appears as 'Nothing'. Here is the snippet:

Public Class A
Public Shared sVar As String = Nothing
Private Sub A_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load

[Code]....

View 4 Replies

Accessing Class Obect From Another Form Within A Project?

Jul 22, 2009

I have created a project, and with form3, created a class for datagridview called MyDtGrd.nd when I created a form4 I used that same MyDtGrd. When I used before to publish the program no problem.But after publishing When I tried to make changes, giving error like"The variable MyDtGrd is either undeclared or was never assigned"Is there any technique to access the same class oject to use in other forms?

View 1 Replies

Accessing Public Class Variables In Asp.net Without Session?

Feb 15, 2012

I am using this example I found to learn how to load class files and access variables through them. This is in a file called Class1.vb in the App_Code folder (this is not an app project):

Imports Microsoft.VisualBasic
Public Class my_class
Public Shared Sub my_sub()

[Code]....

How could I access the vartest variable without using a session, since if this is accessed by multiple functions at the same time the variable can be overwritten I assume. Is it possible to go the other way, where a variable is sent to a class file?

View 4 Replies

Accessing Variables In Partial Public Class?

Apr 10, 2009

I am currently working on a project of "interpreting" C# into VB. The project involves adding images to a database, retrieving images from the database and presenting them in thumbnails. Right now I have the following Public Class with the Variable that needs to be assigned:

VB:
Imports System.Data
Imports System.Drawing
Imports System.IO

[code]....

View 6 Replies

C# Accessing Properties Of An Object From A Collection Class?

Jun 10, 2009

I am moving from VB to C#. I am trying to loop through a collection class which is a collection of data classes but I can't seem to get the actual values out of the data class properties(find the correct code to do so). I have a method that loops through the collection class(Contacts) and saves each record(Contact). I am using reflection because my method will not know if it is Contacts class or a Customer class and so forth. Here is my code in VB(watered down)

Public Function SaveCollection(ByVal objCollection as Object, ByVal TableName as string, ByVal spSave as string)
Dim objClass as Object

[Code]....

The C# code keeps returning null. In my locals window I can see the proprties on the class on objClass and the value of the propery but I can seem to figure out how to access it through code. I used the DictionaryBase because that seems to closely match would I need to do. My data class(Contact) has a bunch or properties that match the field names in the database of the Contact Table. After I get the propInfo variable set I then set up my SQLParameter with the fieldname, datatype etc and then set the value to the propInfo.value.

View 5 Replies

Multithreading Accessing A Dataset From Within A Threaded Class Instance?

Nov 1, 2011

I was using the following code within a class and creating an instance of that class from within my main form (Main.vb):Dim count As Integer = Main.DbDataSet.Accounts.CountThis was returning the count of accounts within my database.After changing the code so that I could run this in a background thread to save locking up the program, as more data is processed after this point, the count was returning 0 each time.

View 1 Replies







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