VS 2010 - Storing Data In Some Type Of Variable

Jan 19, 2012

I have data that I want to store in some type of variable where I can easily access when needed. For example I have:
google.com -> This is a cool website.
yahoo.com -> News website
gmail.com -> Mail website

I want to be able to store those in some type of group so if I go like:
get data of google.com without going through a loop.

View 2 Replies


ADVERTISEMENT

Storing Data From A Database Into A Variable To Perform Calulations?

Aug 23, 2011

i am trying to write a program which reads a data from the database and perform some calculations. what i am intending to do is when a user selects an item from a listbox and clicks the submit button the program, calls a function to calculate using the value stored in the database and display the result in a textbox.the problem is i cant store the data retrieved from the database into a variable so that the calculations can be done. i am using vb and microsoft sql server.can anyone tell me how do i store the data retrieved by the query into a variable.

View 12 Replies

.NET Best Data Type For Storing Currency Values?

Feb 13, 2010

What is the most appropriate data type for storing currency values in VB.NET?

View 1 Replies

VS 2010 Philosophy On Storing Data?

Dec 28, 2010

There are "text" files, there are databases, I used to use a record (now called a structure) in a ".dat" file, but I'm having trouble finding documentation support in vs2010. So I'm thinking maybe it's time to move up to ... ? databases? ".txt"s? The current app I'm trying to write will only have a couple of hundred "records" at the very most; Old vb6 command like LenB which would return the size of a file in bytes is no longer, and I can't find how len( .."as byte" of file) would actually be implemented. len( <filename>, as byte) isn't the correct syntax - what is?

Is there some thing less dramatic than a full blown database? Or getting used to how a database uses SQL and all that goes along with that shoud be something to get handy with?

View 13 Replies

Arrays And Storing Data To A File VB 2010

Feb 6, 2012

I am trying to store 8 separate pieces of information in a text file (like a database) [but not a SQL database], consisting of integers and strings. How would I use an array to do this? Will an array collect data from text boxes (I also want to display the 8 pieces of information in separate boxes). also how would I save the text file so I can open it again or open a different text file (database?), from within the program?

EDIT: I see I need to use readline and writeline to read/write from a text file but how would I find specific data to show in my boxes?

View 1 Replies

DB/Reporting :: VB 2010 Storing And Retrieve Data?

Jul 21, 2011

What is the easiest method of storing data and retrieving it using VB? FYI, I have not used Access before. It will be a movie database that stores title genre, etc. I thought about using a text file but i think thats crude and ran across this site:

View 1 Replies

VS 2010 : Storing Data In Txt File For Program Use?

Jun 22, 2011

In the program I'm working on, there is a 'sign-in' form that pops up for the user to enter first name, last name, and DOB. What I want to do is STORE that information in a text file for FUTURE use by the program (i.e. displaying a list of all previous users of the program).I already know how to use streamwriter to write text to a file, but I would like for the text file to be stored within the program files and also for a new user's data to be appended to that file every time.

Do I simply add the text file to the project files? When I do that, its path is 'My Documents'. How will that affect the program when I publish it? I guess I just don't yet understand what happens when the program is finished and published. The code for the 'Submit' button on the sign-in form is pasted below. At the bottom, I've put a comment to indicate where I want to store the data to a file.

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim TxtBox() As String = {TextBox1.Text, TextBox2.Text, TextBox3.Text}
For i As Integer = 0 To 2
If TxtBox(i) = Nothing Then

[code]....

View 13 Replies

VS 2010 Storing Data Along With List Box Items?

Sep 19, 2011

What I'm trying to accomplish is first of all, adding items in a list box, but while doing so, store data into that item so when the user clicks on it, the data will be brought up into the correct text boxes.

My idea on how this will all work out has to do with array lists. I'm thinking each time an item is added to the list box, an array list is generated containing all the data from the text boxes. The array list would be named as the text of the list box item.

So then when the user clicks on one of the items, it can find that array list easily because of the selected index, and then update the text boxes with the data.

Is the way I'm thinking of possible? If not, or if there is an easier what, what would that be?

View 12 Replies

VS 2010 - Storing Text Data In File For Program Use

Jun 28, 2011

Here is what I would like to do:
- Store string data from a 'sign in' form into a text file. This text file must be one that is saved even after the user exits the program. The text file must also be one that will stay with the program even after it is published (executable).
- Be able to write to/read from the file for purposes of displaying some or all of that data on a form.

I use an Application Setting to do this - of type 'Specialized String Collection'. I tried this, but for some reason I could not get it to work. It was a good idea, but I need to be able to SEE the data that has been saved, and with a setting it seems like that is not easily done. I've decided that I either need to use a simple text file or a 1-table database for this. I would prefer just a text file, but in either case, it needs to be part of the .exe when published.

I have added a text file to my project, but I am not sure if it will be "included" in the project when I publish it. The path of the file I've added is in 'My Documents', but in my code, I will have to specify the path in order to use Streamwriter. How will this affect the program when I publish it? I felt the need to make a new thread because on my last one we had been mainly talking about settings, and I've decided that isn't the best option for me.

View 1 Replies

VS 2010 Custom Type Array / List With Adding Items And Specifying Custom Type Variable

Jun 21, 2011

I recently downloaded VB 2010 Express so i am quite new to the language, but i have worked with dark basic, which seems to b very similar.Anyway, my problem is that i cannot seem to correctly set out my array of a custom type/class. i am trying to create two arrays, one of available entities and another of selected entities of which the user selects the entities to be dealt with in irrelevant ways. i have creates a button (called test) which adds some entities to the available list and all the entities come back the same value but they shouldnt be as you'll c in the code. i have run the step into command a found that "available.item(#).Name = " will change all of the entity's names.As of current i am working with lists as the array kept asking for a 'new' statement but i couldnt figure out where to put it.[code]

View 7 Replies

Cast Array In Object Variable To Type In System.Type Variable?

Apr 14, 2010

I have this function:

Public Sub DoStuff(ByVal type as System.Type, ByVal value as Object)
End Sub

The 'value' argument is always an array of the same type as 'type'. How can I loop through the values of the array?

I'd like to be able to do something like this:

DoStuff(GetType(Integer), New Integer(){1,2,3})
Public Sub DoStuff(ByVal type as System.Type, ByVal value as Object)
//Strongly types arr as Integer()

[Code].....

View 3 Replies

Collections Of Objects With Variable Data Type?

Jan 27, 2010

lets say I have:

arecord.name = "A"
arecord.value = 15 ' a number of type "long"
'
I then

call records.add(arecord,arecord.name)

' so far, so good but lets look at the next record

arecord.name = "B"
arecord.value = "this is text" as opposed to a number of type "long"

'can I then
call records.add(arecord,arecord.name)

View 3 Replies

C# - .NET Generic Class Instance - Passing A Variable Data Type

Jun 2, 2010

I'm tyring to pass a variable data type to a template class. Something like this:

frmExample = New LookupForm(Of Models.MyClass) 'Works fine

Dim SelectedType As Type = InstanceOfMyClass.GetType() 'Works fine
frmExample = New LookupForm(Of SelectedType) 'Ba-bow!
frmExample = New LookupForm(Of InstanceOfMyClass.GetType()) 'Ba-bow!

[Code].....

I'm assuming it's something to do with the template being processed at compile time but even if I'm off the mark there, it wouldn't solve my problem anyway. I can't find any relevant information on using Reflection to instance template classes either.

(How) can I create an instance of a dynamically typed repository at runtime?

View 4 Replies

Data Type Variable - Restricting Number Of Places After Decimal

Aug 5, 2009

Any way (outside of writing rounding routines) to restrict the number of places after the decimal in a Decimal data-type variable?

View 3 Replies

Storing Multiple Words As One Variable To Use Instr() To See If Any Of It's Variable Words Are In The Text?

Jan 26, 2012

other than GML (Yoyogames.com Game Maker Language), I am new to the coding world. The only "major" project I have completed using VB is a computer calculator that exactly mimics the capabilities of Windows 7's calculator. Yesterday, I began a Chatbot program for my girlfriend. Lol. I have used the instr() function to answer most of the questions or answers which are typed into the textbox1. I find this extremely troublesome because when using the instr() function you cannot say instr(textbox1.

Public Class Form1
Dim fos As String = "Foster: "
Dim ash As String = "Ashley: "

[code].....

View 8 Replies

Reading XML And Storing In Variable?

May 18, 2011

I am trying to retrieve a 'tag'(Is it called that?) from an XML webpage. Once I make a post request from my vb.net app it sends a command to my online webserver and redirects me to a page that has entries that change each time. The page that im redirected to that changes each time looks something like this:

<mainpage> <id>hello</id> <random>176</random> </mainpage>

What vb.net code would I use to retrieve the id (In this case 'hello') and store it in a variable.

View 1 Replies

Cast A Variable To A Type Represented By Another Type Variable?

Oct 10, 2009

I'm aware that questions like this have been asked before and I doubt it's possible, but I just wanted to make 100% sure that it isn't.In VB.net or C# (either language, it doesn't matter), I want to cast a variable to a type represented by another Type variable. Here's an example of the kind of code that would be needed in C#:

Object castMe = new Foo();
Type castTo = typeof(Foo);
Foo beenCast = (castTo.GetRepresentedType())castMe;

[code].....

View 3 Replies

Assigning A Variable To A Class Then Storing?

Sep 30, 2009

i'm working on a code that i want to start creating new classes with but i want to know if there's a more direct way to send the variables used in the form to a new class for storage.

for example i've got this on a form...

Dim ClassID As String
Dim ClassName As String
Dim Grade As String

[Code]....

you know? so what would be my most direct route to get this? how should i start?

View 15 Replies

Error In Storing An Image Into Variable In .net

Mar 10, 2011

i need to retrieve an image from accessdb and store it in a variable m getting an error in the following code

'this is to retrive an image from database Dim User_Pic As Byte() = DirectCast(dtUserLogin.Rows(0).Item(11), Byte())this is to store image into a variable userpicture = User_Pic userpicture is a bitmap as shown Public userpicture As bitmap

View 1 Replies

Storing In A Single Variable In Linq?

Jan 24, 2011

how to store multiple variables in a single one to be stored in string?I have some 5 linq variables which am trying to store in a single string...Can you tell me how should i do so?

View 3 Replies

VS 2010 : Handles Clause Requires A WithEvents Variable Defined In The Containing Type Or One Of Its Base Types

Aug 26, 2011

I am trying to follow this thread

[URL]

and I have it pretty close but have one error.

Quote:Handles clause requires a WithEvents variable defined in the containing type or one of its base types.

That error is on both of these, in blue

Private Sub SpellChecker1_DeletedWord(ByVal sender As Object, ByVal e As NetSpell.SpellChecker.SpellingEventArgs) Handles SpellChecker1.DeletedWord
'save existing selecting

[code]....

I have added the reference, I have also added them to the toolbox. My dictionary is all set. What did I miss?

View 1 Replies

Storing A String Variable Value In Windows Registry

Apr 21, 2011

I want to store a string variable value in the windows registry If the below is a correct statement. My.Computer. Registry. SetValue ("HKEY_ LOCAL_ MACHINESYSTEMMyKey", "Start", "ABC")i will declare a string variable Dim strvalue as String strval = InputBox("Enter a string")and now i want to insert the User given value in the Registry Key as above in place of "ABC".

View 2 Replies

Storing A Text Box Date Entry As A Variable?

Mar 11, 2010

I have the following code for part of an application I'm building and I need some instruction on how to store this value and carry it to the next part of the program. Private Sub dateEntryTextbox_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles dateEntryTextbox.TextChanged

[Code]...

View 2 Replies

VS 2008 Storing Ftp Password Into Application Variable?

May 16, 2011

I have an application that is updating from my ftp server.Inside app I have 2 variables like this:

myFtpUser="ftpuser@mydomain.com"
myFtpUserPassw="myftppassword"

I obfuscate exe using Eazfuscator.For two times someone deleted all files from ftp account,I suppose he got the ftp password,is it possible to got it from my app exe ?Is it enough protected ?

View 10 Replies

Application Settings, Storing Type Internal To Your Assembly?

May 13, 2009

I am trying to store an enum in my application settings. This enum is defined within my main assembly in the same namespace. When I try to find the type under the application settings, it seems like I can't find any types within my namespace. I can see all the types of the assemblies I reference though.

View 2 Replies

VS 2008 - Storing Selected Item In ComboBox To Variable On Button Click

May 10, 2010

I have 13 variables, all called Items1, Items2, Items3 and so on. I have a combo box with items in, each time I click a button I want it so whatever is selected is stored in a variable and if the button is selected again then it stores whatever is selected in the next variable. I know all the code for selecting items in a combo box and transferring it to a variable but the problem I cannot do is the part where each time a button is clicked it stores whatever is selected in the combo box to the next variable.

View 9 Replies

Program Function - Says, "The Type For Variable [variable] Will Not Be Inferred Because It Is Bound To A Field

May 18, 2012

Public Class Form1
Dim x, c, number(0 To 19) As Integer
Dim s As Integer

[CODE]...

The variables in the brackets [example] do not actually have brackets in them in the original code. These are where the issues are. For both variables, it says, "The type for variable [variable] will not be inferred because it is bound to a field in an enclosing scope. Either change the name of [variable], or use the fully qualified name (for example, 'Me.[variable]' or 'MyBase.[variable]')." Now, I'm not entirely sure if this is a stupid question or not, as I'm used to VB '98 because that's what we use in my programming class at High School. let me know why this won't work.

-Note: The intention of this program is to continually loop the generation of numbers for this list until I tell it to stop. Button1 ends the program, Button2 generates the list one time only, Button3 is supposed to loop the generation of the list, and Button4 is supposed to end the loop, but not the program.

View 9 Replies

Variable Naming Conventions To Illustrate Variable Type And Where Variables Are Declared

Aug 24, 2009

I am looking for a good resource on variable naming conventions to illustrate variable type and where variables are declared. So I will have public variables, Private variables, private or local variables. I also may want to declare variables with the same name in different class code (i.e. in the code behind different forms). I am assuming good coding would dicatate a prefix for declaration location.

View 4 Replies

VS 2010 Storing Application Data Within An Application

Jan 8, 2012

I was wondering if it's possible to store application data within an application without storing the data in an external file. For example, in my application, the user can choose where he/she would like to store the files that the application creates. I need to make the application remember the location that the user specified. I've tried using My.Settings to save this information, but since my application is standalone, if the location of the application changes, the My.Settings information changes as well (unless I coded it incorrectly before). I would prefer not to store this data in a .txt file or something similar.

View 10 Replies

Parameters Data Type - Add Parameter With Same Data Type As Column Data Type

Feb 26, 2012

For each column in data table i want to add parameter with same data type as column data type. But looks it's not that simple.


Dim cmd As New SqlCommand
Dim dType As New System.Data.SqlDbType

For Each cl As DataColumn In DataTable1.Columns

[CODE]...

How can I do this?

View 4 Replies







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