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


ADVERTISEMENT

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 Variables From A Public Shared Subroutine?

Feb 15, 2009

I have created a public shared subroutine in a class file in asp.net 2 (vb.net) web site app_folder.The subroutine retrives some values from a sql database via an sql query and assigns the datareader field values to several variables The problem is I can't seem to assign the variables from the subroutine to the variables and textbox controls in the asp.net page I am calling the subroutine from. The textbox text value just appear blank.By the way, if I response.write the variables in the subroutine they appear populated by the sql data reader.

View 9 Replies

Difference Between Public Sub And Private Sub And Private Function And Public Function And Sub And Shared Function?

May 31, 2011

explain me the difference between them? I'm new to visual basic, and I need to know the very basic things in Visual Basic allowing me to become a professional User

View 8 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

Public Shared Function Continued?

Aug 6, 2009

I made the changes from this:

[code]...

to this:(the 'End Function' says "Function 'GetFolderPath' doesn't return a value on all code paths. A null reference exception could occur at run time when the result is used."

[code]...

View 4 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

Release Public Shared Variable After Form Close?

Mar 4, 2010

shared variables of particular form in vb.net 2005

View 1 Replies

Argument Not Specified For Parameter 'test' Of 'Public Shared Function TestThis(test As String)'?

Sep 25, 2010

I don't understand the error, Argument not specified for parameter 'test' of 'Public Shared Function TestThis(test As String)'.

Partial Public Class Form1
Shared Sub ReceiveCallback(ByVal ar As IAsyncResult)
Form1.Invoke(TestThis, New Object(){"test"}) 'error

[code].....

View 6 Replies

Asp.net - Access A Module Or A Public Class With Public Shared Members From Inline Vb Code <% .. %>?

Feb 10, 2011

I can access a module from code behind but not from the aspx page in inline VB code <% ... %>.

View 2 Replies

.net - Why Can't Call Private Shared Methods From A Public Shared Method

Aug 25, 2011

I have a class like this:

[Code]...

It works, when I make getBar methods public, but I don't want to expose these unneccessarily. Why I can't call private shared methods from a public one in the same class is over my head. I'm using .net framework 4.0 in a web application.

View 1 Replies

Public Shared Function(folder In 'Dim Folder As Nvironment?

Aug 6, 2009

if you could see everthing but the thing I'm having trouble with the Public Shared Function(folder in 'Dim folder As nvironment.SpecialFolder' is the problem)

Option Explicit On
Option Strict On
Imports System.IO

[code].....

View 5 Replies

Asp.net - Public Shared Variable Shared Between Users?

Mar 30, 2012

I've taken over the maintenance of the website (ASP.NET VB) and on one particular page I noticed the below code

Inherits System.Web.UI.Page
Public Shared UserNumber As String
Private Sub Page_Init(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Init

[Code]....

My question is whether the variable UserNumber can be accessed or changed by any other user than the current one?

View 2 Replies

[Public Sub / Public Function] Equals [Sub / Function] Declaring A Function Or Sub?

Jun 12, 2011

I want to know what implies to declare a function or a sub using public or directly Sub / Function i.e.:

Public Function Whatever()
' Process
End Function

versus.

Function Whatever()
' Process
End Function

View 4 Replies

Public Function With Form Scope?

May 17, 2012

I have a Function for checking the input in a textbox and only allowing Numeric & Backspace; everything works fine so far. My form is for financials and it has about 20 textboxes; they all receive Numeric only data; there is NO alpha data on the entire form required. Note in the snippet below that I don't even need a decimal point as well.

Is there a way to handle ALL textboxes on this form without having to place the Function call in each textbox KeyPress event. took a long (5 year) hiatus from developing VB6

Public Function TrapKey(ByVal KCode As String) As Boolean
If (KCode >= 48 And KCode <= 57) Or KCode = 8 Then
TrapKey = False

[Code].....

View 5 Replies

How To Call Public Function Of Owner Form

May 18, 2010

Just had a small doubt.Say i use something like this

vb Dim ownr as New Form1Dim Dlg as New Form2ownr.Showdlg.showdialog(ownr)

how should i call an public function of form1 in the form2 if form1 is owner of form2, and also if form1 is not the owner of form2 should i use FormName.FunctionName in both the cases.

View 3 Replies

IDE :: How To Calling Form Object Public Function From A Module

Apr 5, 2010

I am using VB2008 In the Form1, i have coded

Public Function getText(ByRef ctlName As String) As String

getText = Mfg.get_TextMatrix(Mfg.Row,Mfg.Col

[Code]...

View 5 Replies

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

MDIParent - How To Call Public Function Inside Child Form

Jun 26, 2011

I am having a toolstrip in the mdi form which contains save, update delete and clear buttons. The child form is having save, update, delete and clear as public sub routines , and client form will not have any standard buttons, I will click the respective button in the parent tool window which should call the child forms function.

View 1 Replies

Make A Shared Function For Form Load In A Separate Class File?

Jan 9, 2012

i would like to have a shared function in a separate class file to address the form location . but i dont know how can i get this to work. if i use this below code in my form its working . but i cannot move this to a class file.

Shared Sub Formlocation()
Me.StartPosition = FormStartPosition.Manual
Me.Location = Screen.GetWorkingArea(Me).Location
End Sub

View 2 Replies

Public Shared Variable Ref?

Jun 29, 2011

I have an arraylist in a user form (Mainform) that I would like to be able to share among multiple forms and edit the contents. Using the Public Shared method I have been able to view and even edit the arraylist, but it does not seem to be changing it back on the main form. I can give more detail if needed.

View 9 Replies

Public Shared MyVariable As String?

Jun 21, 2011

Say I have an ASP solution with a Globals.vb file. Inside that file, I have this: Public Shared MyVariable As String Now say I publish this solution and make it available to Bob and Cindy.If Cindy sets (through the interface) MyVariable to 5, would Bob be able to read it? I hope not, I'm hoping this variable would be user-specific.

View 2 Replies

Public Shared SqlConnection - Used In Multiple Functions

Jan 29, 2010

I have an asp.net web app. It has a shared class, and I want to have the connection string the same through out the site. My string is in my web config, but I don't want to type this all over the place:

View 3 Replies

Difference Between A Private, Public, Shared Functions/Sub/Variables?

Jul 22, 2009

give me a good resource that explains the difference between a Private, Public, Shared Functions/Sub/Variables? I normally use Public for Subs/Functions inside of Modules I call from other parts of the program. But I'd like to get more of an understanding of how and when to use them. I want as little as impact to a system that is running my programs as possible, so i guess the key here is I'm trying to just get more proficient in my coding.

View 8 Replies

Override A Public Shared Method In Derived Class?

Oct 8, 2010

Can we override a Public Shared method in derived class? If not why?

View 2 Replies

Passing Parameters By Reference Into Public Shared Methods

Oct 21, 2009

I have a List(Of AddlInfo) with AddlInfo being an object. I'm trying to pass addlInfoList by reference into a function of another class:

[Code]...

This works if I'm not passing the reference into another class, but when I try to do this, I get the following error: Overload resolution failed because no accessible 'Sort' can be called with these arguments:

[Code]...

View 1 Replies

Too Many Arguments For Public Shared Create Auto-CompleteItem?

Mar 1, 2012

I didn't write the function for the AutoCompleteExtender so I am not quite sure how to change it without screwing it up, so I figured I would ask here. Recently, it was requested that the AutoComplete show a product name & the date of launch of that specific product. I do not know how to add the date to the AutoComplete.

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

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







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