4,901 Posted Topics
Re: Take out the comma in ",FROM Breakfast". | |
Re: You say make it 10x10 with 10% each. This is the first time I am using the TableLayout panel. I am able to determine (faily easily) that "make it 10x10" means set RowCount=10 and ColumnCount=10. However "with 10% each" is not as clear. Perhaps you could spell this out specifically … | |
Re: I believe adam_k is correct. When you connect to a database on a network the standard is to keep the connection open for as short a time as possible because there are a limited number of connections available and you want to free them up for others. In your case … | |
Re: You can do this with application settings. I don't know what version of Visual Studio you have so I'll describe the procedure for VS 2010. Start with your project open Go to the project properties settings Select the "Settings" tab down the left side of the panel Add an item, … | |
Re: I'll take a stab at it. I'm going to assume _userid is integer. A typicl update statement would be (at least in MS SQL) update tblUsers set Password = 'mypassword' where ID = 12345 Note the quotes around mypassword. try this code [code] cmd.CommandText = "update tblUsers SET Password = … | |
Re: I'm not going to tell you what's wrong with the code just yet. What you need to do first is [LIST=1] [*]Tell us what the code is supposed to do. We shouldn't have to determine that by looking at the code [*]Pretty it up to make it more readable. Add … | |
Re: In the button click handler you can identify the button either by name or by label text (the label text is probably more informative depending on how you name your controls) [code] Dim button As Button = DirectCast(sender, Button) MsgBox(button.Text & " " & button.Name) [/code] | |
Re: In the button click handler you can identify the button either by name or by label text (the label text is probably more informative depending on how you name your controls) [code] Dim button As Button = DirectCast(sender, Button) MsgBox(button.Text & " " & button.Name) [/code] | |
Re: Try this [code] Dim row As Integer = 1 Dim col As Integer = 1 For Each line As DataGridViewRow In grdToExport.Rows For Each cell As DataGridViewTextBoxCell In line.Cells sheet.Cells(row, col) = cell.Value col = col + 1 Next row += 1 col = 1 Next [/code] | |
Re: Show us what you have so far. | |
Re: Try Dim line() As String = System.IO.File.ReadAllLines("myfile.txt") That will read the entire file into an array, one line per array entry. You can access the text from line 5 as line(4). | |
Re: Did it come with a recovery partition? Many computers are shipped without install disks. These computers typically have a partition that contains an image that will restore your computer to factory state. If the computer originally shipped with Windows 7 then that is what will be restored. Make sure you … | |
Re: If you want to update a field automatically (like to display the time) you have to add a Timer control to your form and set it to run at a convenient interval. For example, if you add Timer1 to your form, you can set the interval to the number of … | |
Re: wsh is reserved. If you execute the following line wscript.echo wsh the result will be the output of the line Windows Script Host use another variable name. | |
Re: Typically if you are using AD to authenticate then the user does not need to supply a username/password. The usual practice is to create a group in AD then add the appropriate users to that group. You then add the AD group to SQL server with appropriate access rights and … | |
Re: As an alternative to public torrents, you might look at OneSwarm. It was developed at the University of Washington. [url]http://www.oneswarm.org/[/url] 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 … | |
Re: Stubborn browser toolbar addons can be removed/disabled using HijackThis (free) at [url]http://free.antivirus.com/hijackthis/[/url] | |
Re: I suggest that you change the file format so that all info for an order is on the same line. Pick a character like "|" to separate the fields. Each line can be parsed into separate fields by Dim fields() As String = line.Split("|") It makes the file I/O much … | |
Re: How does the user get access to the form to change a password if the current password has expired? Wouldn't it be impossible for the user to log on to get access to the form? | |
Re: If you are going to do a copy and paste then you will get what you get. What is the format of the cells in the spreadsheet (is it an Excel spreadsheet). Numbers don't usuallt display with a leading zero. If the cells you want to copy can be identified … | |
Re: I created a listbox and a combobox. I populated the listbox with the words (one per line) "the quick brown fox jumped over the lazy dog". I then added an event handler as follows: [code] Private Sub ListBox1_SelectedValueChanged(sender As Object, e As System.EventArgs) Handles ListBox1.SelectedValueChanged ComboBox1.Items.Clear() For i As Integer … | |
Re: If you just want to run it on the development computer you can just create a shortcut to the EXE file produced in a bin folder in your project folder. If you want to run it on another computer you have to create an install package for your application. | |
Re: The simplest answer would be that another process is using the file. Try the Handle utility available at [url]http://technet.microsoft.com/en-gb/sysinternals/bb896655[/url] and see what shows up. | |
Re: Try ListView1.Items.Clear() instead of ListView1.Clear(). That will clear the items only, not the column headers. | |
Re: Start by telling us what you have done so far. | |
Re: Easiest one first. set the Sort property of the ComboBox to True and the items will display sorted. [QUOTE]The comboboxes are populated via a list and the list is populated by reading a text file for each combobox.[/QUOTE] What is the type of your list? A "list" can be many … ![]() | |
Re: Assuming you want to do this to all text controls on the form, add the following to subs [code] Private Sub Text_Enter(sender As System.Object, e As System.EventArgs) DirectCast(sender, TextBox).BackColor = Color.Yellow End Sub Private Sub Text_Leave(sender As System.Object, e As System.EventArgs) DirectCast(sender, TextBox).BackColor = Color.White End Sub [/code] Then add … | |
Re: The easiest way to insert a record into a table is by ADO as follows [code] Dim con As New ADODB.Connection con.Open("Driver={SQL Server};Server=JIM-PC\SQLEXPRESS;Database=mydb;Trusted_Connection=yes;") Dim query As String = "insert into Table1 (RegistrationNo,Field1,Field2) values(12,'John','Doe')" con.Execute(query) con.Close() [/code] In this case I am inserting into a SQL Express 2008 table "Table1" in … | |
Re: You can use the Windows Task Scheduler to run a program at a given time. If you want your app to be running, then perform some action at a given time, you can add a Timer control to your app. Set the timer interval to whatever interval you want to … | |
Re: For an excellent article on this please see [URL="http://media.wiley.com/product_ancillary/74/04705328/DOWNLOAD/532874_both02_p2.pdf"]Printing With VB 2010[/URL] | |
Re: Besides which someone doing a thesis would likely pick a topic a little more challenging. I had considered doing a masters back in 1977. My thesis project was going to be implementing a computer conferencing system. Formatting a USB device from VB9? I don't think so. | |
Re: Process.Start("rundll32", "user32.dll,LockWorkStation") | |
Re: You have a typo in the for loop. You mistyped "proc" as "porc". As far as I know, you can't lock the screen by killing explorer.exe. It can always be started again from task manager (which can be activated from the keyboard). However, you CAN lock the workstation by executing … | |
Re: Two hundred buttons on one form seems a tad excessive but if you must, I suggest you create the buttons at runtime. You can lay them out precisely and keep references to them in an array for easy access. Another advantage is that it is easy to define just one … | |
Re: I usually use ADO and I use the connection string "Driver={SQL Server};Server=" % server & ";Database=" & database & ";Trusted_Connection=yes;" | |
Re: For an excellent article on this please see [URL="http://media.wiley.com/product_ancillary/74/04705328/DOWNLOAD/532874_both02_p2.pdf"]Printing With Visual Basic 2010[/URL] | |
In the last few days I have lost the ability to render certain images on DaniWeb. For example, the icons to the left of the threads now show only as text. Likewise with the "buttons" in the edit window. Any ideas what might have caused this or how to fix … | |
Re: Start by reading just about any Visual Basic how-to book. I haven't seen one yet that doesn't cover this. | |
Re: Put a shortcut to your application in C:\Users\All Users\Microsoft\Windows\Start Menu\Programs\Startup so that it runs whenever anyone logs on or C:\Users\%USERNAME%\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\Startup for specific users (replace %USERNAME% with appropriate username) | |
Re: You are being taught to program because it is important to be able to analyze and describe a process in detail, and at some point you will need to have an appreciation for the work that goes into developing an application. For a non-programming example, try to write out a … | |
Re: You could try psexec from the SysInternals (free) suite. You can download it from [URL="http://technet.microsoft.com/en-us/sysinternals/bb842062"]here.[/URL] This excellent suite was developed (mostly) by Mark Russinovich. | |
Re: There are a few things you have to do before you even start writing code. [B][U]Determine the structure of your database[/U][/B] Determine what tables you need and what fields will appear in each table. One of the tables will be the libraries table and will contain at least two fields, … | |
Re: If I might make a suggestion. Have you considered using a dictionary? It would simplify your code considerably. Here's an example: [code] Dim city As New Dictionary(Of String, String) city("AUS") = "Austin" city("BOS") = "Boston" city("BWI") = "Baltimore" city("DFW") = "Dallas" city("JFK") = "New York" city("LAX") = "Los Angeles" city("MIA") … | |
Re: You step through the tree and keep track of the current and previous nodes (I use variables named curr and prev). When you find a node with a value greater than the value of the node you want to insert then you can use the Insert method on the prev … | |
Re: What are "-ve" values? | |
Re: There are a few things wrong here. The first thing is that your function return values do not agree in type with the values you are returning. Let's take [code] Function CommissionTotal() As String commTotal = (commpercentage * grossSales) / 100 Return commTotal End Function [/code] You declared the function … | |
Re: First of all may I suggest that you use the built-in copy methods rather than rolling your own. My.Computer.FileSystem.CopyDirectory(srcefolder,destfolder) will do the copy of the entire folder just fine. That will save you some debugging. If you want to set a folder constant just do Const srceFolder = "D:\MyFolder" To … | |
Re: You could also define a click event for just one of the controls in the set then use AddHandler on form load to add the other controls to that handler. It would save a lot of clicking. You would have to modify the original handler to distinguish between the controls. … | |
Re: What kind of database? What is your level of expertise with databases/VB? Do you mean a process like [code] get username and password from text fields on a form compare to list of valid usernames and passwords from the database if username and password were found in the database let … |
The End.