4,911 Posted Topics
Has anyone ever put together a map or table that shows the distribution of DaniWeb members across the globe? I don't know if such an analysis is possible but it might be interesting to see, roughly, where everyone is. | |
Re: How many items do you have in your ListView? Use the debugger and put a breakpoint at line 8 then compare your ListView items with the index. Also, get rid of the goto. If you must use a loop then use a structured loop. | |
Re: My two cents - you try to open the database (lines 14-22) but you continue on and try the query even if the database doesn't open. If the open fails then you should not try the query. | |
Re: We used IBM Thinkpads at the office for years. I was so impressed with the quality that I bought one for my younger son when he graduated from high school in 2003. It's been through the mill but it is still running. These things are rugged and dependable. When we … | |
Re: Instructions on how to save settings can be found [here](http://www.daniweb.com/software-development/vbnet/threads/427539/automated-reference-number-and-save). | |
Re: You can simplify the loops by using For Each phCheck As CheckBox In Me.Controls.OfType(Of CheckBox)() That will iterate through only CheckBox controls. | |
Re: Wasn't this already asked and answered [here](http://www.daniweb.com/software-development/vbnet/threads/429049/how-to-replace-a-line-of-a-txt-file)? | |
Re: You run a query on the database to determine if the room is booked for the requested time. I can't be any more specific becuase you haven't provided any details. But as an example, assuming that bookings are for one hour periods, then the query select * from bookings where … | |
Re: System.Convert.ToInt32("9a12c",16) As long as the first argument is a string representation of a hex value this will work. In the general case, the first argument is a string and the second argument is the base so you could also use this to convert other bases such as System.Convert.ToInt32("203",8) which would … | |
Re: You'll have to read all of the lines into an array, modify the requested line, then write the array back out to the file. All you are doing is modifying the line in memory. Dim lines() as String = IO.File.ReadAllLines(MYFILE) For i As Integer = 0 to Ubound(lines) If lines(i).Contains(... … | |
Re: I don't recall that we ever had a view counter. Of course, that could just be me. | |
Re: You can start by setting the values of min and max outside the loop as follows Dim min As Integer = Integer.MaxValue Dim max As Integer = Integer.MinValue InputBox returns a string so you can't assign it directly to a numeric variable. You have to convert it. However, just because … | |
I happened to be browsing the code snippets in vb.net and I noticed that in the thread list, a code snippet I contributed a while back is credited to "Reverend Jim", however when you go to the [actual snippet](http://www.daniweb.com/software-development/vbnet/code/423678/create-controls-at-run-time-with-events), it is listed as >By It's just a nickname on May … | |
Re: Tell me in English (not in code) what you want (not just the last part put the whole thing) and I'll see if we can come up with something simpler. | |
Re: You don't need to create a bootable disc (or USB) to install Office. You have to have Windows running in order to have somewhere to install Office to. You only need to create bootable media in certain cases such as * to install or reinstall your operating system * to … | |
Re: First you get the "sermon". Since you are required to write pseudocode anyway, write it first, then prefix each line of pseudocode with a single quote. There. You have just created all of your code comments. Now add the actual code. End of sermon. Now a few suggestions. InputBox("Values must … | |
Re: In SQL, to select the largest value from a set of values you use the MAX function as in select MAX(citation) from myTable | |
Re: I'm a big fan of letting the computer do as much as it can for you. Generally, the less code I have to write, the fewer chances I have to introduce a bug. In that case: Dim mylist As New SortedList(Of Date, String) For Each line As String In System.IO.File.ReadAllLines("d:\temp\test.txt") … | |
Re: My.Application.CommandLineArgs returns an array of strings, one string per argument | |
Re: The answer is "it depends". It depends on the type of database (Access, SQL, mySQL, etc), and it depends on the actual data in the field. You can use wildcards in SQL queries such that if your query looks like select * from myTable where MovieName like 'Rocky%' then the … | |
Re: You have to use a ListView in details view if you want to use different colours for each line. You can do it as follows: Dim item as New ListViewItem() item.Text = "Bad" item.ForeColor = Color.Red ListView1.Items.Add(item) | |
Re: I can't imagine how you would do this. When the power goes out your computer goes down immediately. If you have a UPS then the computer doesn't know the power is out. If you have a UPS that can send an event to the operating system then you have to … | |
I just submitted a code snippet for the competition [here](http://www.daniweb.com/software-development/vbnet/code/428716/using-detached-recordsets-to-sort-data). I entered my description/documentation, then entered the code after clicking on "Code" and pasting in the code window. I submitted the post and was then presented with another window saying "a fully working code snippet must be entered". So I … | |
Re: You just have to change the name of the server in the connection string. You may have to get the DBAdmin to set up access rights for you. | |
Re: I'd have your company lawyer contact the former admin. | |
Re: For once I find myself in complete agreement with Rashakil. If you are looking to better your job prospects then take a programming job, any job, that will get you experience. Programming in University is nothing like programming in the real world. In my opinion (and it is just my … | |
Re: Use & instead of + to concatenate strings | |
Re: The only time I ever had to program in binary was on an GE SPPC (stored program process controller) micro computer from 1979-1982. There were no symbolic debuggers (or debuggers of any type) at that time. To debug, you hand assembled some debug code then patched it into unused memory … | |
Re: It would help to know something about the input data. Are the lines in each file unique (within that file) or are there possibly duplicate lines? How big are the files (can you state an approximate maximum number of lines?). You read file 2 once for each line in file … | |
Re: You don't say what database you are using. If it is SQL then you can use the COALESCE function in the query. This function is used to replace NULL values with default values. For example: select LastName,MiddleName,FirstName from myTable May return NULL values for MiddleName, however, the query select LastName,COALESCE(MiddleName,"(none)"),FirstName … | |
Re: I think the easiest way would be to create your own msgbox form. Make sure it has a fixed width font like Courier New and display is as Modal. | |
Re: The easiest way to check is to use a regular expression. Here is an example for your particular requirements: Imports System.Text.RegularExpressions Public Class Form1 Private Sub btnTest_Click(sender As System.Object, e As System.EventArgs) Handles btnTest.Click If Regex.IsMatch(txtTestStr.Text, "^[2-9]\d{2}-\d{3}-\d{4}$") Then txtResult.Text = "Match" Else txtResult.Text = "No Match" End If End Sub … | |
Re: "Something like" code can't be debugged. What I can do with what you have shown is offer some code that does what I think you want. The following scans the "My Documents" folder on my D: drive and colours the lines based on the age (in months) if the files. … | |
Re: Have you looked at [autoit](http://www.autoitscript.com/site/). There is a component, AutoitX, that can be created and used from within vb. | |
Re: How do you propose to click a button in a form that has not yet been opened? And why would you want to? | |
Re: Or even TextBox.Visible = Ctype(sender,CheckBox).Checked | |
Re: Try For Each Info As String In System.IO.File.ReadAllLines(AccFileR) Info = IDecode.decryptString(Info) 'Debug.WriteLine(Info) Accounts.Add(New Account(Info.Split(CChar(",")))) My.Forms.Main_frm.AccNumber.Items.Add(iCount) iCount += 1 Next | |
Web Site Not Responding I was trying to go to a thread this morning (06:20 Winnipeg time) and DaniWeb wouldn't display it. All I got was >The connection to the server was reset while the page was loading. I tried several times with the same result. In order to determine … | |
Re: When the picturebox is loaded with a picture you could put a string into the Tag property. When you click on the picturebox you can copy the Tag value to the TextBox. | |
I was trying to find a code snippet so I used the advanced search with the following parameters: Query String = encryption Forum = --VB.NET Type of Article = Code Snippet It came back with "No Results" When I did a manual search of code snippets under vb.net I found … ![]() | |
Re: If you want to handle all textboxes the same way you can create two generic handlers such as Private Sub TextBox_GotFocus(sender As Object, e As System.EventArgs) sender.BackColor = Color.LightGray End Sub Private Sub TextBox_LostFocus(sender As Object, e As System.EventArgs) sender.BackColor = Color.White End Sub then on form load you can … | |
Re: Or if you can't or don't want to group the controls, set the Tag property of each to some known value then test in a loop like For Each ctrl As Control In Me.Controls If ctrl.Tag = "my value" Then ctrl.Enabled = True End If Next | |
Re: To do that you create an installer package. When a user runs the installer it copies all of the files needed to run the application to the user's computer. You can find detailed instructions [here](http://msdn.microsoft.com/en-us/library/k3bb4tfd.aspx) | |
Re: And why is it called the “God particle”? Like God, it is everywhere but hard to find, goes the quip. In fact, the origin of the name is rather less poetic. It comes from the title of a book by Nobel physicist Leon Lederman whose draft title was “The Goddamn … | |
Re: Is it possible you have the wrong encryption settings for tis particular wireless connection? It's possible that one end is set to WEP and the other to WPA. Are you being prompted for a network key when you try to connect? | |
Forget the problem with commercials being blasted at you, I've noticed in a few of my regular shows lately, noticibly Burn Notice and Royal Pains, dialog is at one volume level, and the music that plays between scenes (camera pans over scenery/cityscape, etc.) is at three times the volume. It … | |
Re: >It converts information from hundreds of Excel documents into a few small text files Let's assume your Excel files are named ss-0001.xls, ss-0002.xls, etc. I'm guessing you have two processes at work here. One process runs independently of the GUI app and renders many Excel files into a few text … | |
In case no one has mentioned it before, I just want to say a public thanks to Davey for all of the interesting news items he finds the time to write up and post. | |
I think it would be nice to include the original posting date when a related article is suggested. I'd be more inclined to check it out if I knew the article was less than a few months old. More than a year, not so likely. |
The End.