4,901 Posted Topics
Re: 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 … | |
Re: [code] For i As Integer = 1 To 10 barChartListBox.Items.Add(New String("*", i)) Next [/code] adds * ** *** **** ***** ****** ******* ******** ********* ********** to the listbox. I comes out nicer with the Courier New font | |
Re: This is a vb.net forum. What you posted was C or C++ code. | |
Re: 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 … | |
Re: 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 … | |
Re: Put BeginUpdate() and EndUpdate() around the code. If your control is called rtbText then [code] rtbText.BeginUpdate() ' ' your update code goes here ' rtbText.EndUpdate() [/code] | |
Re: Show us what you have done so far. | |
Re: 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. | |
Re: 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 … | |
Re: 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 [code] firstname = "John" lastname = "Smith" notes = "a heck of a … | |
Re: 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 … | |
Re: This is not a newbie project. I've been programming for 35+ years I wouldn't begin to touch it. | |
Re: try OriginalWord.ToUpper Like "*[AEIOUY]*" The pattern is "anything" followed by "any vowel" followed by "anything". Just leave out the "!" ![]() | |
Re: 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 [url]http://www.winsupersite.com/article/windows-7/clean-install-windows-7-with-upgrade-media[/url] | |
Re: If you have a text field named txtMytext and it contains "abcdefghijklmnop" then the following code [code] txtMytext.Focus() txtMytext.SelectionStart = 3 txtMytext.SelectionLength = 6 [/code] will set focus to the control with "defghi" selected. | |
Re: The syntax has changed. You can set it by [code] PictureBox1.MaximumSize = New System.Drawing.Size(200, 200) [/code] | |
Re: If you want to retain the current font but just change the size you can use [code] listBox1.Font = New System.Drawing.Font(listBox1.Font.Name, fontsize) [/code] And specify your desired value for fontsize. | |
| |
Re: 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 [quote]i wanted the inpu to be - number to be converted(text box)[/quote] I presume this means "The number to be converted is input by … | |
Re: 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 | |
Re: You can get the list of words into an array by [code] Dim words() As String = Replace(My.Computer.FileSystem.ReadAllText(filename), vbLf, "").Split(vbCr) [/code] To generate a random index for words you can call [code] Private Function Random(ByVal lo, ByVal hi) 'returns a random integer in the range [lo,hi] Random = lo + … | |
Re: 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 … | |
Re: 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 … | |
Re: 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 … | |
Re: That's exactly how it is done. The items are added as follows: [code=vb.net] item = New ListViewItem 'create new listview item item.Text = col1text 'add column 1 item.SubItems.Add(col2text) 'add column 2 item.SubItems.Add(col2text) 'add column 3 listView.Items.Add(item) 'add item to listview [/code] | |
Re: First of all, please repost the code without line numbers. It screws up the formatting. Also, a suggestion to simplify your code. Create the nine digit buttons and name them btn0, btn1, etc. Create a button click handler for one button then modify it as follows: [code=vb.net] Private Sub btn0_Click(ByVal … | |
Re: Why not just use the screensaver settings to lock the computer after a specified period of inactivity? | |
Well, this is embarrassing. I had to completely rebuild my laptop from scratch. I usually keep 3 or 4 items pinned to the taskbar and launch them with WINKEY-1, WINKEY-2, etc but somehow or other this no longer works. I really should know how to do this but I just … | |
Re: Check out SpinRite at [url]http://www.grc.com/spinrite.htm[/url] They have an excellent video on what the software can do. | |
I have an app I wrote in Python/wxPython. When I click a button, the action that is taken will depend on whether or not a modifier key (such as CTRL) is currently pressed. I can't toggle a swich based on a keypress event (eg ctrldown = True or False) because … | |
Re: I'm no great fan of C++ but rather than awaiting the death of C++ I would much rather see the demise of programmers who write butt-ugly code regardless of the language. My elder son recently completed his PhD in computational bio-physics and I perused a lot of C++ code over … | |
Re: If you have already covered arrays then I suggest you use an array to hold the random numbers. You start with no random numbers in the array. Your outer loop will terminate when you have generated the 6 required unique numbers. Inside the loop you can generate a random number … | |
Re: First of all, you shouldn't copy actual executables to that location. If you have a look you will see that it has "lnk" files there which are shortcuts to the actual executable files. So for starters you could create just a shortcut there and put the executable anywhere. If the … | |
Re: If you have it pinned to the taskbar you can press and hold CTRL+SHIFT and left mouse click on it, or you can right mouse click and select "Run as Administrator". You will be asked to confirm your action. The app will run with elevated rights. | |
Re: Unless they have totally changed Virtual PC in the last three years, VPC is not an operating system. It is an environment which created virtual machines. In other words, you run VPC, then create a virtual machine into which you install whatever OS you want to run. If you have … | |
Re: A better way to generate non-repeating random sequences (for example, dealing cards from a deck) is to start with your array, Amount, then generate a random integer from 0 to last (where last is initially set to Ubound(Amount). When you generate your first random index (let's call it rind), adjust … | |
Re: You can try running Trend Micro Housecall from [url]http://housecall.trendmicro.com/uk/[/url] If you can't do this online, you can download (from another computer) and burn a boot CD or USB boot stick. Boot off the media of choice and disinfect. | |
Re: You can't use the class name as a variable. You have to declare the class as follows: [code] Public Class cust Private m_inputstr As String Public Property inputstr() As String Get Return m_inputstr End Get Set(ByVal value As String) m_inputstr = value End Set End Property End Class [/code] Then … | |
Re: This usually happens when you have failed to specify a boot device. Did you tell vmware (via the settings) to use the physical CD/DVD device on your computer? The alternative is to make an iso file from your XP CD/DVD and make sure it is mounted. Both options are set … | |
Re: If the quantity for discount varies from item to item then I suggest you add it as well as the discount to your listview as a subitem. That way you wouldn't have to hardcode a test for each type of item. Also, your insert query is independent of the item … | |
Re: Use the "Expand" method as in trvMyTree.Nodes(0).Expand | |
Re: The following code scans the first 500 rows and 20 columns of all worksheets and writes the values of all cells that start with the letter "c". [code] Imports Excel = Microsoft.Office.Interop.Excel Public Class Form1 Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click Dim xls As … | |
Re: syncback from 2brightsparks does it for me and it comes in a free version. | |
Re: I found "Mastering Visual Basic 2008" (Evangelos Petroutsos - Wiley Publishing) to be a very good book. There is a VB 2010 edition as well. | |
Re: Can you please describe (in words instead of code) what it is you are trying to do? In other words, if I was the programmer, what would you tell me in order for me to write the program without any further input from you? | |
Re: I did exactly the same thing this summer to troubleshoot a problem with my Rogers Rocket Hub at the cottage. Do you have a question? You don't require a CMD session to execute the ping. A simple (simple enough for my purposes) ping function is [code] Private Function PingStatus(ByVal addr … | |
Re: Try this [code] Dim lines() As String = Split(My.Computer.FileSystem.ReadAllText(myfile), vbCrLf) dim flt() as string = Filter(lines,"Joe Blow") [/code] This will give you an array containing only the matching lines. | |
Re: Let's try to make it clear with an example. Take the number 9184 or 9 1 8 4. Add 7 to each digit giving 16 8 15 11 Take the remainder after dividing by 10 giving 6 8 5 1 Swap digits 1 & 3 giving 5 8 6 1 … |
The End.