VS 2008 Store Global Variables, In My.Settings Or My.Namespace?

Dec 4, 2009

Which is the best way to store global variables, in My.Settings or My.Namespace. The reason I ask is because I need to know certain boolean values if certain forms are open from other forms. At present I am defining Global Boolean variables in My.Application, which give the result I require.

View 3 Replies


ADVERTISEMENT

Declare Store And Access "global" Variables?

Jan 17, 2011

I have an application that I'm writing and I'm trying to declare two variables from my sql server, store the values and pass them to my forms.[code]...

View 5 Replies

VS 2008 - Global Variables?

Apr 4, 2009

I have this little code here in vb 2008, I created a flag var to see if the user has clicked the button "enter" so the flag would be set to true. If its true then the game would begin...

I have a label that says "Press enter to Play", and if the user presses play the flag is true, the label visible is set to false. I have the keydown event to check if the enter button has been pressed, i checked if it works and it does, but the var of the flag is always false in my other subs...

Thats the thing with vb i dont understand is when you make a public variable, and when you change the value of the var in a sub, it doesnt change globally.

CODE:

View 15 Replies

VS 2008 Global Solutions Settings

Sep 1, 2010

I have an issue with globalising my application settings.I have 5 Projects in one solution and I all 5 of my projects use the same connection string to connect to the DB.before I had added any additional projects, I could control this quite easily from the settings designer (Project > Project Properties > Settings) this will work well for one project.How can I share my settings across to all projects, and if the connection string is modified, save it back to the settings file.does VB support settings at the Solution Level?

View 2 Replies

Define Some Global Variables Of A Class - Variables Occupy Memory?

Mar 23, 2012

I define some global variables of a class as follows:

Private Class MyClass
Private var1 as Decimal
Private list1 as List(Of string)[code].....

But I found that after this form is closed, all above variables, var1, list1, list2 still exist in memory. I thought they should be collected by gc since the form is already disposed as I confirmed.

Add: I have monitored half an hour after the form is closed. But these variables are not collected by gc. I have an automatic update procedure on the form which uses above variables.Since the above variables still hold values, the automatic update procedure is always called which causes exception. (One quick fix is to check if form.isDisposed in update procedure. But I do not think this is elegeant. Besides, these variables occupy memory.)

View 2 Replies

Use Variables Or Properties, And Global Or Static Variables In A Class?

Jun 9, 2012

I'm new in .NET programming.I have a class Form1 that includes Button1_Click event.Button1_Click creates a multiple Text Boxies at run time)Here is the class:

Public Class Form1
Dim shiftDown As Integer
Dim counter As Integer

[code].....

View 3 Replies

VS 2008 Store Images In The Variables?

Jun 24, 2010

1. Is it possible to store images in the variables or something like that, then store the images of things that are not buttons, picture boxes or panels?

2. What is the fastest way to store images in Visual Basic?

3. Is it possible to create a list of the class Bitmap and post a picture in each bitmap in a forloop? If it works I would like to see some examplecode.

View 1 Replies

VS 2008 Settings Store A 1-Dimensional Array?

Feb 15, 2010

I'm working on a program that generates random values for a byte array thats length is 16.I have already devised the generation method, but I want to use My.Settings to store this...but I haven't seem to have located Byte() for My.Settings.

View 2 Replies

VS 2008 Store Some Configuration Settings With Time

Mar 20, 2011

I am developing an application, and i need to store some configuration settings, with time, i will need to add some more configuration settings. Am thinking of three alternative to implement that will me easy to access without much coding and efficient sqlite, xml, and application configuration file..But am concerned about security, because some personal data will be saved together.

View 2 Replies

VS 2008 Where To Store Settings For Windows Service

May 13, 2009

I've written a windows service in VB.NET 2.0 and the service needs to know a few file paths and other settings when it starts in order to be able to do what its supposed to do. These are settings that users of my service need to be able to configure themselves so I cant hard code them in.At the moment I just have the service look for a file named Config.INI in the same directory that it is being run from and if this file exists it attempts to read the settings in from there... this works perfectly, but it just feels a bit clunky and old. If it was a normal windows app I would store the settings in an XML file in the user's application data folder or something but as this is a Service then thats not possible as it is not run by any one user (well technically it is, the Local System account). I then thought about using the registry but I seem to recall people saying that you should avoid storing settings in the registry if you can really, especially with the new security in Vista and Server 2008.

View 6 Replies

[2008] Store Comnnection String In My.Settings?

Jan 12, 2009

how to store the connection string to my Access mdb in my project's My.Settings ?

View 4 Replies

C# - Adding A Global Namespace To .net Webbrowser Control

Mar 2, 2010

Scenario:A widget developer codes using HTML and javascript.my vb.net application allows developers to create widgets for other users.in javascript you can call window.external to comunicate with the host windows scripting object and I would like to add a helper namespace with many functions to aid the development of widgets similar to windows sidebar's System namespace.

Problem:So I could allow developers to use Window.External.System but how can I just allow them to access System directly without using Window.External?Microsoft adds a System Namespace to windows sidebar gadgets host window which is just an internet explorer server window.

View 1 Replies

Add Custom Settings To The My.Settings Namespace

Mar 18, 2010

Add custom settings to the My.Settings namespace

View 7 Replies

VB 2008 - Creating A Program That Can Store Numerical Values In Variables

Apr 15, 2010

I'm creating a calculator in visual basic 2008, and with this calculator I want to implement a feature that can store numerical values in a variable for instance x. Similar to the feature used in most graphing calculator that have the button showing: "STO->". I was thinking on using the My.Settings. But I'm having trouble on it.

View 2 Replies

VS 2008 - Store The Connection String In A Settings Table In The Database?

Apr 20, 2010

I am storing my connection string in my app.config file. I am using sql server express 2005. The connection string on my dev machine is different from the ones at the clients. so each time I update I open the config file and edit the connection string setting. This is quite a pain.also I have now published my app to an ftp folder so that the clients can get the updates each time I make changes. saves me the hassle of going to them each time i update. so now i need it to be so that I won't have to change the setting all the time.Would the best way be to store the connection string in a settings table in the database?

View 6 Replies

Using LINQ To XML With Global Namespace - Xmlns Is Added To Each Non-data Element?

Jan 14, 2010

I have to create an xml doc for a vendor who specifically states they must have their xml as follows:

<?xml version="1.0" encoding="utf-16" standalone="yes"?>
<WMWROOT xmlns="http://www.blahblah.com/BLAH/Interface">
<WMWDATA>[code].......

I cannot find a way to get LINQ to spit out xml the way they want. Question is, can LINQ do it or do I need to resort to hardcoding the xml the old way before LINQ to XML?

View 5 Replies

.NET Namespace Regarding Explict (named) Versus Implicit (global Or Root) Namespaces?

Sep 27, 2010

I have a solution that contains many projects all using the same root namespace. No code files explicitly name a namespace. So lets say the root namespace is ExampleRootNamespace.Now a problem comes into play when I want to add an explicitly named namespace to one of the code files I am working on. I want to be able to isolate this code from the rest of the assembly to be able to run FxCop against it. So I add something like Namespace Interfaces.CSV to the code file.

This causes any code that references this assembly to need to say Imports ExampleRootNamespace.Interfaces.CSV. So far so good. I can even run FxCop against the assembly. The problem now is that in other assemblies I cannot say any longer things like:

Public class frmInputBoolean Inherits
ExampleRootNameSpace.frmFormTemplate

Visual Studio is now asking me to rename the namespace to:

Public class frmInputBoolean Inherits
Global.ExampleRootNameSpace.frmFormTemplate

There are hundreds of errors related to this. So my questions are:

1) Why would basically naming a namespace under the root for the first time cause issues with the program?

2) Are there any workarounds to this issue without renaming?

I also want to add that with regards to ExampleRootNamespace.Interfaces.CSV I am not referencing this anywhere in the codebase. I'm currently just referencing it from a unit test project. So I don't see why adding this namespace causes an issue.

View 2 Replies

Adding 1st Explictly Named Namespace To A Project Breaks The Use Of Implicit (i.e. Global) Namespaces?

Sep 27, 2010

I am working on a solution that does not name namespaces in code files. Instead it uses the root name space of the project (which is the same across all assemblies). Basically there is only one implicit namespace.

Well, I am trying to isolate some code so that I can run FxCop against it. I explicated named the code file with a namespace to do this. This works for FxCop, but it bricks the entire solution.Visual Studio is now asking me to prefix all uses of the implicit namespace with Global. So instead of:

[Code]...

View 1 Replies

.net - Creating Global Variables In Asp.net Using C#?

Nov 25, 2009

I was working on window appication previously where i used to create global variables using modules in vb.net, but i found that in C# there is no concept of modules. so how can i create global vaiables in C#

View 9 Replies

.net - Global Variables And DLL Files?

Nov 16, 2009

I want that global variables that sit in some DLL will be seen from other DLLs and EXE of that project.

I included in that VB file "Option Explicit On" as the first line .

But still no one can see my variables that were defined in that file . I made that all DLLs of that project depend to that one with the definition

I am using module and all my variables are public .

Option Explicit On
Module LPSoft_Core
#Region "Public"

[Code].....

View 1 Replies

Declaring Global Variables In Vb?

Sep 29, 2011

The user clicks a button, a new form is generated where the user enters his/her password? How can I keep an in-memory copy of the username?

For instance in web forms, I can just use Session ("User"). How can I replicate this with winforms?

View 3 Replies

Global Variables And Functions

Mar 24, 2010

how can i create global variables and functions within a visual basic project?

View 6 Replies

How To Declare Global Variables

Aug 16, 2010

How I can declare global variables in vb.net that I can access them in all windows of my application?

View 5 Replies

How To Handle Global Variables

Feb 2, 2009

I'm creating an App that requires a few global variables (user information mostly) and I wanted to know the best why to declare these. I would like to create a "global" class with properties for each variable, but the property values reset with every instance of the class. Plus, what is the must excepted way to declare globals, I've heard placing them in their own module is as Globals is not a good practice.

View 7 Replies

Save All Global Variables?

Aug 20, 2009

I've got a RPG style game I am putting together - mostly to teach myself vb.net. I am using alot of global variables to hold game values.[code]...

My question is -- I am trying to make a "SAVE" and "LOAD" the game's state. Is there a simple way to save the values of all my global variables, without having to type everysingle variable out. Is there anyway to call upon all my global variables at one time, and possible save/load them to a text file ?

View 3 Replies

Using And Accessing Global Variables?

Apr 13, 2011

I want my "textbox.text" variable of my main form to be accessible by my other forms. Can somebody please guide me on making that a global variable?

View 12 Replies

Store Three Items In My.Settings / Where Are My.Settings?

Jun 28, 2010

I store three items in My.Settings. One is a serialized string, and the other two are GUIDs. When the main form starts, those three items are loaded into various places. On rare, and so far unpredictable, occasions, one of these GUIDs is notably absent. The others may or may not be, I have yet to be able to check. Since it happens so infrequently (twice this month, though I have been working on the code every day), I'm having a very hard time tracking down the problem. However, it got me wondering where these values are stored. I see one of them showing up in App.Config, though without a value. Is there a place I can see the others?

View 13 Replies

C# - Application Variables Global To Webgarden?

Jan 12, 2010

I am currently trying to program an online drawing program using the HTML5 canvas.the thing is, I need to have the current canvas saved somewhere globally. Static variables work, but they do not get shared across a Webgarden. This results in two different drawings being created.I will have to somehow create a new application object which is shared. I figured I will need an external application holding them.

1) How do I replace the application object with my own?
So either I will have to make my own program and call to it with remoting or use the ASP.NET session state server for application variables. I favor the Session State Server though.

2) How do I use the session state server for my own variables? How do I access it?

I searched high and low on the internet and only found the ideas mentioned above, but no help executing them.

I mainly code in VB.NET, but I can also understand C# code for examples.

A little info on my application:The client side has two canvas objects on top of each other. The top canvas object us used for drawing stuff, the canvas object below it holds the drawing in the end.When something is drawn, it is sent to the server in it's base64 representation. (getDataUri).The server puts this graphic on top of a stored Bitmap object through a Graphics object.

How the changes are being distributed to the other clients, I am working on that right now. Either I transfer the complete picture or each and every change that is submitted. This should work through Server Push. If this does not work thoroughly I will have to save and timestamp changes. A link to the current implementation, which is not currently fetching changes (but they get transfered to the server... With the problem that some reach one instance some reach the other on either w3wp in the webgarden) from the server is here: http:[url].....

View 1 Replies

Calculator - Declaring Global Variables?

May 11, 2009

I need to write a simpe calc. program to add, mutiply, subtract and divide. I want to have two textboxes that I enter numbers in and when I click a button, +,-,/ or * a third text box will display the result.Rather than declaring my variables inside each instance of a click event I would like to declare them globally so I just need to perfom the calculation on them and display result. However declaring them globally doesn't work for me. I;ve tried the variables inside the btnAdd click event which works, but as I said I'd prefer to declare them onece globally.

Public Class Form1
Dim number1 As Double = CDbl(txtNum1.Text)
Dim number2 As Double = CDbl(txtNum2.Text)[code]...

View 1 Replies

Declare Global Value Type Variables With New?

Dec 29, 2009

What happens if I do: Dim x As New Int32? Is a object of int placed on the heap? If it is, maybe your application would be able to access global variables faster if they were reference types.

A global variable as an value type should be somewhere at the bottom of the stack most of the time and it might take more time to get to this then to get a object from the heap. Unless it's the same story with the pointer of this object is also at the bottom of the stack of course.

View 9 Replies







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