4,911 Posted Topics

Member Avatar for codeorder

ON ERROR RESUME NEXT is a holdover from the days before TRY-CATCH. It is still used in vbScript where the TRY-CATCH is not available. It was the only way to prevent your program from crashing on an error and typically resulted in endless error checking tests (ugly) such as on …

Member Avatar for codeorder
0
4K
Member Avatar for collin_ola

You can do this in one step as Sub Main() Dim text As String = "line 1" & vbCrLf & "line 2" & vbCrLf & "line 3" & vbCrLf Dim path As String = My.Computer.FileSystem.CurrentDirectory Dim file As String = System.IO.Path.Combine(path, "myfile.txt") System.IO.File.WriteAllText(file, text) End Sub Modify the value of …

Member Avatar for Reverend Jim
0
102
Member Avatar for Reverend Jim

This code demonstrates how to add controls to a form at run time. The number of rows and columns, the spacing between the controls and the size of the controls are all determined by Consts, but this could easily be changed so that the parameters are user entered. My example …

3
670
Member Avatar for cascer1

If you have a Windows 7 install CD/DVD you can boot from that. When the Install Windows page appears, click Repair your computer to access system recovery options. I hope this helps.

Member Avatar for cascer1
0
230
Member Avatar for Reverend Jim

You'll undoubtedly get a lot of postings on this, but none of the buttons (Bold, Italic, Code, etc) controls on the forum are doing anything. I click and nothing happens.

Member Avatar for Dani
0
66
Member Avatar for bazzer14

Docx files are created using newer versions of Microsoft Office Word. By adopting new file formats, Microsoft forces users of older versions of Word to upgrade needlessly thereby generating more obscene profits. But I'm not bitter.

Member Avatar for bazzer14
0
139
Member Avatar for VB 2012

Create a listview control Set the View property to Details Right click on the control and select Edit Columns Add (and name) the columns you need (let's make it 3 columns) Declare a listviewitem variable Dim newitem As ListViewItem For each row you want to add do newitem = New …

Member Avatar for Reverend Jim
0
101
Member Avatar for Sevyt
Member Avatar for Reverend Jim
0
183
Member Avatar for Gus_19

Once you are in the Closing event handler you don't have to call Close() again. Here is a sample from one of my projects. It maintains a book library. When the user tries to exit the app it checks if there are unsaved changes then prompts the user for what …

Member Avatar for Gus_19
0
407
Member Avatar for Iamkenny

A couple of suggestions, if I may, while we wait for the info requested by Beginnerdev... Because you are only retrieving one column (catNo) in your first query, you should specify that column rather than \* in your query. The purpose of the query is clearer and (if you are …

Member Avatar for Reverend Jim
-1
166
Member Avatar for themaj

If you set the forms KeyPreview property to True you can use the following code Public Class Form1 Private Sub Form1_KeyPress(sender As Object, e As System.Windows.Forms.KeyPressEventArgs) Handles Me.KeyPress If Me.ActiveControl.GetType = GetType(TextBox) Then Me.Text = e.KeyChar Select Case e.KeyChar Case "0" To "9" Case Chr(Keys.Back) Case Else e.Handled = True …

Member Avatar for themaj
0
156
Member Avatar for Gus_19

How are you opening/modifying/saving the data? Please post your code so we can tell you where you are going astray. Are the duplicate rows being inserted or are they being appended to the worksheet?

Member Avatar for Gus_19
0
201
Member Avatar for nmges

if you Import System.Text.RegularExpressions then you can use the following test If RegEx.IsMatch(textbox.Text,"\d{4}\.\d{2}") Then 'the text matches the pattern ####.## Else MsgBox("the text must be in the form ####.##") End If 'or if you don't want to do the import you can fully qualify as If System.Text.RegularExpressions.RegEx.IsMatch(textbox.Text,"\d{4}\.\d{2}") Then 'the text …

Member Avatar for Reverend Jim
0
169
Member Avatar for Mike Bishop

Dim tokens() As String = "17:55:88".Split(":") This will give you an array with indices from 0 to 2 where tokens(0) = "17" tokens(1) = "55" tokens(2) = "88"

Member Avatar for Reverend Jim
0
128
Member Avatar for Reverend Jim

I know you are busy fixing bugs and tweaking (and I very much appreciate the effort) but I have a suggestion to slightly tweak the email notification. The old system would not send an email to tell me that there was a new posting on a watched thread if the …

Member Avatar for Dani
0
194
Member Avatar for arabgogs

It sounds like you are willing to get technical. A really good book is Object Oriented Analysis and Design by Grady Booch. Daniel R. Clark also has a book, Beginning Object-Oriented Programming with VB 2005 From Novice to Professional.

Member Avatar for Reverend Jim
0
145
Member Avatar for choosechrist

The items in a treeview already have a + or - symbol to the left which when clicked will show or hide child nodes.

Member Avatar for Reverend Jim
0
126
Member Avatar for oskole

> Dim regBaseKey new As RegistryKey = Registry.LocalMachine Instead of Dim regBaseKey new As RegistryKey = Registry.LocalMachine try Dim regBaseKey As New RegistryKey = Registry.LocalMachine

Member Avatar for thines01
0
90
Member Avatar for s98samman

You are trying to assign a string value to an integer variable. In order to do the assignment you should first (as stated by jwdunne) determine that the conversion is possible. If the conversion is possible you can use Convert to do the conversion as in Dim b As Integer …

Member Avatar for JGorard159
0
563
Member Avatar for bigzos

In that case you are misusing the term "exact". Unless you mean you want a result of 1 when the difference is exactly one year. If you are not interested in fractions of a year then do as was suggested and find the difference in days then take the integer …

Member Avatar for poojavb
0
135
Member Avatar for kiyu2keith

You could do For Each s As String In {"0", "12", "345", "6789"} Debug.WriteLine(s) Next

Member Avatar for kiyu2keith
0
567
Member Avatar for abc_123abc

Can you please clarify? What are the contents of the text file and how do you want it parsed to go into the datagrid? What is the layout of the datagrid? An example might be "I have a text file containing lines of comma separated values. I want to display …

Member Avatar for Begginnerdev
0
3K
Member Avatar for Reverend Jim

REF: http://www.daniweb.com/software-development/vbnet/threads/422252/retrieve-and-save-to-another-excel-workbook I submitted a post recently. The post did not appear, even when I refreshed, then closed and reloaded the page. This has happened before so, fortunately, I had copied my post text to the clipboard. I submitted the post again. This time is was accepted and displayed. When …

Member Avatar for Reverend Jim
0
127
Member Avatar for poojavb

What you are describing is more of an *irregular* expression. Your character classes need not be in any particular order. I believe you are far better off handling the validation in code. This will be clearer and more maintainable. Also, your requirements appear to be in conflict > atleast one …

Member Avatar for poojavb
0
250
Member Avatar for mancode1007

In English, what is your query supposed to do and what happens when you run it?

Member Avatar for wen_cai
0
166
Member Avatar for bigzos
Member Avatar for bigzos
0
625
Member Avatar for maharjun

The only difference I have seen in various defraggers is the minimum free space required for them to work. At the time (pre Windows 7) PerfecDisk worked with as little as 5% free space. Since I installed Windows 7 I have not bothered to install a third party defragger.

Member Avatar for breactiv
0
167
Member Avatar for prancode

First step is to search this forum. That's what the big SEARCH box at the top is for. If you do that you will find [this code](http://www.daniweb.com/software-development/vbnet/code/366392/encryption-and-decryption-functions-in-vb.net)

Member Avatar for Reverend Jim
0
245
Member Avatar for renzlo

If you are using a recent version of SQL server (2005 or newer) you can use the new ranking functions. Your specific query to generate the above results would be SELECT TOP 5 RANK() OVER (ORDER BY IAVERAGE) AS Rank, USERNAME,ICOUNT,IAVERAGE,DATE_LOGGED FROM MyTable WHERE IAVERAGE > 0 AND DATE_LOGGED='05-07-2012' RANK() …

Member Avatar for renzlo
0
380
Member Avatar for PDB1982

Silly question - why not just have one field on the form for "name"? What possible reason is there to have it more than once if you are just going to replicate it?

Member Avatar for ChrisPadgham
0
290
Member Avatar for sidyusuf

Do you need help with the database update as well? The answer would depend on whether you need help with the query itself or the connectivity. And the answer may depend on what type of database you are using and how you are storing the date/time value.

Member Avatar for poojavb
0
1K
Member Avatar for NiTeHaWk4787

You can define one handler to be used for all of the buttons and determine which button was clicked by checking the Text property in the event handler. Can you be more specific as to what you mean by "five separate functions for each button's click event"?

Member Avatar for Gé48
0
120
Member Avatar for Reverend Jim

Yesterday I clicked "Mark Forum Read" in the VB.Net forum. Today I am seeing articles for which the most recent postings are 2-3 days old being flagged as NEW.

Member Avatar for Dani
1
64
Member Avatar for jprs.22

I rather doubt it. In four code mudules you have around 6 comments, mostly consisting of 2-3 words and those are in Spanish. You haven't said where in the code you are having the problem (apparently it is up to us to scan through undocumented/uncommented code and figure it out)., …

Member Avatar for Reverend Jim
0
122
Member Avatar for waleed.makarem

Instead of asking how to implement a particular solution, you may want to ask youself if the solution you have picked is appropriate for the problem you are trying to solve. Perhaps if you tell us the underlying goal we may be able to offer a better approach.

Member Avatar for Reverend Jim
0
1K
Member Avatar for Iamateur

When you insert a record, no other records are affected. A typical insert looks like insert into [tablename] (list of field names) values(list of field values) In this case, only one record is ever inserted. To delete a record the format is delete from [tablename] where [sequence of fldname=value clauses] …

Member Avatar for Reverend Jim
0
205
Member Avatar for Reverend Jim

I know it's been busy with the rewrite and tweaking but I haven't seen a newsletter issued in ages.

Member Avatar for Reverend Jim
0
57
Member Avatar for seek

You select records from a database using the SELECT statement. You can select all fields or a series of named fields. For example select * from Employees select FirstName, LastName, Salary from Employees The first statement selects all fields, the second selects only the named fields. All records in the …

Member Avatar for Reverend Jim
0
165
Member Avatar for Iamateur

What are the items in each and how are the items in combo2 supposed to be restricted after combo1 is selected?

Member Avatar for Reverend Jim
0
148
Member Avatar for Reverend Jim

I'm confused (not an uncommon state lately, I'm afraid). A short time ago I posted some VB code using the CODE button. In response I was told by pyTony that I should be using fences. Today when I went to post some code, the posing area had a large banner …

Member Avatar for Dani
0
195
Member Avatar for vijaybrar

How about [code] Private Function Rotate(ByVal s As String, ByVal places As Integer) places = places Mod s.Length If places < 0 Then places += s.Length Return Mid(s, places + 1) & Mid(s, 1, places) End Function [/code] Try a few values (positive and negative) for "places". Note the "mod" …

Member Avatar for Reverend Jim
0
157
Member Avatar for bettybarnes

Keep in mind that just because you can solve a problem with recursion it doesn't mean that you should. Traversing a binary tree is a good example of where recursion is desirable, and actually produces clearer code than alternatives. Calculating factorials is a usual example to teach recursion. But that's …

Member Avatar for Reverend Jim
0
86
Member Avatar for bigzos

To make it more general you could replace >= 2009 with DATEPART("YEAR",GETDATE())-3

Member Avatar for bigzos
0
99
Member Avatar for Begginnerdev

It sucks (abandoning WinForms). I'm awfully tired of Microsoft pushing their "latest and greatest", then abandoning it for the next "latest and greatest". Because I develop apps only for my personal use I will likely just continue usinig WinForms under Visual Studio 2010 as long as it continues to run. …

Member Avatar for Begginnerdev
0
176
Member Avatar for tariqi2011

Can you please clarify? An inner join is used to create a virtual (temporary) table that is the result of combining two other tables based on a (single) common column. Perhaps if you posted the schema of the two tables, and the schema of the virtual table you want as …

Member Avatar for tariqi2011
0
206
Member Avatar for jbennet

Can we get back the ability to sort the threads based on the starting date? The first thing I always did when going into a forum was set the display to show newer threads first. Perhaps this could be added as a default in the control panel.

Member Avatar for Airshow
0
2K
Member Avatar for Sahil89

There is no event that I am aware of that triggers when you open a file from within your program. You don't need an event triggered because you are already executing code, starting with the method you called to open the file. As for "open with", you can set your …

Member Avatar for Sahil89
0
95
Member Avatar for Gé48

Post your code. When I used the following code it worked fine. ~~~ vb Private Sub ListBox1_SelectedIndexChanged(sender As System.Object, e As System.EventArgs) Handles ListBox1.SelectedIndexChanged TextBox1.Text = ListBox1.SelectedIndex End Sub ~~~

Member Avatar for Reverend Jim
0
219
Member Avatar for jrlittle86

You can find a step-by-step tutorial [here](http://msdn.microsoft.com/en-us/library/k3bb4tfd.aspx)

Member Avatar for Reverend Jim
0
320
Member Avatar for Begginnerdev

That's somewhat different from the old style of code tags and definitely not intuitive. Is there any place that explains how the new system works? For example, as I am typing, the code tag in the first sentence is blue and underlined and everything following that is red. I don't …

Member Avatar for Dani
0
295

The End.