4,901 Posted Topics

Member Avatar for skran

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 <> "" …

Member Avatar for skran
0
271
Member Avatar for Johnbonono

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 …

Member Avatar for Johnbonono
0
443
Member Avatar for jbutardo

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 …

Member Avatar for jbutardo
0
1K
Member Avatar for sylvester3

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?

Member Avatar for sylvester3
0
400
Member Avatar for ashishgh

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 …

Member Avatar for codeorder
0
280
Member Avatar for Bheeman89

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 …

Member Avatar for Reverend Jim
0
647
Member Avatar for Shodow

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 …

Member Avatar for Reverend Jim
-1
290
Member Avatar for NetJunkie

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).

Member Avatar for Reverend Jim
0
199
Member Avatar for mrbungle

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 …

Member Avatar for M.Waqas Aslam
0
200
Member Avatar for dksmall

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 …

Member Avatar for dksmall
0
242
Member Avatar for daydie

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 …

Member Avatar for codeorder
0
205
Member Avatar for jbutardo

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 …

Member Avatar for jbutardo
0
942
Member Avatar for Ziggy713

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 …

Member Avatar for Reverend Jim
0
181
Member Avatar for markdean.expres

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.

Member Avatar for markdean.expres
0
161
Member Avatar for dashawk

You can try [code] select name from Table2 where name not in (select * from Table1) [/code]

Member Avatar for Reverend Jim
0
264
Member Avatar for Ziggy713

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 …

Member Avatar for Ziggy713
0
311
Member Avatar for neh555
Re: WPF

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 …

Member Avatar for Reverend Jim
0
162
Member Avatar for Sevyt

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?

Member Avatar for Reverend Jim
0
236
Member Avatar for roottybrian

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.

Member Avatar for Reverend Jim
0
371
Member Avatar for newbie26

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.

Member Avatar for newbie26
0
176
Member Avatar for jasleen_kaur
Member Avatar for a1a4a

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 …

Member Avatar for Reverend Jim
0
245
Member Avatar for kenth21v
Member Avatar for kenth21v
0
3K
Member Avatar for aishapot

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 …

Member Avatar for aishapot
0
332
Member Avatar for zerofreak

[code] If TextBox1.Text.Contains("$1$") and TextBox1.Text.Contains("abcdefg") and Len(TextBox1.Text) = 32 then MsgBox("hit") End If [/code]

Member Avatar for zerofreak
0
175
Member Avatar for Mike Bishop

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.

Member Avatar for Phasma
0
2K
Member Avatar for benedict3578

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 …

Member Avatar for Reverend Jim
0
153
Member Avatar for aishapot

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 + …

Member Avatar for Reverend Jim
0
199
Member Avatar for VB 2012

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 …

Member Avatar for Reverend Jim
0
214
Member Avatar for azzdog_dev

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 …

Member Avatar for VB 2012
0
265
Member Avatar for fvere

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 …

Member Avatar for VB 2012
0
129
Member Avatar for Alex_2011

[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.

Member Avatar for Reverend Jim
0
110
Member Avatar for jbutardo

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 …

Member Avatar for jbutardo
0
19K
Member Avatar for PF2G

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 …

Member Avatar for adam_k
0
124
Member Avatar for prathapsv3

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]

Member Avatar for Reverend Jim
0
357
Member Avatar for splitter66

I haven't tried this myself but could you use KeyPreview on the form to detect and ignore all Alt key press events?

Member Avatar for splitter66
0
199
Member Avatar for jbutardo

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 …

Member Avatar for Reverend Jim
0
170
Member Avatar for sheepboi

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 …

Member Avatar for archelle
0
147
Member Avatar for markdean.expres

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 …

Member Avatar for Reverend Jim
0
92
Member Avatar for jbutardo

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.

Member Avatar for Reverend Jim
0
2K
Member Avatar for xcarbonx

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.

Member Avatar for Reverend Jim
0
176
Member Avatar for miniru

I've been happy with TeamViewer. It can also be set up to allow remote access on unattended machines (to be used with caution).

Member Avatar for swifttech
0
381
Member Avatar for rahman86

[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". …

Member Avatar for rahman86
0
251
Member Avatar for aishapot

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.

Member Avatar for Reverend Jim
0
121
Member Avatar for hagen

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 …

Member Avatar for swifttech
0
626
Member Avatar for jillwimmersbloo

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 …

Member Avatar for Reverend Jim
0
131
Member Avatar for jbutardo

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 …

Member Avatar for jbutardo
0
552
Member Avatar for Reverend Jim

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 …

Member Avatar for diafol
0
240
Member Avatar for GBignell

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. …

Member Avatar for GBignell
0
185
Member Avatar for discovery-power

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 …

Member Avatar for discovery-power
0
96

The End.