I would like to retrieve a single column of about 800 rows in a table and save these values in an array so as to reference them later on. How can I do it? I tried:
[code]...
And it didn't work. The col1 is of type Int64 and so is the array prev_ob(). Please let me know how I can save it to an array.
I want to load all of the LOCATIONS in the Location table to a Combobox and then for any found locations (in another table) to be deleted from that combobox. Im using a Array list, but can't get the Data reader to write to the Array list.
Dim SQL As String = "" Dim Reader As OleDbDataReader Dim i As Integer = 0 Dim LocationArray As ArrayList = Nothing
How do I load data from a datatable into an array.
Dim dtDataTable As New System.Data.DataTable dtDataTable = dsStaffHoursWorked.vwGroupProjHoursDate Dim DRs = dtDataTable.Select("enddate = '05/14/05'")
How can I fill this Percentage array with Sql data reader..
Dim StudentID As Integer = Me.ComboBox1.SelectedValue Dim Percentage() As Integer Dim con As New SqlConnection("Data Source=.SQLEXPRESS;AttachDbFilename=D:Database
I am using a datareader to pull data from my database. I store the data in a multidimensional array in a seperate class file. I access the values in the array from a form through properties.The problem I am having is when I run the project as I step through the code I can see the values being added to the array but when access it from a string property it shows up as string System.String[,]. I would like to have my array transposed accross the listview under the corresponding column. below is the code I am using.
I have a problem with my project. here is the problem:
My code for login is as follows:
dim conn as SqlConnection = New SqlConnection("Data Source.................) dim cmd as SqlCommand = New SqlCommand("Loguser",conn) cmd.CammandType = CommandType.StoredProcedure
[CODE]...
Now the error i get is that "there is a datareader associate with this connection that need to be closed"
I have a 2d-array but the array is made of a class and I want to know what is the best way to save this array so I can edit and bring it back up and save it back when needed.
So I have this class Friend Class CellValue Public CellColor As Color = Color.White Public CellShape As Shape = Shape.Blank Public CellName As String = "" Public CellLocX As String = "" Public CellLocY As String = "" End Class [Code] .....
Apparently the system.collection.arraylist does not work since it is more of a list than anything else. Is there some sort of collection that will save my array as is so that it can be retained latter on application load?
Public Structure One Public ItemOne As String Public ItemTwo As Integer End Structure
[Code]...
Results In an Unhandled exception. Bad Record Length. and then If I close it and reopen it I get an 'Unable to read beyond end of stream' error. So what is the best way to save an array of structures? Binary Reader/Writer? and why does this way not work (Even if its derived from VB6)
I am writting an application in VB using VS2008 and SQL2005. I would like to save an array to my database and later retreive it. I understand that I need to serialize the array to do this but don't understand the process. I have looked at various resources on the Internet but seem to be missing something.
I have a string array that is populated with thousands of entries. I am wanting the quickest way to save this data to disk and to also load it back up.
Currently I am looping through the array and appending this data to a string and then saving this string. This takes a long time.
What is the fastest/most efficient way to do this?
How do you save an array or an arraylist in vb.net using My.Settings? I cannot find the array type anywhere, even in the browse window.I absolutely need to be able to save this.I know I can convert the array to a string, but I do not know how to convert a string to an array. I know that if I were to break it at a delimiter then I could convert a string to an array, but my problem is that any text at all could be stored within the array as a single value, so I cannot pick a delimiter that is likely to be used.
I have some code in a module: Public esUsefullitems as new arraylist That declares my list and I am using a simple structure to store data in but what I was wondering how can I save the arraylist to my.settings without getting a nasty object reference is not set to an instance of an object error, I know this involves using the 'new' method but I have tried many different ways of doing it but I still get that error, how do I do it?
Now i have some images and i have a database (MS Access)i need to convert all images to !one byte array!(couse i have 1 column for images) and i save this array. Then when i need a picture i should take some pic on this byte array.umm i think i cant explain my status :)
i need to cut this byte array like split function. so then i can choose image whatever i want
I am using visual studio 8. vb.net.I have an array, array1(100,8) and I want to save it as a csv file so that I can open it in excel and examine the contents more closely. The feature, of saving as a csv file, is not going to form an integral part of the finished vb app, I just need something quick and dirty because the data in the array just requires looking at in excel so that I can fully understand its significance and thus continue coding my app.
Private Sub LoadButton_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles LoadButton.Click Dim lin(8) As String, filRead As StreamReader, i, x, t, d As Integer
[Code].....
I am getting a run time error it is not saving to textfile
I am writing a program in VB10 and the programs purpose is to read an encrypted text file and decrypt it into a textbox onscreen. You can then save the text.The problem is that it keeps saving text in files like this:
H e l l o
I cant figure it out. Here is my save array code:
First the savefiledialog Sub SaveFileDialog() Dim strFileName
I need to save array into excel file. I'm using code taken from [URL]
Dim oExcel As Object Dim oBook As Object Dim oSheet As Object
[Code]....
But i want to let users to choose folder and filename themselves instead of determining location and filename like in those code above oBook.SaveAs(sSampleFolder & "Book2.xls") I wonder if i can use SaveFileDialog but i dont know how to do it. Or is there any other way to do this?
My homework task is to add data to an array of records and then save this to a file.
I'm having problem saving to a text file. I have the following code:
Private Sub btnSave_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnSave.Click Dim SW As New StreamWriter("Records.dat", False)
[Code].....
In my test example here I realise that the reason I have 4 lines written is because I have 4 elements to the array, but why am I getting this gobbledegook instead of records with a name and age?
I know I have added the data correctly to the structure because I can redisplay it elsewhere on my form. I just don't get how to save data in a structure to a text file.
My task requires use of an array and/or array of records, a text file
Suppose i have an image and i extract each pixel color and store it in a color array, is there any way by which i can save the color array along with the image? I was thinking about converting the color array to string and then integer and then append data to a text box, but then again i must store the text along with the image....and i dunno how to do that?