4,901 Posted Topics
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. | |
Re: And your output loop(s) are always going to just output one long string unless you add a Console.WriteLine between the first Next and the second Next. | |
Re: I've been happy with TeamViewer. It can also be set up to allow remote access on unattended machines (to be used with caution). | |
Re: [QUOTE]how do i compare each of them and insert to new array c[/QUOTE] You'll have to be clearer on what you are trying to do. You have a string (not an array as you stated), a, that contains "ABCDEFGHIJKLMNOPQRSTUVWXYZ" and a string (again, not an array), b that contains "RAHMAN". … | |
Re: Without knowing about the structure of your tables, you could have a table just for notes with a structure like *Student_ID *Incident_Date Note Where * indicates primary key (compound key consisting of the first two fields). A compound key would ensure a unique primary key. | |
Re: I can't help you with the error but I do have a recommendation. When you share a folder on the server, do not add individual people into the access list. Instead, create an AD group with the required access rights, then add people to that group. You want to minimize … | |
Re: Tell us what you are trying to do. Saying "I need to keep track of cover charges" doesn't tell us anything. Describe the process. Tell us what you want the user to do and what you want to do with the data. The more info you provide the better we … | |
Re: As far as I know there is no validation done. Even in Excel things are lax. For example, if you set the format for a cell in Excel to "currency", Excel will not prevent you from entering a string (or even warn you). At least not in Excel 2003 (I … | |
I've noticed an appalling number of first time posters who post threads with titles like "Help! Urgent!!!!". The posts can be almost as useless as "I'm trying to program something and I'm getting an error. What am I doing wrong?". It would seem that few people are reading and following … ![]() | |
Re: How about this. [LIST] [*]Put a timer on the form [*]Enable the timer on mouse down [*]Disable the timer on mouse up or max volume reached [/LIST] The timer could be set to an interval so that the min to max volume can be traversed in (for example) five seconds. … | |
Re: The usual procedure is to finalize the database design (table and column names, etc) then code to that design. If the database design is incomplete then you'll just have to modify your code as changes occur. The only other option (at leas as I can tell) is to abstract the … |
The End.