4,901 Posted Topics
Re: And never use field names that contain spaces. You have one field named "Type of License". You could use the spaces if you referenced the field by \[Type of License\] but embedding spaces is just bad form. Remove the spaces and you should be OK. | |
Re: The following will add "some text" to the combo box only if it doesn't already exist. Dim text As String = "some text" If Not ComboBox1.Items.Contains(text) Then ComboBox1.Items.Add(text) End If | |
Re: You could use consts and index with those instead of literals as in Const JAN = 1 Const FEB = 2 Const MAR = 3 . . . Const TOTAL = 13 . . . DataGridView1.Rows(3).Cells(JAN).Value = etc | |
Re: If you set up a specific folder for files to process then users can deposit completed files into that folder. Once you have processed a file you can move it out of that folder and archive or delete it. Sometimes you just have to train the users to provide data … | |
Re: Safe mode boots into VGA (basic video) so if your video card is the problem it likely won't show up in safe mode. You might try running MSCONFIG, going to the boot.ini tab and selecting the SOS option (I'm doing this from memory). The SOS option will replace the boot-time … | |
Re: I would put the reorder test in a separate block. You seem to have a handle on the database part so I will describe it in pseudo-code 'select all records where the inventory count has reached or exceeded the reorder limit select * from Product where Inventory <= ReOrderLimit 'if … | |
Re: You can use a Dictionary to store things. A Dictionary consists of name/value pairs where the name is used as the index (key). The value part can be of any type, even objects and custom classes. When you create a dictionary object you declare the type of the key and … | |
Re: You might want to have a look at the free [log parser tool from Microsoft](http://en.wikipedia.org/wiki/Logparser) which can be downloaded [here](http://www.microsoft.com/en-us/download/search.aspx?q=log%20parser%202.2) | |
Re: Assuming that every block contains both an email and a password, and they appear in that order, the following code will do it. It processes all lines in the control and splits each line into fields at the "=" character. The "Filter" function returns an array of string with only … | |
Re: First a few comments. * It is a bad idea to have field names that contain spaces. * it is preferable (for sorting) to keep both the date and time in one field * What is to prevent an employee from signing in under another employee's number? To address the … | |
Re: I created a DataGridView control with 2 columns and added a few records, then set row 2 to read only and modified the background colour with the following. Private Sub btnPopulate_Click(sender As System.Object, e As System.EventArgs) Handles btnPopulate.Click grdView.Rows.Add({"George", "Jones"}) grdView.Rows.Add({"Fred", "Flintstone"}) grdView.Rows.Add({"John", "Franks"}) grdView.Rows.Add({"Arthur", "Green"}) grdView.Rows(2).ReadOnly = True For … | |
Re: Can you give us something specific like the type of the array, the number of dimensions, perhaps some sample data and the results you are trying to generate from that data? | |
Re: Sharepoint is drastic overkill for what you want. It requires a very large investment in equipment and training. Our first Sharepoint installation was done after training and even then was completely botched. It required more than a year of reorganization and massive inconvenience to the users to undo the damage. … | |
Re: I created a listview with three columns for FirstName, LastName and Age. To insert all rows of the listview into mytable I could code For Each row As ListViewItem In ListView1.Items Dim query As String = "insert into mytable (FirstName,LastName,Age) Values(" & "'" & row.SubItems(0).Text & "'," & "'" & … | |
Re: A ListView (in details view) consists of a collection of items (or rows) where each item contains subitems (or columns). In the following example I have defined ListView1 as containing 6 columns. If I add some sample data as follows For row As Integer = 1 To 6 Dim newitem … | |
Re: If I might add my recommendation: My laptop has two internal hard drives. The first is partitioned as C (60 gig) and D (400 gig) (approximately). I have Windows 7 Pro and all my applications installed on C. I store no data on C that I am not willing to … | |
Re: Try running this. You may need to add some error checking or tests for blank lines or comments depending on how strictly you control the format of your ini file. Private Sub btnRead_Click(sender As System.Object, e As System.EventArgs) Handles btnRead.Click Dim file As String = "d:\temp\settings.ini" Dim sr As New … | |
Re: A query to retrieve a job name where status = "FOR KE" will return (using your data) five records. In your example, "get" is ambiguous. Do you mean "get a record from the database" or do you mean "generate the next available job name"? Let's assume you mean "generate". In … | |
Re: If you store the player name as part of the structure then you have to do a search to find the record corresponding with a particular name. If you use a dictionary then you can get at any player by indexing with the player name. Structure PlayerInfo Dim Age As … | |
Re: You can use a Try/Catch block.The exact form will depend on the error you are getting. The syntax is Try 'your code here to process the text Catch ex As YourParticularException 'this code executes when you get an error End Try 'a general catch-all (which is not recommended) is Try … | |
Re: You don't need to do an export from the datagridview. You can do the insert directly by a query similar to the following; insert into tableb (fieldname1,fieldname2) select fld1,fld2 from tablea If you need to restrict the records from tablea then add appropriate where clauses. In your case, just use … | |
Re: With the following data VendorID VendorName 1 Sam 2 George 3 Fred 4 Orville VendorID TruckID 1 101 2 143 3 212 4 971 The following query select tblvendor.VendorName,tblvendor.VendorID,tblbill.truckid from tblbill inner join tblvendor on tblbill.VendorID = tblvendor.VendorID produces the following output VendorName VendorID TruckID Sam 1 101 George 2 … | |
Re: Fisrt of all, DO NOT EMPTY YOUR TRASHBIN. You might try an undelete utility like [recuva](http://www.piriform.com/recuva) which can be downloaded and run free. It is also possible that the missing files are in your trashbin (if one has been enabled on your pen drive). Check your trashbin and also see … | |
Re: Dim str As String = "user8:pass (190.82.87.11:3128)" 'you can split either at the blank or the "(" Dim userpass As String userpass = str.Split()(0) 'results in "user8:pass" userpass = str.Split("(")(0) 'results in "user8:pass " | |
Re: Congratulations on the new granddaughter. Can we get an update on the vision problem? I hope you have some good news. | |
Re: What error messages are you seeing (if any) and on what line? | |
Re: If you want to do something to each worksheet then the typical method is to enumerate over the collection as follows: For Each sheet As Excel.WorkSheet In onjwb(1).WorkSheets 'apply formatting Next | |
Re: The datatype should not be varchar. Storing numbers as numbers allows you to to calculations, perform aggregate functions and to compare and sort results correctly. If you store numbers as strings you lose all that functionality. Plus, using strings will likely use more storage. It's easy enough to format the … | |
Re: It would help to know what type of objects you are dealing with. ![]() | |
Re: Just a thought. In your original post the error was on the line that said CurrentControl.TestMessage() Because CurrentControl is there as access to fcurrentcontrol, why not just replace the offending line with fcurrentcontrol.TestMessage() | |
Re: The following code will display a datagrid cell value ini the title bar when that cell is clicked. Private Sub DataGridView1_CellClick(sender As Object, e As System.Windows.Forms.DataGridViewCellEventArgs) Handles DataGridView1.CellClick Dim dgv As DataGridView = DirectCast(sender, DataGridView) Me.Text = dgv.Rows(e.RowIndex).Cells(e.ColumnIndex).Value End Sub | |
Re: You can find the position of a character in a string by using the Instr function. For the search string just substitute Chr(#). For the values you are looking for you would use (respectively) Chr(1) or Chr(&H01) Chr(4) or Chr(&H04) Chr(18) or Chr(&H12) Chr(23) or Chr(&H17) For example, to look … | |
Re: There are several ways to do this. My preference (because this is where I have the most experience) is to use ADO (newer approaches use OLEDB). To do this try the following: Create a blank project Add a project reference to adodb by Project -> Add Reference Select .NET tab … | |
Re: There are some useful constants defined in VB. Three of them are vbCr, vbLf and vbCrLf where Cr = carriage return and Lf = line feed. For the following example I created a RichTextBox control then pasted in a few paragraphs. Double clicking on any paragraph will select that paragraph. … | |
Re: Unfortunately, there is no easy method to use for this. The Contains and ContainsKey (or even Find) methods do not search the listview for a given string. However, you can roll your own as follows: Private Function InListView(lvw, text) As Boolean For Each item As ListViewItem In lvw.items If item.Text … | |
Re: @DDANBE - Good to see someone else who came by the same route. I started by programming my physics labs in 1971 as a first year chemical engineering student. I kept burning holes in my lab coat so I switched to computer science. I've programmed on punch cards, paper and … | |
Re: You can access individual cells in a datagridview via the rows and cells properties. For example, to clear the cell at (2,2) you would do DataGridView1.Rows(2).Cells(2).Value = "" | |
Re: Please see [here](http://www.daniweb.com/software-development/vbnet/threads/423668/vb-windows-form-applications) | |
Re: In order to read your question I first have to download the zip file. Then I have to unzip it, only to discover that you have posted the information in a docx file, which my Word 2003 is incapable of reading (unless I go hunting for a plugin that Microsoft … | |
Re: It's not a query problem. It's a data problem. You are trying to insert a record with a primary key that already exists. It's like trying to store two different values into an array with the same index, except that in the array mode you just end up overwriting the … | |
Re: 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 … | |
Re: 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 … | |
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 … | |
Re: 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. | |
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. | |
Re: 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. | |
Re: 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 … | |
Re: A much faster way to delete all records is "TRUNCATE TABLE tablename" | |
Re: 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 … | |
Re: 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 … |
The End.