4,901 Posted Topics
Re: You could also use a dictionary as in Dim transform As Dictionary(Of String, String) and populate it where the key is the original char and the value is the replacement. Then you can do the replacement by For Each key as String In transform.Keys TextBox4.Replace(key,transform(key)) Next Caution - this will … | |
Re: Or you could do str = str.Replace("-eng","") | |
Re: Officially, Canada's national sport is lacrosse. | |
Re: You'll have to provide more information and a clearer description of what you are doing. | |
![]() | Re: I like the new feature but I am concerned that this will lead to people posting "bump" and other such empty content just to get their names in the bar. |
Re: A cleaner add would be For Each dRow In dt.Rows Dim item As New ListViewItem(dRow.Item(0).ToString) For i As Integer = 1 To 8 item.SubItems.Add(dRow.Item(i).ToString) Next ListView2.Items.Add(item) Next | |
Re: @happygeek - I totally get it. Especially the pictures thing. | |
Re: A lot of grammar peeves such as **People who don't know how to use reflexive pronouns** "How are are you?" "I'm fine. Yourself?" It's called reflexive because it reflects back. You can say "I will do it myself" because "do" relects back on "me". You can't say "If you need … | |
Re: When I was still working stiff and had time to kill I'd write system integrity softwre (perform various checks and text the standby person if errors), rewrite old apps to improve them or I would learn some new technology, languge, etc. | |
Re: Anyone who lists "Family Guy" as one of their favourite shows is someone who (I think) doesn't take themselves too seriously. In other words, my kind of people. Welcome aboard. | |
Re: I carried a cell phone for the last 10 years I worked. I spent far too much time on 24x7 standby and having my workday repeatedly interrupted with non-emergencies. When I retired in 2008 I swore I would never own another. So far so good. I relish my time without … | |
Re: I hate songs with no originality and lots of repetition. Ever see the guest acts on American Idol? If it wasn't for the background dancers, fireworks, smoke/fog, background videos, etc (most of which give me a headache) who would listen to that crap. Sure, there are a few talented singers/composers/performers … | |
Re: ++ and -- are auto increment/decrement. Yhe following statements are equivalent index++ ++index index += 1 index = index + 1 If you use ++ in an expression, whether you put ++ before or after is important. index = 5 x = index++ y = ++index In the above, x … | |
Re: If you need a directory listing on another machine, assuming you hae rights on that machine, the format is dir \\machinename\sharename Some shares may be hidden and or inaccessible like the defaults C$, D$, etc. | |
Re: The best games are the ones you play with other people in the same room. | |
Re: What database system are you using? Autoincrement fields are a function of the database and are usually integer fields. The DBMS assigns the value automatically. If you want something other than integer then you can select the largest value, strip off the non-numeric part, add one then get the new … | |
Re: If your table has the fields (for example) myBooks ISBN Title Copies Borrowed You can get a list of the number of available copies of all books by SELECT Title, Copies-Borrowed AS Available FROM myBooks If a book gets borrowed and you need to update the table you can do … | |
I was thinking about installing Visual Studio 2012. Does anyone know if I can have both 2012 and VS 2010 installed at the same time without screwing up either or both? | |
Re: The obvious guess would be either TextBox1 isn't defined or sqlDataset isn't defined. Put a breakpoint at the line where you get the error and try to examine both objects. | |
Re: I'm not up on data bound controls so I can't speak to that, but the query shouldn't have single quotes around numeric fields. Try "UPDATE Inventry SET QTY = QTY - " & qqttyy & " WHERE CODE = " & codee Also, you needed a space before "WHERE". If … | |
The code in this snippet (and attached project zip) demonstrates how to use a background worker thread to monitor a network address (name or IP). It shows how to start and stop the thread and how to update controls in the main thread using delegates. It should be simple to … | |
Re: I recall reading that Black Friday is a lot of hype and that there are better prices to be had at other times of the year. Plus you don't run the risk of being trampled to death. Correct me if I am wrong, but I believe it got its name … | |
Re: To start with you can ping another node by My.Computer.Network.Ping(txtWeb.Text) where txtWeb.Text is an IP address or DNS address If you just want to do the occasional ping then that should suffice. If you want to use it to repeatedly monitor another address while you do other things then you … | |
Re: Here is a sample of code that gets values using an OleDbConnection and a DataReader. AddRow just puts the three values into a new ListView Row Private Sub btnOleDB_Click(sender As System.Object, e As System.EventArgs) Handles btnOleDB.Click ListView1.Items.Clear() Dim con As New OleDbConnection("Provider=SQLNCLI10;Server=.\SQLEXPRESS;Database=PUBS;Trusted_Connection=Yes;Connect Timeout=15;") Dim cmd As New OleDbCommand cmd.Connection = … | |
Re: It may be slightly different depending on which version of Visual Studio you are running, but in 2010, you open the project properties and click on "Settings" about halfway down the left panel. Enter a variable name, type and scope then enter an initial value. To load the value into … | |
Re: What line is throwing the error? Why bother converting all of the control values to integers and dates when all you are doing is putting them back into a string? Don't put single quotes around values in the query when the corresponding database field is numeric. | |
Re: I presume that the user enters numbers in all three textboxes then clicks a button to perform some action. In the button_click handler you get the numeric values from all three textboxes then do a comparison and display an error message if the Obtained_Marks value is outside the range. First … | |
Re: >I got a problem getting my code to function That's a darned shame. If you want help then tell us what isn't working the way you'd like. What is your code supposed to do? Any error messages? If so then on what line? | |
Re: I suggest you have a look at TrueCrypt. It is open source and free and I have used it for years. You can create an encrypted file of a user-specified size. Once the file has been created you mount it (via TrueCrypt) as a virtual drive then copy files to/from … | |
Re: Try the following. I don't have a sample database in Access so I haven't tried this query. I used SQL with the COALESCE function (does the same thing as NZ), then did a copy/paste. "SELECT StudentID, NZ(Physics,0) + NZ(English,0) + NZ(Chemistry,0) + " & _ " NZ(Biology,0) + NZ(History,0) AS … | |
Re: **Reason** That's the only way out of most messes. Rational thought. | |
Re: I have no way of knowing where your code is being executed. Is any of the code inside the timer Tick event handlers? For what you are trying to do I would put the following code in the Timer2_Tick handler counter += 1 Label1.Text = counter If counter = 180 … | |
![]() | Re: It looks like you pretty much have it except for the Else (and you should use & instead of + to concatenate strings). If TextBox2.Text = ".\sys\clock" Then TextBox1.Text = TextBox1.Text & Environment.NewLine & "It's " & DateTime.Now Else Textbox1.text = "You didn't use the .SYS\ code" End If |
Re: I posted code in [Retrieve and save to another excel workbook](http://www.daniweb.com/software-development/vbnet/threads/422252/retrieve-and-save-to-another-excel-workbook) a while back which should get you started. | |
Re: If you have to ask the question then the answer is no. | |
Re: You are talking about an incredibly complex program (Outlook) with many thousands of lines of code requiring intimate knowledge of several technologies and it's only your third project in VB? I think you are biting off way more than you can chew. In any case, you are asking for far … | |
Re: It's been a while since I did this from vbScript but this works. Save this code in sampleapp.vbs and create a test widget.xls file to play with. set xls = CreateObject("Excel.Application") xls.WorkBooks.Open "d:\script\dani\widget.xls" With xls.WorkBooks(1).WorkSheets(1) .Cells(2,1) = "Malcolm" .Cells(2,2) = "Delarge" .Cells(2,3) = 855321 End With xls.WorkBooks(1).SaveAs "d:\script\dani\widget2.xls" xls.Quit quick … | |
Re: The easiest way to write out the text is System.IO.File.WriteAllLines(filename, {empIDbox.Text,fnamebox.Text,lnamebox.Text,salbox.Text}) To read it back Dim text() As String = System.IO.File.ReadAllLines(filename) If text(0) = txtUpdateID.Text Then txtUpdateFirstName.Text = text(1) txtUpdateLastName.Text = text(2) txtSalupdate.Text = CInt(text(3)).ToString("C2") | |
Re: Check out [How Do I Put a Number Limit on a TextBox](http://www.daniweb.com/software-development/vbnet/threads/440145/how-do-i-put-a-number-limit-on-a-textbox) | |
Re: If txtUpdateID.Text = False Then Will never work because you are comparing a string to a boolean. The short form of showing/hiding a label depending on a comparison is Enflbl.Visible = txtUpdateID.Text = "some string value" If txtUpdateID.Text is equal to the string value then the label is shown, otherwise … | |
Re: >If TextBox1.Text > 1500 Then Doesn't work because you can't directly compare strings and numbers. Also If TextBox1.Text > "1500" Then won't work because "2" > "1500". If you limit your textbox to entering numbers only then you can do If CInt(TextBox1.Text) > 1500 Then To restrict a textbox to … | |
Re: Well happy birthday to you. I'm almost double that myself but my son at Stony Brook is just one year younger than you. | |
![]() | Re: Ray Lynch - Nothing Above My Shoulders But the Evening. |
Re: As far as I know, Access does not support temporary tables. However, you can create a table on the fly with SELECT INTO as in SELECT * INTO temptable FROM Customers WHERE Address LIKE '*C*' Just remember to drop the table when you are done. | |
This request arose from the discussion [OPINION: Who thinks MAKING A POST on these forums is horrible](http://www.daniweb.com/community-center/daniweb-community-feedback/threads/439477/opinion-who-thinks-making-a-post-on-these-forums-is-horrible). My comment on that thread was >If I am not logged in and I click on a link in my email, I am taken to that post. I can start typing a response … | |
Re: You can simplify the coding and make it more obvious by using this pseudo-code. It eliminates some unnecessary testing and setup. set low and high range for guess (lo=1 hi=100) read user number loop calculate guess as hi - (hi-lo)/2 if this is the correct number then exit loop if … | |
Re: What program was used to create the file? Do you have the code that was used? |
The End.