How To Use Common Variables

Jan 12, 2012

I am new to .net and I usually had a common file which was having information of username,server,password,IPS and fixed integers in php and asp classic which i used to include in all files so that i could use them in any page. Since I have come to know that .net has no include function. how i can do it in asp.net?

View 3 Replies


ADVERTISEMENT

VS 2008 - Take A String Of Variables With A Common Delimiter And Break It All Back Out Into Separate Variables

Dec 11, 2011

Last year (2010) I came across a FANTASTIC command that allowed me to take a string of variables with a common delimiter and break it all back out into separate variables (possibly an array) with one statement.

[Code]...

As long as the delimiter was a unique specifiable character, this one-statement command could break it out into elements. my memory and point me in the right direction.

View 2 Replies

Passing Multiple Byref Variables / Variables Fail To Change Calling Funct W/ Invoke

Sep 27, 2010

I have code, shown below, that works all except for 1 thing: The variables being passed byRef get passed, but once modified in the else section of the "if me.invokerequired" code of RecordData, the variables are never updated in the calling function. To reiterate, the calling function does not receive the updated data that is in the variables custid and amt.When debugging, I see the data change in the else section of "if me.invokerequired", but once it returns from the callback the data is missing.[code]

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

Memory Used In Declaring Variables Are Reclaimed By The OS When These Variables Go Out Of Scope?

Jan 7, 2010

Does the memory used in declaring variables are reclaimed by the OS when these variables go out of scope?Does the memory used be released by setting thier value to nothing? if not, then how can I force the garbage collector to run or excecute at a certain/desired time..How about in Windows Forms..How can we make sure that the memory used in initializing and showing forms be released if those forms were closed?

View 13 Replies

Multithreading: Reading/setting Variables, And Passing Variables?

Mar 8, 2011

Question 1: What is the difference between "Background Worker" and "Worker Pool" as indicated within the MSDN samples provided.

Question 2: I noticed while using, AddressOf _Function_, variables cannot be passed; what would be an efficient solution to this?

Question 3: While using multithreading is it required to invoke before setting variables, or only form properties?

Question 4: While using System.Net.Sockets is it safe/efficient to use Application.DoEvents while waiting for new data; or would be using a Do While loop be fine without DoEvents since the action would be multithreaded? Note: there can be up to 2000-3000 sockets in use at a time.

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

Add Some Common Details In More Than Two Tables

Oct 27, 2010

I need to add some common details in more than two tables. [code]So i have stored the Department (from drop down list box) and assigned it to Dept.So i guess dept would have Csc if i choose csc and commerce if i hoose commerce.When I checked with breakpoint it s workin. Datas are added perfectly. But they are not visible in that respective table

View 2 Replies

Common .vb File For All Projects?

Apr 17, 2011

In the old VB, there is a .bas file wherein i place all the global constants there and whenever i create a new project i just include that .bas file so that all the constants i placed are automatically added to my project. Is there any way to do this on VS2008? Ill be doing dozens of Class Libraries that that needs to reference global constants.

1. Is there any other way of referencing the global constants rather than making it a shared variable in a class?

2. Also, is there a way to include a .VB file without the copying it on the local project file? My point being is that this .VB file is also being used by other Class LIbraries that i created.

View 4 Replies

Common Event For Like Controls?

Aug 28, 2011

Is it possible to set up a common event handler for a group of like controls like buttons or text boxes so a single event handler is called regardless of which of the controls is clicked, changed, etc.In my PrinterDialog study project I have 5 text boxes named TB1, TB2, TB3, TB4 and TB5 in a text box array called TBs so they can be accessed with TBs(0), TBs(1), etc.My question is if I can set up a single click event that responds when any of the 5 text boxes are clicked to avoid duplicate code n 5 different click events.

View 1 Replies

Dbtype Of Common Dbparameter

Aug 9, 2009

if i miss to set dbtype of my parameters (common.dbparameter) it works fine again?Is necessary to explain dbtype or not?

View 1 Replies

Get Common Images For Buttons?

May 25, 2009

I know it is not vb question but I was wondering if there is any place to get the common images for buttons (like save, clear, find, new , delete etc...)

View 2 Replies

Get The Data 'less Common As Possible' From A Collection?

May 15, 2011

Starting from a table like this:

| Code | Year |
---------------
| A01 | 2001 |
| A01 | 2002 |
| B01 | 2002 |
| C01 | 2003 |

I have to arrive to this:

| Code | Year |
---------------
| A01 | 2001 |
| B01 | 2002 |
| C01 | 2003 |

I have to group the first column (Code) and from the second (Year) I have to get the data 'less common as possible' compared to all the other records. I try to explain this with the example: for the code 'A01' I have 2 years: '2001' and '2002'. I have to take '2001' because it's the one that not recurs in the other records. In the case that there aren't available values 'Year' that not recurs in the other records, it's good to take whatever value.

The data are in the form of array in memory and to interact with them I'm useng some LINQ queries.

View 4 Replies

Getting Three Most Common Numbers From File?

Feb 16, 2010

Essentially, whenever my users who are logged in via a global module level variable enter a new form, their activity is "logged" in a textfile with their UserID as the name.txt and every time they visit a page it adds a new line to their log file with a number corresponding to the form they visited. For example, if they select "add a user" it will add the line "1" to their log file. Note: At the moment there is only 1 2 and 3 not 0.

I have got this far and I have got as far as creating an array which has:
Array(0) = NumberOfTimes 0 appears in the log file
Array(1) = NumberOfTimes 1 appears in the log file
etc etc

Therefore the output for this is
Msgbox(Array(0)) shows "0"
MsgBox(Array(1)) shows "4" for example and lets just say
MsgBox(Array(2)) shows "9" and
MsgBox(Array(3)) shows "1"

Therefore, finally (!) my problem is now finding which 3 are the top. I have tried various methods of sorting them but I just get "9, 4, 1, 0" rather than "2, 1, 3, 0". (By the way the end product for this is to show three links on the "welcome form" of the users 3 most visited forms). Here is a pastebin of all the rubbish I have currently tried that hasn't worked! [URL]

View 1 Replies

List Of Most Common Errors?

Nov 2, 2009

When I was learning QBasic I found a list of most common errors and it told me whether my errors were syntax errors or logic errors. Where I can find a similar list for VB 2008 Express Edition?

View 7 Replies

One Common Navigation For All Forms?

Feb 15, 2012

i made an application using VB.NET 2010. i have 5 forms. i want to know how to make one common navigation (like in a webpage) for this application. Is it possible to have the menu and header static and loads each form in one dynamic container. I hope my questing is clear :P just to make it more cleared, it is more like having a templates in php coding where we can load other page in a particular area without having to reload the entire page with each links.

View 2 Replies

Use A Common _ViewStart In Areas?

Nov 5, 2010

In my "root" Views folder, I have a _ViewStart with the following code:

@Code
Layout = "~/Views/Shared/_Layout.vbhtml"
End COde

[code].....

View 3 Replies

And And If Statements - Only Get UltraRare Or Uncommon Or Common

Mar 27, 2012

What I am doing wrong with these And and If statements.

Sub SetRarity()

Dim Subtotal As String
Dim Total As String

[CODE]...

My question is what am I doing wrong I can only get UltraRare or Uncommon or common.

View 2 Replies

Change Common Dialog Box In Vista/7?

Nov 2, 2009

I am looking for a way to modify the default values in windows vista and or 7.

Examples:

* The default directory for the save/save-as dialog box.
* The size of the window.
* The "favorites" list on the left of the box.

I have been looking for a while and the only thing I can find is to edit the group policy but this will only affect programs that are using the xp dialog box.I am sure this is actualy pretty easy but I cannot find anything for the life of me

View 2 Replies

Combining Processes But Using A Common Module In .NET?

Nov 2, 2010

Here is a complicated, but possibly dumb question concerning adding projects together in the IDE in order to increase performance and share memory at the same time.I have written two distinct exe's. The first exe (file processsor) operates using three timers to perform communication between a hardware OEM proprietary ComServer and file output from the second exe. The second exe (work generator) simply outputs files on hard disk so that the "file processor" can process the commands in the order given. The first exe was written as a "background processor" to the second exe in a stand-alone fashion. There is a need to communicate data between the first and second exe that is time sensitive. The ComServer called by the "file processor" only allows one port to for communication to the hardware device that is a USB. The "file processor" is capable of extracting the data required but the existing technologies, such as RPC, IPC are too slow and or full of pitfalls. Microsoft's Memory Manger has found it easier to create multiple instances of the proprietary ComServer and assign the needed memory to the calling routine so that it can "scoot" memory easily in the garbage collection feature of the operating system. What this does is cause the mullitple instances that are created to "gang up" on the device either slowing its performance down, or causing time outs. [The second process is a custom 3-D graphical CAD/CAM. The first process is a machine interface. Although hind-sight is 20-20, it seemed more ideal to write this background or file processor independantly, as then it could communicate with existing as well as a custom CAD/CAMs.]

Simply writing the first processes' code into the second slows down the second process as a result of all the timer interrupts looking for work to do. (Mouse is squirrely, screen refresh is slow, etc.) I am only guessing here that the operating system's service of the more complicated single memory location is somehow interrupted more frequently for a larger project, than two smaller independant projects running seperately. I only know what I observer here. Interestingly, the two smaller projects running seperately seem to run fine.

Now for the dumb question. Is it possible to merge the "file processor" with the "work generator" in the IDE such that each process runs as independantly as two distinct apps, but at the same time, make it possible to share memory via one Module1.vb? So far, I cannot find a way for the "file processor" to see the "work generator's" Module1.vb, regardless of how many PUBLIC statements I issue in the code. In other words, what would be the steps after File->Add-> Existing Project to cause the "file processor" project with a form to start first, then drop to the background, followed by launching of the "work generator" second where each process shares the same Module1.vb?.

If this could be done, say through a compiler statement, or whatever; then this could make the Memory Manger folks happy, and provide for the speed required to operate real world processes? Basic computer science suggests a simple processor LD instruction could make data available to any application within a few clock ticks. Microsoft now longer allows direct memory access, or the ability to carve out a "stay resident" dll in memory where a memory location can be called for quick distribution information to all apps with just one call to a device.

View 5 Replies

Common Instance Between Multiple Project ?

Jun 28, 2011

There are 3 project in vb.net MAIN PROJECT, BLL(Business Logic Layer), DAL(Data Access Layer) now we are trying to maintain one single instance of some values through out the assembly or what we can called single instance should get used in all projects...for example there is a class called clsParameter we need only one instance of this class should get used through out all projects so if i made any change in MAIN PROJECT same values also get updated in BLL or BLL should receive same values....

View 3 Replies

Common Validator Module For Textbox?

Mar 19, 2011

I have started developing in vb.net 2008. I want to make a common module to validate all text boxes of my every win form. Common Validation I'm looking for are Length ( Size ) of text box value must not greater then that of field size, It must be of numeric, or alpha only, It must not be empty, if single quotation mark, covered with double quote mark etc.

View 5 Replies

DirectCast / CType Are Common Function?

Oct 12, 2009

Does DirectCast, ctype, etc., are common function? Why it return type, and how do I used it? Is there others function where I need learn to be dot net expert?

View 3 Replies

Error Calculating Common Denominators?

Nov 20, 2010

This code gives a result of 1 for all numbers and i don't know why. phi(n) for any n in this code give me 1.Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click

Dim n As Integer
n = CStr(TextBox1.Text)
Dim phi As Integer

[code].....

View 5 Replies

Find The Common Parts Of Lists?

Jan 27, 2011

Suppose I have two list

list1: {1,2,3,5}
list2: {1,2,2,3,3,4}

I want to get the result list3: {1,2,2,3,3,4,5}

notice the final result contains the common parts between two lists.

View 6 Replies

Implement Common Method To Forms?

Feb 8, 2011

I'd like to implement a common method on most of the forms, but not all.Let's call the method 'FormCleaner'.

I'd like to recursively call each forms FormCleaner method and ignore cases where the form has no such method.[code]...

View 2 Replies

Import Common Block To Program?

Apr 18, 2009

I'm writting a dll in Fortran. I've included some common blocks in the fortran code. And I don't khow how to import it to Visual Basic.

View 2 Replies

Microsoft Windows Common Controls 5.0?

Mar 3, 2011

in: Project->Add Reference

i not have: "Microsoft Windows common Controls 5.0"

What i can do?

View 5 Replies

Same Program Sharing Common Datafiles?

Dec 15, 2011

I'm back to working on my program and need a little advice. I have this program on two computers and I want to set it up to access the same set of datafiles. I want the program to tell it's counterpart on the other computer that it has a certain file open so the other program will not allow that person to access the opened file. The data files are all text files. Without using SQL or outside apps, can this be done thru vb.net?

View 11 Replies

Textblock TextBox Common Interface?

Mar 5, 2010

what is the common interface between textblock and textbox when it comes to dela with text stuf?

What I want to do is to create a procedure that accept a textbox or a textblock and change fonts stuff is there a common interface for them that dela with font stuff??

View 13 Replies







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