Reverend Jim 5,225 Hi, I'm Jim, one of DaniWeb's moderators. Moderator Featured Poster

Based on what you've told us (which is nothing), neither do I.

Reverend Jim 5,225 Hi, I'm Jim, one of DaniWeb's moderators. Moderator Featured Poster

If you want to display text in a textbox you say

txtMyTextBox.Text = mystring

If mystring contains vbCrLf (carriage return/linefeed) then multiple lines will be displayed (as long as you have enabled that in the properties for the textbox). If you want a more specific answer then ask a more specific question. Are you having trouble with putting the data in the textbox or with getting the data from SQL Server? Are you having trouble connecting to SQL or accessing the individual fields or possible forming the query?

Reverend Jim 5,225 Hi, I'm Jim, one of DaniWeb's moderators. Moderator Featured Poster

You can also use the syntax

Dim sqlQuery As String = "SELECT * FROM MyTable WHERE DateColumn BETWEEN @param1 AND  @param2"
Reverend Jim 5,225 Hi, I'm Jim, one of DaniWeb's moderators. Moderator Featured Poster

I'm old school. I prefer to do my insert queries using the connection object. An insert query looks like

insert into tablename (col1name,col2name,col3name) values (col1value,col2value,col3value)

In your case the connection object is named con so once you have composed your query in a string (let's call it query), you execute it by

con.Execute(query)

Reverend Jim 5,225 Hi, I'm Jim, one of DaniWeb's moderators. Moderator Featured Poster
For i As Integer = 1 To 10
    barChartListBox.Items.Add(New String("*", i))
Next

adds
*
**
***
****
*****
******
*******
********
*********
**********
to the listbox. I comes out nicer with the Courier New font

Reverend Jim 5,225 Hi, I'm Jim, one of DaniWeb's moderators. Moderator Featured Poster

This is a vb.net forum. What you posted was C or C++ code.

Reverend Jim 5,225 Hi, I'm Jim, one of DaniWeb's moderators. Moderator Featured Poster

First of all, when you post code, please do it without the line numbers. It screws up the formatting. Now for the problem. I presume that the letters you use are restricted to those on a phone keypad corresponding to the digits in the phone number. If so, you really should have mentioned that instead of making me deduce that from the code. So you are supposed to generate words based on the digits with that restriction. How, exactly, are you going to determine whether the random strings you generate are actually words? Do you have a dictionary of words to check against?

To start with, I wouldn't store the digit to letter mappings the way you have set up. I would create a string array of 10 elements (indexed 0-9) where each element contains all of the letters that appear for that digit. That is coded as

Dim map() As String = {"", "", "ABC", "DEF", "GHI", "JKL", "MNO", "PQRS", "TUV", "WXYZ"}

That would indicate that any telephone numbers containing the digits 0 or 1 would be disqualified. In any case, I need more information about the problem before I can make further suggestions.

One further comment

my code has an error with the txtphonenumber handle idk

I don't know what you mean by "handle idk". Please try to avoid using abbreviations that are not obvious to others. I don't mind going to go to the trouble of composing a lengthy explanation so I would like …

Reverend Jim 5,225 Hi, I'm Jim, one of DaniWeb's moderators. Moderator Featured Poster

Do you mean a string like "......"? Or do you mean a series of decimal numbers? I presume you know how to create a textbox control. Let's say you have one namex txtDecimals. You can refer to the text in the box by txtDecimals.Text. For example, to copy it to a local variable you do

Dim mystring As String

mystring = txtDecimals.Text

If, however, the user has entered the number of decimals they want then you get that number by converting the text in the control to an integer value via CInt as follows:

Dim numdecimals as Integer

numdecimals = CInt(txtDecimals.Text)

Keep in mind that if the user has entered a string that cannot be converted to a number you will get an error. You can account for this by using IsNumeric to check the string before converting, or by doing the conversion in a Try/Catch block.

If the user has entered text like "12 5123 17 947 42" then you have to parse the text using Split and converting each item in the resulting array.

Reverend Jim 5,225 Hi, I'm Jim, one of DaniWeb's moderators. Moderator Featured Poster

I was thinking that you could copy the entire RTF text to a local string, do all of the changes to that string, then copy it back to the RTF control but it occurred to me that you would lose all of the formatting. Then I thought you might create a hidden RTF control and do all the editing changes there before copying it back to the visible control. That might eliminate all but one (the final) screen update.

Reverend Jim 5,225 Hi, I'm Jim, one of DaniWeb's moderators. Moderator Featured Poster

Write it out in English (pseudo-code) first and it may be clearer. For example, start with

If candidate is 5 or higher in mobility and 5 or higher in hearing and 5 or higher in sight or candidate is 7 or higher in mobility and 7 or higher in hearing and sight and 4 or higher in hearing and sight, etc

and put "(" and ")" around sections to avoid ambiguity. By that I mean you don't want to confuse

a or (b and c)

with

(a or b) and c

which could give different results. Once you have the English then you can try to convert it to code. Once you have determined if a candidate is fit for ordinary duties (save it in a boolean variable named "ordinary"), then you can test for special duties. But like adam k said, you have to show some effort.

Reverend Jim 5,225 Hi, I'm Jim, one of DaniWeb's moderators. Moderator Featured Poster

You could always boot off a linux live cd and copy the files to another folder or some other media. Have you tried running a CMD session as Administrator and rerunning cacls to /e /g everyone:f

Reverend Jim 5,225 Hi, I'm Jim, one of DaniWeb's moderators. Moderator Featured Poster

Unless you are running the software in a VM in order to avoid having the software show up on an inventory (like on an office computer) in which case you shouldn't.

Reverend Jim 5,225 Hi, I'm Jim, one of DaniWeb's moderators. Moderator Featured Poster

Not to mention that the actual VM executive takes CPU cycles as well.

Reverend Jim 5,225 Hi, I'm Jim, one of DaniWeb's moderators. Moderator Featured Poster

Show us what you have done so far.

Reverend Jim 5,225 Hi, I'm Jim, one of DaniWeb's moderators. Moderator Featured Poster

You could create two new tables named Invoice and InvoiceLine. Each invoice would have a unique primary key named Invoice_ID. The fields in this table would contain information relevant to the entire invoice (Customer_ID, date, status, etc). InvoiceLine would have a primary key consisting of Invoice_ID and Line_ID. This table would contain all the info for each invoice item (product id, quantity, unit cost, etc).

bilal_fazlani commented: solved my problem +1
Reverend Jim 5,225 Hi, I'm Jim, one of DaniWeb's moderators. Moderator Featured Poster

Without having access to the site to play with, my first guess would be either that you have failed to fully qualify the file(s) you want to fetch or that you haven't issued a "CD" command (or possibly "CHDIR") to change into the correct folder on the remote site.

Reverend Jim 5,225 Hi, I'm Jim, one of DaniWeb's moderators. Moderator Featured Poster

Let's look at fmtstr first.

"{0, -18}{1, 10}"

This says you want to format two items. The first item will be in a field that is 18 character wide. If you specified 18 (positive number) the text would be right justified in the field. Because is is given as -18 (negative), the data is displayed left justified in the field. The second output field is 10 chars wide and the number will be displayed right justified.

FormatCurrency takes a number and displays it with a "$" at the left and with the specified number of decimal places (in your case, 2).

Reverend Jim 5,225 Hi, I'm Jim, one of DaniWeb's moderators. Moderator Featured Poster

The actual syntax of the SQL query is
INSERT INTO table (col1name,col2name,...) VALUES(val1,val2,...)

An actual example would be

insert into mytable (first_name,last_name,notes) values("john","smith","heck of a nice guy");

with table named "mytable". An example in VB would be

firstname = "John"
lastname = "Smith"
notes = "a heck of a nice guy"
table = "mytable"

query = "insert into " & table & " (first_name,last_name,notes) values(""" & firstname & """,""" & lastname & """,""" & notes & """)"

if your connection object is named "con" then execute the query by

con.Execute(query)

I find that the hardest part is keeping all the extra double quotes straight.

Reverend Jim 5,225 Hi, I'm Jim, one of DaniWeb's moderators. Moderator Featured Poster

You never get the value of Student_profile from the database. You also stated that the type of that column was Yes/No. My SQL is somewhat rusty but you later say you want to test against the values "yes" and "No". I don't think that a Yes/No field is actually stored as "Yes" or "No". Try

Student_profile = dbDR("student_profile")

and see where that gets you. If you get into the debugger you might try looking at the type of that column as it is returned from dbDR. If it returns a boolean then your If statement will be

If Student_profile then
    MsgBox("HI vasim"
.
.
Reverend Jim 5,225 Hi, I'm Jim, one of DaniWeb's moderators. Moderator Featured Poster

My apologies. I assumed that the Begin/EndUpdate methods applied to the rich text control as well. I would have thought these were methods that would be useful if they applied to all controls. If they don't in my version (2010) then they won't in yours. What, specifically, are you trying to do? Perhaps with more information I can suggest an alternative.

Reverend Jim 5,225 Hi, I'm Jim, one of DaniWeb's moderators. Moderator Featured Poster

If you are only doing house calls then you do not need remote software. If you do need it then you can go to the trouble of figuring out how to use Windows Remote Desktop through firewalls. Of course, since you ARE a business you can a) write off the cost of TeamViewer (or other app) as a business expense and b) pass along part or all of the cost to your customers.

Reverend Jim 5,225 Hi, I'm Jim, one of DaniWeb's moderators. Moderator Featured Poster

As an alternative to public torrents, you might look at OneSwarm. It was developed at the University of Washington.

http://www.oneswarm.org/

In a nutshell, it allows you to set up private torrents if, for example, you wanted to share large files or sets of files between two or more computers at different sites. This would be useful if several researchers wanted to exchange large data files. It has all the benefits of public torrents (pause/resume transfers, limit bandwidth, etc) and you can limit access to only trusted users.

Reverend Jim 5,225 Hi, I'm Jim, one of DaniWeb's moderators. Moderator Featured Poster

Go to control panel - > Windows updates -> view update history

Reverend Jim 5,225 Hi, I'm Jim, one of DaniWeb's moderators. Moderator Featured Poster

Microsoft sells a family pack which allows you to install Winidows 7 Home on up to three computers. As for upgrade/full, you can actually do a full (from scratch) install of Windows 7 from an upgrade disk. See

http://www.winsupersite.com/article/windows-7/clean-install-windows-7-with-upgrade-media

Reverend Jim 5,225 Hi, I'm Jim, one of DaniWeb's moderators. Moderator Featured Poster

You can't get something for nothing. If your virtual machine is honking back cpu cycles doing video conversion then there are fewer cycles left for other processes. If you limit the resources available to the virtual machine either by putting a ceiling on available memory or by lowering the priority you will make more resources available to other tasks but by doing so you will increase the time required to do the conversion. Also, the more tasks you have doing I/O the less efficient that I/O will be as you will have multiple processes doing seeks/reads/writes to different areas of the disk (assuming all I/O is to the same physical drive).

Reverend Jim 5,225 Hi, I'm Jim, one of DaniWeb's moderators. Moderator Featured Poster

UltraVNC - http://www.uvnc.com/
TightVNC - http://www.tightvnc.com/

Are both free. There is a way to set up the builtin Windows Remote Desktop to work through firewalls, however, I tried and gave up in favour of TeamViewer. I am not endorsing either UltraVNC or TightVNC. I have never used either. I just suggest them as free possibilities. May I ask why you want something proprietary? Why not stick with software that experts have perfected (mostly) and are maintaining?

Reverend Jim 5,225 Hi, I'm Jim, one of DaniWeb's moderators. Moderator Featured Poster

The syntax has changed. You can set it by

PictureBox1.MaximumSize = New System.Drawing.Size(200, 200)
Reverend Jim 5,225 Hi, I'm Jim, one of DaniWeb's moderators. Moderator Featured Poster

If you have a text field named txtMytext and it contains "abcdefghijklmnop" then the following code

txtMytext.Focus()
txtMytext.SelectionStart = 3
txtMytext.SelectionLength = 6

will set focus to the control with "defghi" selected.

Reverend Jim 5,225 Hi, I'm Jim, one of DaniWeb's moderators. Moderator Featured Poster

This is not a newbie project. I've been programming for 35+ years I wouldn't begin to touch it.

Reverend Jim 5,225 Hi, I'm Jim, one of DaniWeb's moderators. Moderator Featured Poster

If you want to retain the current font but just change the size you can use

listBox1.Font = New System.Drawing.Font(listBox1.Font.Name, fontsize)

And specify your desired value for fontsize.

Reverend Jim 5,225 Hi, I'm Jim, one of DaniWeb's moderators. Moderator Featured Poster

try OriginalWord.ToUpper Like "*[AEIOUY]*"

The pattern is "anything" followed by "any vowel" followed by "anything". Just leave out the "!"

Reverend Jim 5,225 Hi, I'm Jim, one of DaniWeb's moderators. Moderator Featured Poster

Post what you have so we can make suggestions.

Reverend Jim 5,225 Hi, I'm Jim, one of DaniWeb's moderators. Moderator Featured Poster

And how is

"The number to be converted is input by the user in a textbox"

different from

the number that will be converted(let's say 7)will be in a text box

Reverend Jim 5,225 Hi, I'm Jim, one of DaniWeb's moderators. Moderator Featured Poster

Please take the time to ask a coherent question. If you can't be bothered to explaini it properly then don't expect a coherent answer. For example

i wanted the inpu to be
- number to be converted(text box)

I presume this means "The number to be converted is input by the user in a textbox". Put a little more effort into the question.

Reverend Jim 5,225 Hi, I'm Jim, one of DaniWeb's moderators. Moderator Featured Poster

First of all you can't just do

number = txt1.Text

Because txt1.Text is a string. You have to convert it to a floating point value as follows

number = CDbl(txt1.Text)

Same thing applies to txt2.Text, txt3.Text and txt4.Text except you use CInt and make start, increment and finish Integers

Reverend Jim 5,225 Hi, I'm Jim, one of DaniWeb's moderators. Moderator Featured Poster

You can get the list of words into an array by

Dim words() As String = Replace(My.Computer.FileSystem.ReadAllText(filename), vbLf, "").Split(vbCr)

To generate a random index for words you can call

Private Function Random(ByVal lo, ByVal hi)

    'returns a random integer in the range [lo,hi]

    Random = lo + CInt(Rnd() * (hi - lo))

End Function

Just pass it lo=0 and hi=ubound(words). Make sure you call Randomize() when the form loads to avoid generating the same string of random numbers each run.

Reverend Jim 5,225 Hi, I'm Jim, one of DaniWeb's moderators. Moderator Featured Poster

Put BeginUpdate() and EndUpdate() around the code. If your control is called rtbText then

rtbText.BeginUpdate()
'
' your update code goes here
'
rtbText.EndUpdate()
Reverend Jim 5,225 Hi, I'm Jim, one of DaniWeb's moderators. Moderator Featured Poster

Is it an actual database (regularly definied rows and columns) or is it a spreadsheet with varying fields depending on the row? In one case you CAN access the data using ADO (or whatever MS calls it now) and recordsets, etc. If not then you can access the rown and columns using an Excel object that can be created within VB. If it's the second case we can also give you sample code.

Reverend Jim 5,225 Hi, I'm Jim, one of DaniWeb's moderators. Moderator Featured Poster

If this thread is complete then please mark it as solved.

Reverend Jim 5,225 Hi, I'm Jim, one of DaniWeb's moderators. Moderator Featured Poster

Another thing I like about Teamviewer is that you don't have to install it to use it - something that makes my users happy. It's also convenient to carry around on a stick in case I want to remote home from somewhere.

Reverend Jim 5,225 Hi, I'm Jim, one of DaniWeb's moderators. Moderator Featured Poster

Take a piece of paper and make two columns of numbers. Column 1 will contain the number of bricks required to make just that level (1, 4, 9, 16, etc). Column 2 will contain the running total of column 1 (1, 5, 14, 30, etc). Once you see the two columns side by side the solution should be obvious.

Reverend Jim 5,225 Hi, I'm Jim, one of DaniWeb's moderators. Moderator Featured Poster

I should also point out that if you use a Class you will have to create each element of leagues with "New" as in

Public Class League
    Public id As String
    Public name As String
    Public players(20) As String
End Class
.
.
.
Dim leagues(20) As League

For i As Integer = 0 To UBound(leagues)
    leagues(i) = New League
Next
Reverend Jim 5,225 Hi, I'm Jim, one of DaniWeb's moderators. Moderator Featured Poster

The first line was

Ive been tasked with writing a program the calculates the number of legos needed to create a pyramid.

meaning he/she has to calculate the number of bricks for each layer. No need to write a separate loop to calculate the sum.

Reverend Jim 5,225 Hi, I'm Jim, one of DaniWeb's moderators. Moderator Featured Poster

Then all you have to do is add "sum = 0" before the loop and "sum = sum + pyramid(i)" after line 2. If you look at it as pseudo code

set the sum to zero

for each level of the pyramid
    number of bricks = the square of the level number
    add number of bricks to sum
next
Reverend Jim 5,225 Hi, I'm Jim, one of DaniWeb's moderators. Moderator Featured Poster

Is it a local router that you can cable into? It's possible that the router and your computer are using different types of encryption. For example, your computer may be set to WPA and your router to WPA2. If you can cable in you can check the settings on the router.

Reverend Jim 5,225 Hi, I'm Jim, one of DaniWeb's moderators. Moderator Featured Poster

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

Reverend Jim 5,225 Hi, I'm Jim, one of DaniWeb's moderators. Moderator Featured Poster

Try

Structure league
    Dim id As String
    Dim name As String
    Dim players() As String
End Structure

Dim leagues(100) As league
for i as integer = 0 to 100
    redim leagues(i).players(20)
next

I don't know why there should be a restriction on declaring the length of the players array when the struct is defined but apparently there is. An alternative would be to use a class instead of a struct as

Public Class League

    Public id As String
    Public name As String
    Public players(20) As String

End Class
Reverend Jim 5,225 Hi, I'm Jim, one of DaniWeb's moderators. Moderator Featured Poster

No prob. I find a simple example that illustrates one feature is clearer than a complex one that tries to show all features. Are you listening Microsoft????

Reverend Jim 5,225 Hi, I'm Jim, one of DaniWeb's moderators. Moderator Featured Poster

If you need to use an array then save each calculation inside the loop into the array using the loop variable as the array index. Try to think of the array as a book where each page can hold one value. Instead of writing a value on page 5 of the book you actually code up "book(5) = value". Instead of calling your array "book" you call it something more appropriate like "level"

dim level(10) as integer

level(4) = 16
Reverend Jim 5,225 Hi, I'm Jim, one of DaniWeb's moderators. Moderator Featured Poster

Assuming level 1 takes 1 lego and given that level 4 takes 16, I am thinking that each level takes that level squared bricks. The first 4 levels then would take 1+4+9+16 or 30 bricks. Thus, an array is not needed. You start with a sum of zero then create a loop from 1 to the number of levels. At each iteration you add the square of the loop index to the sum.

And don't worry too much about it not making sense. Some times it just take a while before things start to "click". It's like learning to play bridge and figuring out the bidding system. You try to remember the rules until one day they just start to make sense and you stop thinking about them. Programming is like that. At some point you stop struggling and start doing the basic stuff without deliberate thought.