lolafuertes 145 Master Poster

Just my cent.

Additional to the excelent info from ddanbe, here after a couple of links:
Windows forms coordinates on MSDN (here)
Coordinates systems on Wikipedia (here)

Only to say that the values to define a drawing point in a screen are always in positive values referred to the top-most/left-most corner of the screen. As X axis increases, the point is moved to the right and as Y increases, the point is moved down.

Hope this helps

lolafuertes 145 Master Poster

Just because of

int i = 0;

on line 22. This sets the i value to zero on each loop iteration.

To work as you expected this sentence should be on line 19 instead.

Hope this helps

lolafuertes 145 Master Poster

The SQL SET IDENTITY_INSERT must refer to a table, but in your code it refers to a column in the table. (see here)

In your example, the sentence would be:

SET IDENTITY_INSERT LOCATIONS_SETUP ON

Just to comment that, in general, is not a good idea to insert specific values in an identity column.
If you want to do that, first you need to verify that the value to insert in the table does not already exists.

Assuming that the identity colum in your example is LoacationId, you should rewrite your sentence like:

IF NOT EXISTS (SELECT LocationId FROM LOCATIONS_SETUP WHERE LocationId=10) INSERT INTO LOCATIONS_SETUP(LocationID, LocationNumber, LocationName, LocationAddress1, LocationAddress2, LocationAddress3, LocationCity, LocationState, LocationZipCode, LocationZipCodeExt, PhoneNumber, FaxNumber, BillToAnswer, BillToLocation)
VALUES(10, 1, 'Traditions in Tile / Buford RDC', '4325 Hamilton Mill Rd', '', '', 'Buford', 'GA', '30518', '', '(770) 831-5324', '(770) 831-6774', 'N', 36)
ELSE ....

On the else clause you must take an action when the value to be inserted already exists, like raising a SQL error.
Once you have inserted the value you must revert the permission to insert identity values using

SET IDENTITY_INSERT LOCATIONS_SETUP OFF

Hope this helps

lolafuertes 145 Master Poster

The hypen is usually understood as a minus sign, so the parser tries to calculate INV minus PART minus NUMBER !!!

The solution is to surround the field names between [ ] Ex:

"SELECT [INV-PART-NUMBER], [INV-DESCRIPTION] FROM INVENTORY where [INV-PART-NUMBER] like " & search1

Hope this helps

lolafuertes 145 Master Poster

Probably you have seen that there are some applications that are able to 'undo' the last action. There is no magic behind.

The programmer of those applications had to define how and what an undo button does, like any other button.

Now, on your application, you just need to write the code to be executed when the undo button is pressed.

The info by @tinstaafl is an example of a handler to determine which button has been pressed, but you need to add the necessary code to undo the action.

Using your example,

"UPDATE fieldname='" & variablename & "' FROM database.tabename WHERE date='" & storeddate & "';"

in order to undo this action, you need to do one (or many) UPDATE sentence to restore the values before you did the UPDATE.

How you can handle that?

Before doing your "UPDATE fieldname='" & variablename & "' FROM database.tabename WHERE date='" & storeddate & "';" you will need to create a command like

"SELECT TOP 100 PERCENT * FROMdatabase.tabenameWHEREdate='" & storeddate & "';"
Whith this command, yu'll need to create a data adapter to retrieve the info from the DB and fill a new Dataset (using the data adapter) with a table having the result of this select. Remember that your table must contain a field that identifies each row.

This way you'll have the values before doing the update. But this is not enough.

Also you need to save this info in a file using the Dataset save …

lolafuertes 145 Master Poster

That question is really generic, so i'll try to answer in a generic way.

As you can expect, the answer is 'That depends on what the click does'

  • If the button click adds one to a counter, the undo can subtract one from the same counter. In this case, once undone, the undo option should be disabled.

  • If the button click deletes a file, then the undo must recreate the file and fill it with the original content.

In general, in order to be able to do an undo, you need to persist the current status, before doing the action by the click, in order to be able to restore it from the result, if an undo is required. When the undo is done, then you must 'destroy' the containter that holded the status, because you cannot use it to 'repeat' the undo.

You will be aware that if more tan one undo is required, then you'll need to persist the status several times, being able to know the exact order of creation.

Hope this helps

TnTinMN commented: nice description +6
adam_k commented: Agree +8
lolafuertes 145 Master Poster

When calling the class where the form is to be used, pass the form as parameter ByRef.

Hope this helps

xHellghostx commented: Thank you.. I made it work +0
lolafuertes 145 Master Poster

In my opinion, the curent behaviour is because you launch an async action (new thread) and then do not wait for completion on current.

After launching the DownloadFileAsync, you must do a

while (wc.IsBusy){ Application.Doevents();} 

to wait for completion in the current thread, then you can finish. (see this)

Hope this helps

Ketsuekiame commented: Ah yes, I missed this. Effectively the op will start the download and then it will exit. +8
Gerardo_2 commented: Excelente, gracias!! +0
lolafuertes 145 Master Poster

IMO, the easiest way is playing with the security tab of the properties of the folder, only allowing to acces there to the users you really authorize to it.

Also, if you need it, you can add users to the computer on the Users link in the Control Panel, to allow them to see your folder.

Hope this helps

lolafuertes 145 Master Poster

Freeing memory is based on two points:
* Do not start what you do not need
* If it is an option, try to limit the memory usage of the running applications and services by configuring them, if they have this option.

Windows uses virtual memory addressing. Based on that, every process automatically reserves up to 4 GB of memory (in 32 bit processor or compatibility mode) 2 of them for code and the other 2 for data.

Of course, you do not have all the phisical memory for that, so the OS uses a method of paging memory in blocks of 4 KB, and reservers as many pages are currently used, reserving more or less dinamically while the process is running.

For each process, including the kernel, there are some pages that must be allocated in phisical memory, while others can be on virtual.

Virtual memory is easely extended by using one(or more)file called swap file, that will hold a copy of the really reserved pages, while in memory exist only those really needed at the current point of the process. When a page is not needed anynmore in the phisical memory is copied back to the disk, and when a page, that does not exist in the phisical memory, is needed, it is read from the disk.

Thus the current memory usage and the commited memory can have distinct values.

But using disk as memory is near 1 million times slower than phisical memory.

In order …

lolafuertes 145 Master Poster

An example by Darin Dimitrov on StackOverflow:

Dim result = MessageBox.Show("message", "caption", MessageBoxButtons.YesNoCancel)
If result = DialogResult.Cancel Then
    MessageBox.Show("Cancel pressed")
ElseIf result = DialogResult.No Then
    MessageBox.Show("No pressed")
ElseIf result = DialogResult.Yes Then
    MessageBox.Show("Yes pressed")
End If

Hope this helps

Begginnerdev commented: Exact same code! =D +6
lolafuertes 145 Master Poster

The Audio class does not supports volumen manipulation.
See on this link for a Nuget Audio Package.

Hope this helps

lolafuertes 145 Master Poster

Maybe inserting values directly is a tricky way.
Please, read this article. I am sure it will help you.

lolafuertes 145 Master Poster

Your INSERT statement looks like:

Dim sql As String = "INSERT INTO [BuyNewTender] ([ProjectTenderingNO] ,[TenderingNo] ,[ProjectName] ,[Clientname] ,[PurchasePrice] ,[BuyDate] ,[TenderClosingDate] ,[DocumentDetail] ,[Notes]) VALUES() (@ProjectTenderingNO,@TenderingNo ,@ProjectName ,@Clientname ,@PurchasePrice  ,@BuyDate ,@TenderClosingDate  ,@DocumentDetail] ,@Notes)"

SQL executes this sentence by evaluating first

INSERT INTO [BuyNewTender] ([ProjectTenderingNO] ,[TenderingNo] ,[ProjectName] ,[Clientname] ,[PurchasePrice] ,[BuyDate] ,[TenderClosingDate] ,[DocumentDetail] ,[Notes]) VALUES()

wich results in an empty set of values, then evaluates the

(@ProjectTenderingNO,@TenderingNo ,@ProjectName ,@Clientname ,@PurchasePrice  ,@BuyDate ,@TenderClosingDate  ,@DocumentDetail] ,@Notes)

wich results in an evaluation of values in the memory of SQL server not needed any more and discarded.

There is no Exception because the sintax is mostly 'valid'.

I'll suggest to remove the () in the line 148. Also the ] in line 156.

Hope this helps

Reverend Jim commented: Good to see you back.. We missed you. +11
lolafuertes 145 Master Poster

The problem arises because the PickedWord is null in this context.

Be aware that C# is capital aware so the playHangman class for the main program and the PlayHangman class gor the game management are not the same.

So when in the playhangman class you wrote

  1. PlayHangman playHangman = new PlayHangman();
  2. Word PickedWord = pickedWord;

probably you'll need

97.                        PlayHangman playHangman = new PlayHangman();
98.                        playHangman.PickedWord = pickedWord;

I also will suggest not to reuse the class name as a variable name because may be confusing.

Hope this helps.

lolafuertes 145 Master Poster

Use a LINQ->Any having the appropiate comparasion function. For an example see here

Begginnerdev commented: Thank you for your help! +5
lolafuertes 145 Master Poster

Thepending on the computer language the C:\Users folder can change. IE in Spanish is C:\Usuarios.

You should use the special folders naming in order to obtain the right name of the folder.

Hope this helps

lolafuertes 145 Master Poster

@legendster: or uploading. Mostly because the brouser can't return the ack to the sender.

legendster commented: Agreed +0
lolafuertes 145 Master Poster

The most common solution is to create a server process to be run on each computer in the lan, that will capture the screen image at video card level.
Trying to send an image through the lan is expensive, so most solutions use some kind of compression algorithm to reduce the picture size, and/or uses to send only the changing parts.
Then, a viewer will 'get in touch' with each server to receive the new picture / or updated parts, to be shown in the viewer, and compose the resulting image.

You will need to stablish some kind of protocol to exchange the info between the server an the client. The RDP (Remote Display Protocol from Microsoft) can be used for this purpose.

Also VNC has an open source solution, you can use to start.

Hope this helps

lolafuertes 145 Master Poster

@jgat2011: Having an auto increment field as primary key is not always a good idea. Ex: assume a table for the states. If you define PK SatateId as integer autoincrement, and a field stateName as a string, you can insert the same stateName in the table without error.

Continuing from the Reverend Jim, maybe need to use SQL sentences like:
IF NOT EXISTS (SELECT Staff_Id FROM Staff) INSERT INTO Staff (Staff_Id,Staff_Name, Staff_IC,Staff_Ext,Staff_HP,Staff_Email,Staff_Position) VALUES ('" + txtId.Text + "','" + txtName.Text + "','" + txtIC.Text + "','" + txtExt.Text + "','" + txtHP.Text + "','" + txtEmail.Text + "','" + txtPosition.Text + "') ELSE UPDATE Staff SET Staff_Name = '" + txtName.Text + "', Staff_IC = '" + txtIC.Text + "', Staff_Ext = '" + txtExt.Text + "', Staff_HP = '" + txtHP.Text + "', Staff_Email = '" + txtEmail.Text + "', Staff_Position = '" + txtPosition.Text + "' WHERE Staff_id = '" + txtId.Text + "';"
where, in first place, searches for the id if exists, then if not exists inserts, but if already exists updates.

Hope this helps

Reverend Jim commented: Excellent point but watch out for SQL injection. +9
lolafuertes 145 Master Poster

How many fileToolStripMenuItem_Click have you? Probably you have almost the standard one (fileToolStripMenuItem_Click) and the one exibited here(fileToolStripMenuItem_Click_1 created after you deleted)

Please, go to the form designer and verify wich one is the delegate for the event click of the fileToolStripMenuItem.

Hope this helps

ddanbe commented: Good observation! +14
lolafuertes 145 Master Poster

Just my cent.
If you only will provide a gui for the application, you can add a form that will be the gui for it.

The form must contain the necessary info an controls to be able to call the right methods or functions you already defined.

Usually, on the main procedure, you will check if the environment is user interactive to show the form, unless a parameter in the call to the application asks for not to use the GUI.

If you must show the form, then show it as dialog, and end the application when the form is closed.

Hope this helps.

lolafuertes 145 Master Poster

Please, be so kind to mark the thread as solved. :)

Begginnerdev commented: Marked as solved, sorry for the delay. +2
lolafuertes 145 Master Poster

The most common situation is assumming that the field is a string field, but is not.

Please, verify in the DB definition the field type, and use the apropiate get.
If you are unsure, using the GetValue(shtCntr).ToString (instead of Getstring(chtCntr))will try to get the field value, and then convert it to string.

Hope this helps

Begginnerdev commented: Thank you! +1
lolafuertes 145 Master Poster

You need to read each row in the table, then decrypt the password field.

You can do it by using a data adapter to fill a datatable, then using a foreach loop analyze each row in the datatable, decrypt the password and update the datatable row.

Finally, use the datatable as datasource for your datagrid.

Hope this helps

lolafuertes 145 Master Poster

I will suggest to do the following to read the line:

if (sr.Peek() > -1) 
   {
       lblhighscore.Text = sr.ReadLine();
   }

This will test if there is some thing to read before launhing the read line function.

Hope this helps

lolafuertes 145 Master Poster

Any error? what is the expected result? can you pot something else that helps us to help you?

lolafuertes 145 Master Poster

With only one filed, you only can add the text explaining the rule, IE:
"Classes:1-9;Books:1;Weeks:1"
"Classes:10-12;Books:2;Weeks:2"
Here, I used the ; sign to separate concepts, I used the : sign to separate Identifiers from their values and used the - sign to separate the bounds.

You can create the filed content easely by concatenating the right words, separators and values.

You can 'decript' the field using the string Split() function 3 times. The first using the ; as separator to get the Keywords and the values, each in a separate string (3 strings in this case).

The second, for each KeywordAndValue string obtained, you can use the Split() function with the : as separator to obtain 2 strings: the Keyword and the Value

The third, for those kywords that have bounded values, you can use the Split() function again with the - as separator, to obtain the lower and upper values.

Hope this helps

lolafuertes 145 Master Poster

Well done. This is a good point to close this thread and start a new one.

lolafuertes 145 Master Poster

Then try

Conn.Open()

before executing the command.

Hope this helps

lolafuertes 145 Master Poster

Please, change the following

Catch ex As Exception
    lblError.Text = "File could not be uploaded. " & ex.Message
End Try
lolafuertes 145 Master Poster

@Codeorder:

Well done

codeorder commented: .as.well.:) +12
lolafuertes 145 Master Poster

Steps on VS2010:
Method A)
1)Select your project
2)Right click and select the option Add
3)Select the option Existing Item
4)On the lower right corner Select the option All Files (*.*)
5)Using the left pane, nevigate to the place where the image or icon is located
6)On the right pane, select the image you want to include and click on the Add button located in the lower right corner.
7)The image is copied into the source folder of your project.
8)On the Solution Explorer select the image and right click. Select the Properties option.
9)On the properties pane, find the Build Action. Change it to Embedded Resource.
10) Save your project

Method B)

1) Select your project.
2) On the VS2010 Menu, select Project, then the las one (yourprojectname properties)
3) Select the resources tab
4) On the top of this form, Click on Add Resource
5) Select the Add existing file
6) Continue with the steeps 4 to 7 of method A)
7) Select the image in the Resources tab, and see the properties pane
8) Find the persistance option and change it to Embedded in .resx
9) Save your project.

Hope this helps

lolafuertes 145 Master Poster

I will suggest to insert

sqlStatement = New SqlCommand()

before

sqlStatement.CommandType = CommandType.StoredProcedure

This will empty the previous contents if any.

Hope this helps

lolafuertes 145 Master Poster

You can find a howto and example here. Another there.


Hope this helps

lolafuertes 145 Master Poster

Lets imagine that a user control has a property called connectors

This property can be a list of conector.

A conector is an object that has an ID, a property Connected with a value of true or false and, if true has a ConnectedTo object of type conector.

Once graphically via drag/drop you 'connect' from connector A of element1 to connector B of element2 you only need to add new conector object in the list of element1 with the id of the source conector, the connected value to true an the destination conector of the element2 selected by the drag/drop.

Once that, if a signal is to be output from the element1, you only will need to search in the list of connectors the connected ones, and send the 'signal' to the referenced element.

A good way to do that is suscribing the element2 input signal yo the output signal of the element1 via events and delegates.

Just a hint.

lolafuertes 145 Master Poster

Well done so far. But... There is always ...

Obviously, you still need to create the temporary table before, but it will need to have all the destination fileds like:

CREATE TABLE #Total(
    InID nvarchar(10)
    ,  InDate datetime
    ,  OrderId nvarchar(15)
    ,  Shipper nvarchar(20)
    ,  Carrier nvarchar(20)
    ,  Qty int
    ,  User nvarchar(20)
    )

I suggested to create a cursor to cicle over every record in the tblIn, but you did'nt.

To create a cursor please read here

I would suggest the following cursor:

DECLARE tblIn_Cursor CURSOR FORWARD_ONLY FOR 
SELECT tblIn.InId as InId, tblIn.InDate as InDate, tblIn.OrderID as OrderId, C1.Companyame as Shipper, C2.ComapnyName as carrier, tblUser.Fname + ' ' + tblUser.Lname As User
FROM tblIn
INNER JOIN tblCompany C1 on C1.CompanyID = tblIn.ShipperID
INNER JOIN tblCompany C2 on C2.ComapnyID = tblIn.CarrierID
INNER JOIN tblUser on tblUser.EmpId = tblIn.EmpId;

Also you will need to declare a few variables and adjust the types according (here only a suggestion):

DECLARE @InId nvarchar(10);
DECLARE @InDate datetime;
DECLARE @OrderId nvarchar(15);
DECLARE @Shipper nvarchar(20);
DECLARE @Carrier nvarchar(20);
DECLARE @User nvarchar(20);

Also you will need:

DECALRE @CountOfTblInventoryDetail int;
DECLARE @CountOfTblWrongRa int;
DECLARE @SumOfTblinBulk int;

Then you can open the cursor and fetch the next record

OPEN tblIn_Cursor;
FETCH NEXT FROM tblInCursor INTO @InId, @InDate, @OrderId, @shipper, @Carrier, @User

Then you will need a WHILE loop like:

WHILE @@FETCH_STATUS = 0 BEGIN
.
.
.
END

Then, to close the cursor and free the resources you will …

bluehangook629 commented: Good stuff +3
lolafuertes 145 Master Poster

Which unhandled exception?
Did you verifyed that have write permissions to the quarantine folder?

lolafuertes 145 Master Poster

As far as I know, not all the infections can be cleaned.
The mechanism other AV use to reecognize a file as being infected, and to be able to remove the infection is out of my knowledge.

How to obtain a Guid?
Using the System.Guid.NewGuid().ToString() you can ogtain a value (like 9245fe4a-d402-451c-b9ed-9c1a04247482) that can be used as the file name.

Example:

Dim QurantineeFileName as String = System.Guid.NewGuid().ToString()
Dim QuarantineeInfoFileName = QuarantineeFileName & ".log"
Dim QuarantineFilder as System.IO.DirectoryInfo = New System.IO.DirectoryInfo ("C:\Quarantine")
If QuarantineFolder.Exists = false Then
   Try
      QuarantineFolder.Create
   Catch ex as Exception
      msgBox("Error creating the quarantine directory: " & ex.Message)
      '
      '   Maybe you want to wait for a Cancel or Retry
      '
   End try
End If
Dim OriginalFile as System.IO.FileInfo = New System.IO.Fileinfo(TextBox1.Text)
Dim DestinationFile as System.IO.FileInfo = New System.IO.Fileinfo(QurantineeFileName)
Dim DestinationInfoFile as System.IO.FileInfo = New System.IO.Fileinfo(QuarantineeInfoFileName)
'
'
'
Do While DestinationFile.Exists or DestinationInfoFile.Exists
   QurantineeFileName = System.Guid.NewGuid().ToString()
   QuarantineeInfoFileName = QuarantineeFileName & ".log"
   DestinationFile = New System.IO.Fileinfo(QurantineeFileName)
   DestinationInfoFile = New System.IO.Fileinfo(QuarantineeInfoFileName)
Loop
lolafuertes 145 Master Poster

With this action, hopefully you reset the router to the default configuration.
Usually, this configuration uses a DHCP server in the router to supply the internal LAN addresses.
Try to connect the router to your lan card using a cable.

In your computer configuration, is there a dinamic address configured (using DHCP) or just a fixed one?

If is fixed, then note the current configuration (to restore it if the next step fails) and try to use the DHCP option for IP Address and DNS.

Disable the lan card and enable it again.

If this option allows you to connect to the router, then using the command IPCONFIG /ALL from a CMD window, will show the current configuration, and hopefully the default gateway is the address of the router.

Most of the routers have a web server that allows you to connect to them using the http://routerAdress from a browser, and there asks for a user id and a pasword.

Here you must have the router documentation in order to know the default pasword, or call the support services of the manufacturer.

Hope this helps

jingda commented: Great advice +11
lolafuertes 145 Master Poster

Answering the question of the quarantined files i would suggest the following:
Always copy the original file to the destination location, then Delete the original file. Never Move.
In order to recover the original file name i would suggest that when copying the original to the destination folder, change the name to a random Guid. Then create a file with the same random Guid + extensioon log (or some thing you define), and write there the info about the original file. This way you will always have pairs of files, the original and the info.

Hope this helps.

lolafuertes 145 Master Poster

Sorry, I am saying that many files can have the same hash value.
Also I am saying that is not possible to replace the hash value of a file with aonther.

As the hash value is the result of a calculation, you can not replace the result of the calculation to 'clean' the original file.

In order to see a simple example, If you have a hash value of 4, wich is the result of adding all the original positive numbers values together, what one is the right original file structure?
Possible answers:
Original has a lenght of 1 with value of 4. (this is easy)
Original has a lenght of 2 with the following possible pairs: 0 + 4 or 1 + 3 or 2 + 2 or 3 + 1 or 4 + 0
Original has lenght of 3 values with : 0 + 0 + 4 or 0 + 1 + 3 or .... 4 + 0 + 0
...
Original has 2Mbytes length: Fill in all the possible values here by your self :( .

With the value of 4, and the examples here, if the result of the calculation is to be 3 istead of 4, wich of the original file values is the right one to be modified? You can only apply the clean process (according to this algotrithm) if the file is 1 byte in length.

As the MD5 hash calculation is …

lolafuertes 145 Master Poster

The MD5 hash returns a 128 bits value (16 bytes lenght and340282366920938463463374607431768211456 distinct results are possible).

But... more than one source for the hash can have the same hash value, and there is no way to know the source for that result.

To know more about the collision results in MD5 please visit the Wikipedia page.

IMO, you should research for another approach to the 'repair' function.

Sorry.

lolafuertes 145 Master Poster

Do you use binary readers to read the file and the guide signatures?
Are always both o the same length?
Do you have a CompareSignatures function to retrieve if the guide signature is the
file signature?
Do you have a ReplaceSignature function?
How do you remove from memory a file already loaded to change their signature?

Just a comment on your delete all process. Lets do an example:
You have 3 Items in the ListBox.
The first Item is the 0, the second is 1 and the third is 2.

You select the first Item 0, kill the file and remove the item from the ListBox.

Actually you'll have 2 Itmes, 0 and 1, then you select the next (+1) SelectedIndex. This will be the 1. and kill the file an remove from the listbox.

Actually you'll have 1 Itmes, 0, then you select the next (+1) SelectedIndex. This will be the 2, probaly throwing an exception.

I would suggest to cicle the SelectecIndex from Items.Count-1 to 0 step -1 to avoid this error.

Hope this helps

lolafuertes 145 Master Poster

Please, post what you have coded so far here.

lolafuertes 145 Master Poster

According to your code, the mywaithandles(0) may have no handle info at all.

I would suggest to sligly change your code to this untested example:

<MTAThread()> Public Sub file_search()
    Dim DD() As String = Directory.GetDirectories(Searcher_path)
    Dim mywaithandles() As AutoResetEvent = Nothing
    Dim currentHandleIdx as Integer = -1
    For i As Integer = 0 To DD.Length - 1
        If is_emty(DD(i))=false Then
            If mywaithandles Is Nothing Then
                ReDim mywaithandles(0)
            Else
                ReDim Preserve mywaithandles(mywaithandles.Length)
            End If
            currentHandleIdx = mywaithandles.Length -1
            mywaithandles(currentHandleIdx) = New AutoResetEvent(False)
            Dim th_info As Threadinfo = New Threadinfo(DD(i), mywaithandles(currentHandleIdx))
            ThreadPool.QueueUserWorkItem(AddressOf searcher_thread, th_info)
        End If
    Next
    If Not mywaithandles Is Nothing then WaitHandle.WaitAll(mywaithandles)
end sub

Hope this helps

lolafuertes 145 Master Poster

Use the string split to separate each line in the source info, using the # as separator char (this will remove the separator from the response.

The string split, will return an array of strings. Each element of hte array will contain one of the lines.

You will need to define a structure containing the 2 strings for Description and service.

Also tou will need a List, of the structure defined, in order to set it as the source for the list box.
For each line, if the line begins with DESCRIPTION (you can verify it using the IndexOf function) then copy the contents (after DESCRIPTION) to a description variable. Else, create a new variable, of the structure you defined, and fill the first field wir the description variable from the description line, and the second field, with the content (after SERVICE) and add it to the list.

After the last line is processed, set the list as data source for the list box, set the list box multicolumn property to true and refresh it.

Hope this helps

lolafuertes 145 Master Poster

I normally install each application in a separate folder, to be able to mantain their assemblies separately, but, there is no restriction to install two or more applications in the same folder.

How the runtime locates assemblies is what determines wich assembly will be used by your application.

Hope this helps

lolafuertes 145 Master Poster

If you have a 'blank' (or any oder separator) between te number and the name, you can use the String.Split(" "c) function, from the Selected Item in the list box.

As the selected Item is the type of Object, you will need to convert it to type string, before using the Split.

Split returns an array of strings, not including the separator. If the ID is the first element then select the element 0 of the returned array.

Hope this helps

lolafuertes 145 Master Poster

I found that in the returned data there is no PartylistName field. You only return the fields Lname, Fname and MI according to your select clause.

Sorry not to see it before.

dr = cmd.ExecuteReader
if dr.HasRows() then
    While dr.Read()
            cbPres.Items.Add (dr("Lname") & ", " & dr("Fname") & " " & dr("MI").ToString())
    End While
Else
    MsgBox "Nothing to show"
End If

Hope this helps