VB6 Used Recordsetsor Arrays - .Net Framework In VB2010. Datasets, Dataviews. Tableadapters, Arrays. Enums ?

May 9, 2010

In VB6 I load a recordset containg all of the records (6 fields per record)in a table into an XArray and then manipulate the records in the array and then write them back to the original table. The array issorted by the first field (1 to maybe 8000 or more) I need to find records in the array by an ID field and then move them (because of some external criteria that happens many times) from say number 400 to number 375. Then all of the other records between 375 and 399 were renumbered up 1 to fill the gaps left by the move.

The XArray worked well as it could find and also move to a next record easily to facilitate the revisions to each record quickly. Everything is done in VB6 in code and nothing visual needs to be shown to the user until say 2000 of these external changes are complete. What is the best, most efficient way to do this in the .Net framework in VB2010. Datasets, Dataviews. tableadapters, arrays. enums ?

View 3 Replies


ADVERTISEMENT

Option Base 1 Implementation For Arrays In VB2010?

Apr 29, 2012

I believe that prior to VB.NET, VB allowed arrays to start the first element as "1" instead of zero via the Option Base 1 option. Is there a simple way to implement this functionality in VB2010?

View 3 Replies

Integer Arrays - User Enter In Big Integers Using - Two Parallel Arrays

Dec 10, 2009

My assignment is to have a user enter in big integers using what i think is two parallel arrays. I got this far but now im stuck. I think i need to actually convert the text box input into an array but i do not know how to do that. I am all over the place in this project.

'Created/ Revised by: Jessica Falcetta
'Cap 204 Final Project: Big Integer Project
'Project Purpose: To calculate large integers through parallel arrays

[CODE]...

View 5 Replies

Passing Arrays Through Fortran Dll From App Turning To Single Element Arrays?

Feb 2, 2010

I have a VB.net console app and I am opening a function in a dll written in fortran. I am passing 3 arrays through the function by reference. When they come back out the otherside they ahve all tunred to arrays of only one element And that element is 0.I read on the internet somewhere that when doing this kind of thing it is a good idea to only pass the first element of the array into the function.I tried changing my function declaration to accepting single elements rather than single dimensional arrays, and now the arrays are the same length before and after the function call, but they don't seem to be changing at all, so i'm not sure that this is working

View 1 Replies

VS 2008 Arrays Displaying States/searching Arrays?

Oct 30, 2010

the statement Dim state(49) As String and maintain a list of certain states. The list of states should always be in alphabetical order and occupy consecutive elements of the array. The buttons in the program should give the user the following options: (a) Take the state specified by the user in a text box and insert it into its proper position in the array. If the state is already in the array, so report. (b) Take the state specified by the user in a text box and delete it from the array. If the state is not in the array, so report. (c) Display the states in the array. "

Private Sub states_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
state(0) = "Alabama"

[code]....

View 1 Replies

Comparing Arrays :: Possible Without Iterating The Arrays?

May 3, 2010

I was wondering if anyone knows a built in method ( LINQ say or a LAMBDA expression or other way ) that you can compare2 arrays - collections that would be valid for an equivalent 3rd array - collection which is a combination of the 1st two.

As an example consider;
* * *
A L E

[code].....

View 17 Replies

Sort Three Arrays (the Other Two Arrays Are In Sync With The First)?

Oct 13, 2009

How can I sort three arrays so they are sorted together (the other two arrays are in sync with the first)?unsorted unsorted unsortedarray1]CODE]....

View 9 Replies

VS 2010 Typed Datasets Vs Entity Framework

Aug 19, 2011

I just read this post url...Post #2 by jmc states indicates the use of Entity Framework instead of typed datasets.when jmc says something I usually pay attention. I have a large app that I've been converting from VB6 to .Net and I've used mainly typed datasets.It's a single user app that uses an Access database. I'm have no problems retrieving the data from a table or multiple tables and I'm very happy with its preformance.Is it worth scapping what I've done and learn how to use Entity Framework? I should add that I'm near the end of my programming career not the beginning.

View 4 Replies

Class With Dynamic Arrays Inside Another Class Which Also Has Dynamic Arrays?

Nov 15, 2011

Below you will find a code sample that I have dummied up to try and demonstrate the issue I am having. However, this is just a dummied up piece of code. The actual program has noting to do with STUDENTS or TEACHERS. Basically, the problem I'm having is trying to have a CLASS within another CLASS each of which contain ARRAYS that need to be dynamic in size. The sample has a CLASS called STUDENTS that can have in theory many students, the number of which are unknown to the CLASS. I need to be able to add STUDENTS to the ARRAY programmatically.

The CLASSROOM Class should also be an Array since each TEACHER will have MANY Students. There will be only 1 Teacher for a given classroom but the SCHOOL will have MANY CLASSROOMS. Again, I need to programmatically add Teachers and Students without having predefined Array sizes. The code I have listed below will NOT work but it demonstrates what I am trying to achieve. I want to be able to reference the CLASS by using something like this ...

School(iTeacherIndex).Student(iStudentIndex) = "Rick Smith"

I feel like I should be able to use ARRAYLIST in both classes but haven't been able to get it to work. I've tried DIM'ing as ARRAY and can't get that to work either.If I can get ARRAYLIST to work then I shouldn't need to worry about expanding the array via UBOUND (if it's even possible).The REAL question is "How do I have a CLASS within a CLASS, each of which has ARRAYS that need to be dynamic in nature so they can be expanded as needed? The size of the array cannot be determined ahead of time".

REMEMBER . . . the actual program has nothing to do with Students and Teachers. This was just my way of demonstrating the issue using an analogy that I thought everyone could understand. The actual Class is much more involved.I have purposely hardcoded some values just to make the sample easier to work with. This is NOT how I normally program but is just here to hopefully make things a little more clear.

Here is the sample code . . .
'***********************************************************************************
'***********************************************************************************
'***********************************************************************************

'Here is the code that is in the form - This obviously doesn't work

Private Sub TeacherTestDemo()
Dim iTeacherIndex As Byte
Dim iStudentIndex As Byte

[code]....

View 2 Replies

Getting A Compiled VB2010 Application To Run On 3.5 Sp1 Framework

May 16, 2010

I have made a simple vb application and have used vb 2010 to create it, which all of you would know, uses .NET Framework 4.0. I wanted to use this application at work, however, I found out that my work uses .NET framework 3.5 sp1.

So my question is, is there a way to compile something in VB 2010 that will work on .NET 3.5 sp1? If so, how?

View 2 Replies

Is .NET Framework V4 Necessary To Run An Application Created By Vb2010 To Run On Other Computer

Jun 15, 2010

is .NET framework v4 necessary to run my application created by vb2010 to run on other computer??? cause its large file to download....

View 4 Replies

VB2010 Is The Compact Framework Still In Work - It's Not In Beta2

Oct 20, 2009

Is the Compact Framework still in work? It's not in Beta2.

View 2 Replies

.net - Using Arrays With Asp.net And VB?

Oct 31, 2011

Sorry, I'm sure this is something that has been covered many times, but I can't find quite what I am after.

I have a single row data table which contains various settings which are used within my web system. I have been toying with turning this into an XML document instead of the single row datatable, would that make more sense?Anyway, so, given that this is one record, there is a field called "locations," this field contains data as follows:

locationName1,IpAddress|locationName2,IpAddress|etc

The ipAddress is just the first 5 digits of the IP and allows me to ensure that logins to certain elements (admin section managed by staff) can only be accepted when connected from a company computer (ie using our ISP) - this is a largely unnecessary feature, but stops kids I employ logging in at home and stuff!

So, as the user logs in, I can check if the IP is valid by a simple SQL query.

SELECT ips FROM settings WHERE loginLocations LIKE '%" & Left(ipAddress, 5) & " %'

What I need to be able to do now, is get the name of the users location from the dataField array.

I've come up with a few long winded looping procedures, but is there a simple way to analyse

locationName1,IpAddress1|locationName2,IpAddress2|etc

as a string and simply get the locationName where LoginIp = IpAddressX or am I going about this in a totally ridiculous way and should turn it into an xml file? (which will then create a whole load of other questions for you about parsing XML!!)

View 4 Replies

Need Some Example Of Use Of Arrays

Aug 28, 2009

Arrays in Visual Basic When you use arrays, you can refer to multiple values by the same name, using a number called an index or subscript to distinguish them from one another. Arrays can shorten and simplify your code, allowing you to create loops that deal efficiently with any number of elements.How to Use Arrays, Why We need it to use.

View 1 Replies

Arrays - Create New T[] In .NET?

May 28, 2011

How can I do the same as the following in VB.NET

List<T[]> result = new List<T[]>();
// single combination
if (k == 0)
{

result.Add(new T[0]); // T is function type argument of generic function How can I write the last line above in VB.NET?

I tried:

result.Add(New T(0)) 'doesn't work!

View 2 Replies

Asp.net - 2 Arrays To Serialize?

Jun 23, 2011

I have the following code which works well:

Dim dept As New ArrayList
Dim forename As New ArrayList
objJSONStringBuilder = New StringBuilder()

[Code].....

Eventually, I will want to add more columns, i.e. surname.

View 2 Replies

Creating An App Using Arrays?

Apr 12, 2011

I needed to create an app using arrays. The goal of the app was to input a certain amount of points and display their level of contribution and any benefits they receive (for example: enter 500 points -> display "Gold level" and "Fieldhouse privileges, Parking at game, Football tickets"). I was supposed to use a loop and intLevel array to find the donor level that corresponds to the input amount, display the donor level using the strLevel array and using the strBen array display the benefits that apply to this donor.

What I was given:

Dim intLevel() As Integer = {50, 100, 200, 500, 1000}
Dim strLevel() As String = {"Contributor", "Laker Club", "Bronze", "Silver", "Gold"}

[Code]....

My app works, but my prof's comments on it were to get rid of the "+ 1" on the first "Do Until" loop, cross off the second Do Until loop and he just wrote "not quite" next to the bottom two lines.

So basically, I'm wondering how I would write code to search for the amount of points (without having to add the "2000" so it doesn't blow up on me) and matching it with strBen. To be honest, I don't understand why I am not getting points for this.

View 8 Replies

How To Intersect Two Arrays

Jun 11, 2009

I'm working with VB.Net, and have two one-dimensional Arrays. Is there an Inbuilt function for finding the elements that are common to both of them? Or do I have to write one for myself?

View 4 Replies

Interference Between 2 Arrays

Apr 26, 2011

I'm having problems with 2 2-dimensional arrays. Whenever I change the value in a cell in one of them, the value of cell with the same indices changes in the other one.[code]

View 3 Replies

Loop Through 2 Different Arrays?

Nov 23, 2009

I need to loop through 2 different arrays.(Visual Basic)If I do a loop within a loop, will I get the results I need?For each order in ShippedOrders and For each order in UnshippedOrders........

View 9 Replies

Loop Through Arrays

Dec 27, 2011

For perspective, pretend your trying to print an array:[CODE..]

View 2 Replies

Ordering Of VB Arrays?

May 17, 2006

I am calling external DLL (written in Fortran) function that has a multidimensional array argument. In VB6 the array is column major (the same as Fortran). However, I recently noticed that in VB.Net the array passed to the DLL seems to be in row major.

View 3 Replies

Set / Get For Class Arrays?

Apr 30, 2009

What should the set/get function look like for the following class?[code]...

View 7 Replies

Sorting Arrays In .net?

Aug 10, 2009

I need to know if there is any simple way to sort an array in visual Basic.net. I have been trying for some time without any real reliable results or wierd results. Here is the code this is the sort routine which transfers a csv text file read earlier into an array.

Private Sub btnSort_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnSort.Click
Dim i As Integer = 2 'inner loop
Dim j As Integer 'outer loop
Dim tempstore As String = String.Empty
ProgressSort.Minimum = 0

[Code]...

The data seems to be read into the array but the sorting takes a very long time and I am not sure if it is working or not. I have read from other forums that it is easier to sort the array read from csv before splitting it. This record I am trying to sort is 250 records long. I have no idea how long that should take. Not even sure if the algorithm I chose is correct.

View 5 Replies

Sql - Comparing Arrays In .NET?

May 20, 2009

Let me provide a little detail to explain what I'm trying to accomplish before I get into the nuts and bolts of the question. I've got two data sources - one is a SQL Server containing part numbers, descriptions, etc. The other is a CAD system that does not have a database in a traditional sense. What I'm trying to do is read out the bill of materials from the SQL Server and compare it to the CAD assembly drawing to ensure that the CAD system contains the same information as the SQL Server.

Getting the data from the SQL Server is fairly straight forward. I query the database and populate a datagrid. Done. Quick. Easy.Getting the data from the CAD system is a little more involved. I have to load the assembly drawing to get a listing of all the component parts and then load those individual drawings to pull the "Part Number" property from the drawing. This is a somewhat time consuming and slow process (unfortunately) since each of the files must actually be accessed. I load those properties into an array (I guess a list might be more efficient).

So now I have a datagrid and array with part numbers. I need to compare them and colorize the grid accordingly. The grid should remain transparent if the part exists in both, color the row yellow if it only exists in the grid, and add a row colored red if only in the array.

As best I can tell, this means looping through the array on each line of the grid. The thought process is this:Default the grid to yellow rows.Loop through the grid and loop through the array to compare. If a match is found, make the row transparent and delete the element from the array.After step 2 is completed, the array should only contain elements that are not found in the grid. Resize the array to remove the empty elements.Add the elements of the array to the grid and color those new rows red.The problems with this logic is that it seems expensive from a performance standpoint. Surely there is a better method? Also, if I modify the grid in some manner (like a resort) I have to go through the process again.

View 4 Replies

Translating 'New' Arrays To C#

Dec 9, 2011

I'm trying to translate some code from VB.Net to C#, but I've run into an issue.The Vb.Net line of code I want to translate is:[code]However, this is giving me a nasty 'Object reference is not set to an instance of an object' error.

View 3 Replies

Using Arrays In A Class

May 22, 2010

This section of code is part of a much larger program.However, I can't seem to find the problem with this error.Error: Object reference not set to an instance of an object.[code]I'm using this array inside of a class form to maintain the memory of a computer player in a rock, paper, scissors game. There are two computer players involved; thus, the need for a unique instance of each array for each player.I'm struggling with this program and all of my errors are gone until I try to run the main form.I can link more code if needed.

View 3 Replies

Using Arrays In/with Structures?

May 24, 2009

I'm currently doing this project where i have to create a program that let's the administrator manage students (and their tests.) I have decided to use Random Access file in this project.because structures will need fixed lengths...i don't know how will i search through the students (a function of the program) when each student structure has a different length because of the number of tests they've done.* I have created a variable in the aStudent structure so that i can know the number of tests a student has done...but don't know how to use it.

Public Class FormAdmin
Dim currentStudentName As String
Dim currentStudentID As Integer = 0

[code]....

View 3 Replies

Using Arrays To Scores?

Mar 14, 2011

I am trying today to write a code that enters all the scores I enter in a textbox(txtscore). I think I almost have it but it will not work properly for me. Her is the the sub I am using to list this code. the array is called arrScore.

Private Sub btnEnterScore_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnEnterScore.Click
Dim score As Integer = 0 'counting
'check for valid input

[code]....

View 3 Replies

Using Arrays With Structures?

Jun 18, 2011

I have created a structure as below. I want the structure to be an array...so I can use a call like picks(1).a or picks.a(1) = blah blah. I don't understand how to use an array of a structure..

Public Structure apicks
Dim a As String
Dim b As String
End Structure

View 3 Replies







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