4,911 Posted Topics
Re: [QUOTE]I wrote a code that stores three names[QUOTE} Your code actually stores 4 names. [QUOTE] - Make the user select a number (from 1-3) by using a (combobox) - If the user select the proper number then a message will appear that the name is there. [/QUOTE] How do you … | |
Re: If pressed, I would say number 4. Counters are incremented by fixed amounts. The increment in number 4 varies depending on the current value of counter. Technically, number 4 could be a counter if (for example) in a loop, the number of things you are counting doubles each time. Then … | |
Re: I would create an array of denominations ordered from largest to smallest. Then I would create a while loop that runs while the balance (cash - cost) is greater than zero. An inner loop would select denominations from largest to smallest and determine how many multiples of each could be … | |
Re: I don't know if COALESCE is available under Access (but it is under SQL). It takes a variable number of arguments and returns the first value that is non NULL. If you call it like COALESCE(MAX(Column),0) it may give you what you want (again, assuming it is supported under Access). | |
Could somebody please put a sticky post like [URL="http://www.daniweb.com/software-development/python/threads/366794"]this[/URL] at the top of the VB.NET forum? It's gotten to the point where people are now posting blocks of uncommented code and no actual question. It might help if the first thing at the top of the page was [B][COLOR="Red"]"Read This … | |
Re: As a rule it is considered prudent to provide more than just a block of uncommented code and no actual explanation or question. What is the code supposed to do? How does this differ from what the code actually does? Are you getting any errors? What does your input look … | |
Re: I'm not sure what you mean by validate the file size. You can get the file size by [code] My.Computer.FileSystem.GetFileInfo(filename).Length [/code] Typically you would validate it by uploading it then comparing the size of the uploaded file to the size of the local file but you say you want to … | |
Re: You could use an Access database or an Excel spreadsheet. There are connection strings available for both of these. Even CSV files as I recall. | |
Re: The process I would use is as follows: [code] create an Excel application object create a workbook select the first worksheet set row index to first row for each selected csv file set column index to first column for each line in this file for each field in this line … | |
Re: First thing I would check is whether the query string on line 51 actually contains the query to delete the record you want. For example, if b doesn't have the value you expect then the query won't delete what you want. As for why the record is not being deleted … | |
Re: You could build the query like [code] Dim query As String = "select * from Incidents" If txtDMA.Text <> "" Or txtStreet.Text <> "" Then query &= " where " If txtDMA.Text <> "" Then query &= "DMA = '" & txtDMA.Text & "'" End If If txtStreet.Text <> "" … | |
![]() | Re: Some of this code is mine and some is not. It is an example of how to build a GUI for a console application. In this case, the application is md5sums.exe, which takes a file or folder name as an argument then calculates a checksum for the file, or all … ![]() |
Re: Not sure how to answer that other than to ask what specific things you expect to be able to do, then address those things one by one. If the data is in a regular format (like a table where all rows are the same) then there should be no problems … | |
Re: I set up a test exactly as you specified and my text file contains A B C D E F Can you possibly post a screenshot of your app running? | |
Re: I came across this piece of code once while trying to solve a similar problem. See if this helps. [code] Private Sub releaseObject(ByVal obj As Object) Try System.Runtime.InteropServices.Marshal.ReleaseComObject(obj) obj = Nothing Catch ex As Exception obj = Nothing Finally GC.Collect() End Try End Sub [/code] According to the person who … | |
Re: What error message do you get when you try to connect? It is possible you don't have the correct access rights or that you misspelled the server name. Try changing the server name from "VNET-PC\SQLEXPRESS" to ".\SQLEXPRESS". Do you have SQL Server Management Studio installed? Can you verify that you … | |
Re: Let's try to narrow this down. I'm guessing that you have a database that you want to be able to search. The user is presented with a listview containing predefined search strings. The user (possibly) selects an item in the listview. This causes the database to be searched for the … | |
Re: You can get the list of files with [code] Dim filelist() As String = System.IO.Directory.GetFiles("c:\windows\system32") [/code] Use a class variable to keep track of which file name to display next. The timer tick handler can advance the index (and wrap to zero if you want to repeat). | |
Re: I find it useful to type these lines into a non auto-formatting window (Notepad, for example) then copy and paste into VB once it looks right. I suggest adding a line to display the connection string before you connect so you can verify that the string you see is the … | |
Re: This will do it quick and dirty [code] Public Class Form1 Private groups(3) As GroupBox Private Sub Form1_Load(sender As Object, e As System.EventArgs) Handles Me.Load Me.SuspendLayout() 'create 4 groups For g = 0 To 3 groups(g) = New GroupBox With groups(g) .Text = "Group " & g .Size = New … | |
Re: You haven't declared X to be of any particular type. TextBox5.Text is a string and you are adding one to it so I presume that makes X an integer (assuming it is declared at the class level). In your Do Until statement you are comparing X (possibly an integer) to … | |
Re: Let me get this right. You have a dataset in an Excel spreadsheet that may or may not have the field names in the first row. Why not just open it with Hdr=No and examine the first record (row) in your code? If there is a row header then you … | |
Re: Use [code] Query = "INSERT INTO PROD_DB_Complete_Board _ (ID, [Board Size], Laminate, [Stock Level]) _ Values('" & TextBox4.Text & "','" _ & "'" & TextBox2.Text & "','" _ & "'" & TextBox3.Text & "','" _ & "'" & TextBox1.Text & "')" [/code] It's easier to see the problem when the … | |
Re: I would imagine Process.Kill or Process.Close and if that fails you can always shell out to kill.exe or (if you download the free SysInternals suite) pskill.exe. | |
Re: You can try [code] select name from Table2 where name not in (select * from Table1) [/code] | |
Re: Change it to [code] Query = "update Prod_DB_Laminate_Raw set [Stock Level] = '" & TextBox1.Text & "' where Laminate = '" & ComboBox1.Text & "'" [/code] Wnen you run into a problem like this it is best to display the actual query string as submitted to SQL. In most cases … | |
Re: WPF is Microsoft's attempt to create a modeling environment that is consistent across platforms, whether your desktop or your browser. Until WPF, developers had to use one set of controls for each. The intention is to have once common set of controls (with consistent behaviour) for both desktop and web … | |
Re: Are you searching an archive, a file hierarchy or a database? You seem to be referencing all three. And I am not sure what you mean by a cabinet? What, exactly, is the format of the stuff (for lack of a more precise term) that you want to search? | |
Re: Value added note - you may want to check out this entry at [URL="http://ask-leo.com/cutepdf_writer_create_pdfs_from_any_application_that_can_print_.html"]Ask Leo[/URL]. He prefers Cute PDF Writer because he claims PDF Creator now installs unwanted software. | |
Re: The first thing that comes to mind is to check if anything in your code is setting the button state to visible. If you find any code that does this then set a breakpoint at that line and rerun. | |
Re: Perhaps [URL="http://msdn.microsoft.com/en-us/library/k3bb4tfd.aspx"]this[/URL] will help. | |
Re: I think something like that is more suited to vbScript than VB. The following script takes 2 arguments, infile and outfile. Infile contains the unfiltered dictionary (one word per line). Outfile is the file to contain the filtered words (will be created if it does not exist). Here is the … | |
Re: You have to show us what code you have in order for us to see where it is going wrong. | |
Re: I'm assuming you are keeping the data in some sort of database (text, XML, Excel, Access, SQL, etc). In that case you wil have to create a table to keep track of the additions. Keep more info rather than less. For example, you asked how to keep track of the … | |
Re: [code] If TextBox1.Text.Contains("$1$") and TextBox1.Text.Contains("abcdefg") and Len(TextBox1.Text) = 32 then MsgBox("hit") End If [/code] | |
Re: Are thr rows contiguous? For example, If I scan down a particular column, can I assume that the first blank cell I encounter indicates the end of the rows? If so I can provide some simple code to do what you want. I'll look it up and post it here. | |
Re: Same question that has been asked a hundred times before - what have you got so far? I presume this is for an assignment as I cannot think of any other reason to write this. We don't do your homework for you. Show us what effort you have gone to … | |
Re: You can select the current maximum studentID for a given year by select MAX(StudentID) from Table1 where StudentID between 201100001 and 201199999 Once you have that you can split it into yearpart and idpart by yearpart = result \ 100000 idpart = result mod 100000 next studentID is 100000*yearpart + … | |
Re: I need more details. By size (of the listbox) I presume you mean the number of entries in the listbox. What do you mean by "adding a process to the listbox"? And why are you comparing the listbox size to a size in task manager? I also don't know what … | |
Re: You can't add code at runtime because VB code has to be compiled. However, it is still very useful to be able to add controls at runtime. For example, I wrote a version of Scattergories last summer. The number of players can vary from game to game so it is … | |
Re: Read books. Write code. You learn to draw by drawing. You learn guitar by playing. Programming is the same. Wrox Press has several good books on VB programming. Also, Sybex. Check their websites. Books that claim that you can "Learn Visual Basic in 24 Hours" or even a week are … | |
Re: [code] Public Class Form1 Private Sub btnAdd_Click(sender As System.Object, e As System.EventArgs) Handles btnAdd.Click ComboBox1.Items.Add(Now) End Sub End Class [/code] Each time you click "Add", the current date/time will be added to the combobox. Just replace the argument with the text you want to add. | |
Re: If you just want a simple text file then you only require simple text output (make sure you open the log file in append mode). I have a suggestion that should be obvious but wasn't to some of our in-house developers. Make sure every line that you write to the … | |
Re: I'm not sure what your intention is in Sub Admin_Reg_Load but the logic is [code] if the connection is closed then open it else close it end if [/code] I can't imagine why you would need a Sub to toggle the state of the connection. Usually you would have code … | |
Re: You can also install (free) CutePDF Writer. This is a (pseudo) printer driver. When you print to it (select it as a printer) it creates a PDF file. You can download it at [url]http://www.cutepdf.com/products/cutepdf/writer.asp[/url] | |
Re: I haven't tried this myself but could you use KeyPreview on the form to detect and ignore all Alt key press events? | |
Re: dim myarray(20) as parts This will create an array where each item can contain a reference to a part, however, the objects themselves do not exist until they are instantiated (with New). In order to actually create an array of part objects you have to do [code] for i as … | |
Re: You are going to need a counter to keep track of the number of correct answers. This will be a class level variable which will go after the "Public Class Form1" line (your actual class name may differ. The line will look like Private numCorrect As Integer You can set … | |
Re: The first step is to set the form property KeyPreview to True. Once you have done that you can add a form level handler to process keys. A sample one (from one of my projects) is [code] Private Sub frmMain_KeyPress(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyPressEventArgs) Handles Me.KeyPress 'This … | |
Re: The easiest way would be to split it into three strings as mystring.Split("\") then validate each field separately. A more complicated way would be to use a regular expression. |
The End.