4,901 Posted Topics

Member Avatar for Reverend Jim

This is a short bit of code that shows how to implement sorting on columns in a details-mode ListView. Suggestions for improvement are always welcome. One possible improvement would be to modify the column headers to indicate which column is being sorted and in which direction.

0
2K
Member Avatar for achilleus1234

Depending on how the smaller image was made you may not get a match comparing pixel by pixel. I have found that even using a (supposedly) lossless crop on jpg source files there are differences in at least one pixel. However, if your source files are bitmaps you should find …

Member Avatar for Reverend Jim
0
324
Member Avatar for ravi.kant.984349

You just replace ".\SQLEXPRESS" with the name of the new server. Depending on the security setup you may have to change to a username/password authentication. If authentication will be based on the windows domain username then you can use the existing Integrated Security.

Member Avatar for Reverend Jim
0
99
Member Avatar for sidyusuf

Try using a forward slash "/" instead of a backward slash "\" as the date field separator.

Member Avatar for Reverend Jim
0
165
Member Avatar for BBMoretti

In order to sort on a column when you click on it you have to create a sort class for that column. The sort class must be defined as implementing the IComparer interface. This is required because the actual sorting code (which you do not have to write) does not …

Member Avatar for Reverend Jim
0
164
Member Avatar for smitty68503

What is it you are having trouble with? Is it the format of the query or is it getting the info from the combobox? A typical update query looks like UPDATE myTable SET postalCode = 'R2C3N1' WHERE zone = 'East Kildonan' AND streetNumber BETWEEN 1600 and 1699

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

The following code requires three combo boxes. Each contains the integers from one to five. the button btnNext will stay disabled until the sum of all three combo boxes is ten or greater. You coold always modify the AddCombo routine, perhaps, to display a string in the textbox something like: …

Member Avatar for Reverend Jim
0
104
Member Avatar for Mike Askew

At least his girlfriends don't leave hairballs on the floor for him to find with his bare feet at 3 AM in the dark (gross).

Member Avatar for Mike Askew
0
115
Member Avatar for bettybarnes

What is the format of a globe telecom number? The regular expression for four digits is "\d(4}". I can be more precise if you are more specific about the format.

Member Avatar for Reverend Jim
0
160
Member Avatar for AquaNut

For Each line As String In System.IO.File.ReadAllLines("myfile.txt") Dim fields() As String = line.Split(vbTab) Next After the Split, fields will contain all of the fields in the input line, one field per entry. Forename, Surname and EmployeeNumber are fields(1, 3 and 5) respectively.

Member Avatar for razree
0
2K
Member Avatar for dakaboguy

Why don't you start by telling us the structure of your tables, and the nature of the information you want to extract from them. If you can do that in English (instead of code), perhaps we can build a query that will get that data directly from the tables without …

Member Avatar for Reverend Jim
0
177
Member Avatar for kelvin_8188

If you have the centre point of a rendered circle you can find the radius by scanning pixels either horizontally or vertically until you find an edge, providing the circle is filled with a uniform colour and you can detect the edge by examining the pixels. I had to write …

Member Avatar for Reverend Jim
0
198
Member Avatar for Ash123ay

You have to be more specific. For example, you want to remove spaces. Do you mean leading, trailing or embedded spaces? You can remove leading and trailing spaces with Trim. You can remove embedded characters, space or otherwise, with Replace. mystring.Trim() 'remove leading and trailing spaces mystring.Replace(" ","") 'remove all …

Member Avatar for Reverend Jim
0
121
Member Avatar for Reverend Jim

I need to get the value of one field out of a web page. I've never done web programming and I've never used the VB Web controls. I have no desire to learn all of the details because I doubt I'll ever have to do this again. I have a …

Member Avatar for DeanMSands3
0
431
Member Avatar for babyhadem
Re: code

Perhaps if you don't know how to code in vb.Net, a Hospital Management System is not the best first project. I suggest you get a copy of Sybex - Mastering Visual Basic 2010 by Evangelos Petroutsos. You might want to have a look at the free online [msdn video series](http://channel9.msdn.com/Series/Visual-Basic-Development-for-Absolute-Beginners/)

Member Avatar for Mike Askew
0
114
Member Avatar for benscomputers

If the Sub doesn't return a value then you either have to have the sub modify a parameter (not recommended) or modify a private variable which is then accessed through a readonly property.

Member Avatar for benscomputers
0
155
Member Avatar for Khav

Use the Leave event in the first textbox as in Private Sub TextBox1_Leave(sender As Object, e As System.EventArgs) Handles TextBox1.Leave TextBox2.Text = TextBox1.Text TextBox3.Text = TextBox1.Text End Sub This code will be executed as soon as the user leaves the TextBox1 control.

Member Avatar for Khav
0
870
Member Avatar for HibaPro

A percentage of what? Are you having problems with the calculation or with the conversion (formatting) for display?

Member Avatar for M.Waqas Aslam
0
890
Member Avatar for ayat abukhadra

For every keystroke. Add this event handler and you will see. The titlebar will be updated every time you press a key. Private Sub TextBox1_TextChanged(sender As System.Object, e As System.EventArgs) Handles TextBox1.TextChanged Me.Text = TextBox1.Text End Sub

Member Avatar for ayat abukhadra
0
95
Member Avatar for RobRTaylor

You only need Application.DoEvents() if you are in a lengthy loop. You aren't doing any loops here so don't use it. oSheet = oBook.Worksheets(1) You don't need this inside the With at line 19. It's already been set outside on line 17. If you are setting the values of single …

Member Avatar for RobRTaylor
0
175
Member Avatar for bembem20

Declare a variable with Class scope and save a reference to the textbox in that variable. The proper way to create the control is as follows: mytextbox = New TextBox() mytextbox.Location = New Point(130,y) Me.Controls.Add(mytextbox) Then to get the entered text just use text = mytextbox.Text

Member Avatar for Reverend Jim
1
563
Member Avatar for darthswift00

SQL queries are normally case insensitive, however you can force a query to be case sensitive. In the following two queries, the first is case insensitive and the second is case sensitive select * from myTable where myID = '34WASH' select * from myTable where myID COLLATE Latin1_General_CS_AS = '34WASH' …

Member Avatar for darthswift00
0
863
Member Avatar for Hani1991

I'm not as concerned with him posting religion based material. In Geek's Lounge pretty much any topic is fair game. What concerns me is the posting of misleading, and in some cases, completely inaccurate material. From my reading (which includes sections from the Q'uran) Islam is not a religion of …

Member Avatar for Reverend Jim
-5
1K
Member Avatar for iqra.cs786

I don't see anything in the WHERE clause that restricts the selection to a particular "Person ID".

Member Avatar for M.Waqas Aslam
0
170
Member Avatar for Reverend Jim

Sometimes sorting data can be easy and sometimes it can be difficult. If you have data in a listview you can spend a great deal of time writing ICompare functions. This is appropriate for non-trivial applications but can be a little intimidating for inexperienced programmers. Also, it is a problem …

Member Avatar for Reverend Jim
1
890
Member Avatar for opman234

Try setting the command to this string first cmd.CommandText = "Update HallTransaction Set status=@statu where ID=@custid" and don't forget to put single quotes around text fields.

Member Avatar for M.Waqas Aslam
0
351
Member Avatar for moone009

I'm not up on oledb. I pretty much stick with ADO so my example uses that. You have to split the input line into fields. You do that with (what a coincidence) the Split method Dim sr As New StreamReader("d:\temp\test.txt") Dim con As New ADODB.Connection Dim qry As String con.Open("Driver={SQL …

Member Avatar for Reverend Jim
0
349
Member Avatar for chriswelborn

Very inefficient way to test for odd or even. A better way is (number And 1) = 0 This evaluates to True if number is even and False if it is odd.

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

So how is the media going to spin this so that all the issues will be discussed except the one that really matters? What hoops are the politicians going to jump through so that they can appear to be doing something but actually leave things exactly as they are now? …

Member Avatar for Reverend Jim
1
394
Member Avatar for Ritesh_4

How elaborate do you want to get. A very simple solution is [Stickies](http://www.zhornsoftware.co.uk/stickies/index.html). This is a replacement for the Windows sticky-notes app. It supports alarms (you can put a sticky to sleep, visibly or invisibly) and have it alarm on a given date/time. Or you can leave a to-do sticky …

Member Avatar for Ritesh_4
0
149
Member Avatar for HydroPlume

Perhaps a slight mod to the above suggestion, save one line per family member with 50 boolean values for the 50 states (in alphabetical order). That way you don't have to change the file format or the input/output logic if you want to add another person. Mom,T,T,F,F,T,F...

Member Avatar for HydroPlume
0
268
Member Avatar for Stuugie

I received the same PM as did Mike_2000_17. It's being looked into.

Member Avatar for Mike Askew
0
468
Member Avatar for kindofsudden

The first thing I would check is to test the app on both machines using exactly the same input data. Another possible source of the extra blanks is from the user. Could the user be introducing the blanks on the form? I don't know what data is in the first …

Member Avatar for belenos46
0
222
Member Avatar for alexandra.lopez.94043

Depends what you mean by "field". To clear a text control you set the Text property to the null string as in TextBox1.Text ""

Member Avatar for M.Waqas Aslam
0
106
Member Avatar for alexandra.lopez.94043

> Label3.Text * txt1.Text You should convert the strings to numbers before performing numeric calculations. > If CheckBox8.Checked = True Then txt8.Visible = True Else txt8.Visible = False This can be simplified to txt8.Visible = CheckBox8.Checked Also, you might consider creating these controls at runtime and saving references in an …

Member Avatar for Reverend Jim
0
210
Member Avatar for sillyboy

Mostly the constant ringing in my ears (sucks getting old). I listen to everything buy country and rap. I keep returning to Ray Lynch.

Member Avatar for Helianthus
0
5K
Member Avatar for ashuag

You are looking for commercial software likely costing many thousands of dollars. I strongly suspect that you will not find a freebie here or anywhere. That type of system is usually highly specialized and (usually) customized to some degree per site.

Member Avatar for M.Waqas Aslam
0
151
Member Avatar for Reverend Jim

[This](http://mikegrouchy.com/blog/2012/06/write-less-code.html) is an excellent, non-technical article on programming that I think every programmer should read at least twice.

Member Avatar for Helianthus
2
96
Member Avatar for ashuag

Add single quotes around non-numeric fields and make sure that all of the variables you are using have valid values. comm.CommandText = "INSERT INTO Cust_Details(Cust_ID, CustName, Gender, Age, Phone, CustAddress) Values (" & custid & ", '" & custname & "','" & gender & "'," & age & ",'" & …

Member Avatar for Reverend Jim
0
119
Member Avatar for lil_bit

>One thing I noticed is many people are 'speaking in code' If you mean code as in computer code, except in the trivial case I try to post comments and explanations with my code. In my "read this before posting" thread on the vb.net forum I encourage posters to organize …

Member Avatar for Reverend Jim
1
207
Member Avatar for Reverend Jim

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.

Member Avatar for Dani
0
180
Member Avatar for Mark2349845

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.

Member Avatar for Reverend Jim
0
142
Member Avatar for number361

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.

Member Avatar for Reverend Jim
0
119
Member Avatar for _rational_

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 …

Member Avatar for dawidbrook
0
368
Member Avatar for raficomps

Instructions on how to save settings can be found [here](http://www.daniweb.com/software-development/vbnet/threads/427539/automated-reference-number-and-save).

Member Avatar for Pgmer
0
201
Member Avatar for iFrolox

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.

Member Avatar for iFrolox
0
3K
Member Avatar for guilherme.carvalho.9250

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

Member Avatar for guilherme.carvalho.9250
0
2K
Member Avatar for hainahid
Member Avatar for megdan

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 …

Member Avatar for Pgmer
0
231
Member Avatar for TTTHXC

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 …

Member Avatar for Reverend Jim
0
735

The End.