4,901 Posted Topics
Re: You may be able to use the bulk insert capability. Here ase several links to more information http://msdn.microsoft.com/en-us/library/ms188365.aspx http://www.simple-talk.com/sql/learn-sql-server/bulk-inserts-via-tsql-in-sql-server/ http://blog.sqlauthority.com/2008/02/06/sql-server-import-csv-file-into-sql-server-using-bulk-insert-load-comma-delimited-file-into-sql-server/ I used to do this when speed was a priority. I had to import 8000+ records every five minutes and it all had to be done as one transaction. Doing … | |
Re: You have to get your system or database admin to set up the database on the server and assign permissions. If you are going to allow multiple copies of your program to use the database concurrently then you will have to build in some sort of interlock to prevent multiple … | |
Naturally, I don't notice the typo until just after I commit the post. With the old system, I was able to click "Edit" to immediately correct the typo. Now I must leave the page and return to it to get the Edit option. Also, it seems a little counter intuitive … | |
Re: Dim con As New ADODB.Connection con.Open("Driver={Microsoft Access Driver (*.mdb)};Dbq=d:\temp\mydb.mdb;Uid=username;Pwd=password;") con.Execute("delete from myTable where ID=" & txtID.Text) con.Close() That's if ID is numeric. If it is a string then use con.Execute("delete from myTable where ID='" & txtID.Text & "'") | |
Re: If you are just saving it into the database then you don't need datasets and datatables. But I suggest you use a datetime field instead of separate date and time. To add the login record you can do Dim con As New ADODB.Connection con.Open("Driver={SQL Server};Server=.\SQLEXPRESS;Database=mydb;Trusted_Connection=yes;") Dim query as String = … | |
Re: Definitely use the filesystemwatcher. One thing to consider is how files are created in the folder. You may have a problem with timing. For example, if you are watching a folder for *.txt files, the event will be triggered when the file is created, but that doesn't necessarily mean that … | |
Re: One suggestion is to declare an array of references to panel and assign the panels to the array in the order you want to reference them. [code] Private panels(2) as Panel panels(0) = myPanel1 panels(1) = myPanel2 panels(2) = myPanel3 [/code] | |
Re: If each record has a primary key that is an auto-incrementing (identity) value then you could compare the field against the field returned by the record with key= MAX(pkID) where pkID is whatever name you are using for your primary key. | |
Re: If Sheet is a reference to the worksheet in question then Dim row As Integer = 1 Do Until IsNothing(Sheet.Cells(row,1).Value) row += 1 Loop | |
Re: If there are no records in the current year then set the ID to year*10000 + 1 otherwise set it to MAX(TraineeID)+1 | |
Re: You can't just post a page of code with no comments and expect us to tell you what is wrong with it. Tell us what it is supposed to do, then tell us what it is actually doing. Any error messages that pop up would be useful to know as … | |
Re: What line is generating the error? | |
Re: I'm a little rusty on "having" but I think "having" is used with aggregate functions as in "having SUM(field) > value". I think you want to use "where" instead of "having". | |
Re: Binary reads use byte arrays for the container. If you need to store the data as 16 bit values then you have to combine the bytes manually as in [code] Dim bin8() As Byte = System.IO.File.ReadAllBytes("d:\test.txt") Dim bin16((UBound(bin8)) \ 2) As UInt16 Try For i As UInteger = 0 To … | |
Re: I usually keep track of dynamic controls in an array or a collection of some sort. For example Private textboxes As New Dictionary(Of Integer,TextBox) . . . Dim tb As New TextBox tb.Text = "some text" . . . textboxes(textboxes.Count) = tb then you can refer to a specific control … | |
Re: Try For row As Integer = 0 To ListView1.Items.Count - 1 For col As Integer = 0 To ListView1.Columns.Count - 1 Debug.WriteLine(ListView1.Columns(col).Text & ": " & ListView1.Items(row).SubItems(col).Text) Next Debug.WriteLine("") Next | |
Would it be a big deal to add an option to the Search to restrict results to the current forum only? When I am on the VB.net forum, for example, and I do a search, I am interested in results in the VB.Net forum only. | |
Re: One easy way is to use a filter as in [code] Dim alltext() As String = System.IO.File.ReadAllLines(myfilename) Dim filtered() As String = Filter(text, "12345") [/code] You may have to include the field delimiters (commas, perhaps) in the filter string to prevent matches on the ID string if it should happen … | |
Re: What do you mean by [QUOTE]when my saler order takes 5[/QUOTE]Also [QUOTE]project this in my overall amount[/QUOTE] is unclear. | |
Re: The idea of event driven systems is to avoid polling/idling loops. Polling/idling uses CPU cycles unnecessarily and slows down anything else that may be running at the same time. One way to avoid this when you need to process several forms in succession and in a specific order is to … | |
Re: Try "\(\d{3}\) \d{3}-\d{4}" for the pattern. That requires a space between the area code and the number. Remove the space if you don't want it. | |
Re: You could use the "Lines" property to access each line individually, then check if the line can be converted to a number as in [code] For Each line As String in RichTextBox1.Lines() If IsNumeric(line) Then sum += Convert.ToSingle(line) End If Next [/code] | |
Re: I would imagine the logical place to put the code to clear the textboxes (or repopulate them) is in the same place that determines and displays the labels above those same textboxes. You could place the labels and textboxes in a container (like a groupbox) and use a loop like … | |
Re: Please try to explain this a little clearer. [QUOTE]i have two textboxs which have figues in them and need the 3rd textbox to display the figure[/QUOTE] I have no idea what you want to display in the third textbox. I also have no idea why you are using a SQL … | |
Re: We can probably give more help if you can be more specific as to the type of search. Lacking that, it looks as if you are on the right track. SQL uses "%" and "_" for wildcarding. A good explanation with examples can be found [URL="http://www.w3schools.com/sql/sql_wildcards.asp"]here.[/URL] | |
Re: I would start with the following tables and add fields as required. The Items table is your basic inventory of available items that can be ordered (one record per item). The Orders table contains a unique (program generated) order number plus some other info that is common to the entire … | |
![]() | Re: Your "Case zoom = 1" and "Case zoom > 1" may never get executed. If zoom = 1 then it will get processed by the "Case zoom < 63" clause. If zoom = 12 then "Case zoom < 63" will also trap it. You'll have to define your case clauses … ![]() |
Re: Please see [URL="http://www.daniweb.com/software-development/vbnet/threads/416249"]this thread that you were posting in.[/URL] The dictionary also supports a Remove method as in records.Remove("095") You could then (using the example in that other thread) System.IO.File.WriteAllLines(outputfilename, records.Values.ToArray) which creates an array of strings from the remaining values in the dictionary and writes them to a file. | |
Re: Are you talking about the values accessed via My.Settings? If so, please post your code. Check if your settings are defined with Application or User scope. | |
Re: For this example, both ListBox1 and ListBox2 have the Sorted property set to True. [code] Public Class Form1 Private Sub Form1_Load(sender As System.Object, e As System.EventArgs) Handles MyBase.Load 'add some words to ListBox1 Dim words() As String = Split("Some luck lies in not getting what you thought you wanted but … | |
Re: Buttons can be easily added and removed at runtime. I assume that the processing behind each button will be similar (varying only in name and cost of the item, etc)? If you provide more information I can be more specific as to whether this is a reasonable approach. | |
Re: There are two ways you could do it. If you have to do it ar run time then you can do [code] For Each ctrl As Control In Me.Controls If TypeOf ctrl Is OvalShape Then CType(ctrl,OvalShape).Size = New Size(20, 20) End If Next [/code] If you want to do it … | |
Re: What version of VB are you using? Can you post some of your code here? | |
Re: You relate two (or more) tables by having one or more columns in common. For example, a customer database would typically have a customer information table similar to [code] CUST_INFO Cust_ID Last_Name First_Name Address [/code] where Cust_ID is a unique number generated by the app or the datbase system. Any … | |
Re: I don't have enough info to really understand your problem or to comment on a possible solution but I do have a suggestion as to your table design. I strongly suggest that you create a separate table that contains (minimum) two columns. One column should be the patient's name, the … | |
Re: It would help if we knew what type of database you are using. In MS SQL Server, there is a function (COALESCE) that can be used to substitute other values if a database field contains NULL. For example, the following query select last_name, middle_name, first_name from myTable would return NULL … | |
Re: Use the BoldedDates property. Create an array of dates that you want to be displayed in bold and assign it to this property. Dim myDates() as Date . . . myCalendar.BoldedDates = myDates | |
Re: Select the DataGridView in designer mode and examine the entries under the Events tab in the properties panel. You will see events like CellClick CellEnter CellLeave etc. One of them should be what you are looking for. | |
Re: There is probably a solution that can be used from inside VB, but if one is not forthcoming I can suggest AutoIt. I have used this free (and very well supported) package to automate many tasks. You can write scripts using AutoIt's native scripting language, or you can write them … | |
Re: You could install a PDF printer (Cute PDF Writer is free), then create a Word application object in VB and use that to load and print the document. We don't write the code for you. For that matter, you don't need VB for that. Just use word to load and … | |
Re: Try For Each i As String In My.Resources.TextFile1.Split(vbCrLf) | |
Re: You might want to have a look at SyncBack. It comes in three versions: SynBack Pro $55 SyncBack SE $35 SyncBack Basic (Free) The free version supports scheduled backups. You can compare all three versions [URL="http://www.2brightsparks.com/syncback/compare.html"]here[/URL] It is highly configurable. You can select many options on backup such as what … | |
Re: I'll repost this in a few minutes. Just noticed something really dumb. | |
Re: To delete a control on the form you can do Me.Controls.Remove(controlname) controlname = Nothing So if you want to remove a button named (for example) btnAdd just do Me.Controls.Remove(btnAdd) btnAdd = Nothing To remove all controls of a given type (eg TextBox) do [code] For Each ctrl As Control In … | |
Re: I think the technique you want to use is called Gaussian Elimination. I must have written this code a half dozen times when I was back in university. I did versions with simple elimination, partial and full pivoting (actual and virtual). I hated it every time and I have long … | |
Re: My son had this problem with his Alienware laptop. It turned out that he was not running in high performance mode. Check that you have this mode selected. Also, make sure you have disabled any hotkey that might change the performance mode to a lower setting. | |
Re: You could try the encrypt/decrypt functions posted by sandeepparekh9 [URL="http://www.daniweb.com/software-development/vbnet/code/366392"]here[/URL] | |
Re: Couldn't help but notice there is no "Handles" clause on private void Button_Click(object sender, RoutedEventArgs e) so perhaps nothing is happening because the code isn't attached to the button. | |
I would like to see a "Subscribe to Thread" feature added. There are occasions when I want to be notified if there are new postings to a thread, even when I feel I have nothing to contribute. I (generally) don't like posting unless I can make a contribution to the … | |
Re: It is certainily possible to create an array of controls. There are several ways to keep track of them. You could use a dynamic array or a dictionary (to name two). Just declare the array as follows Dim ctrlarray(ListView1.Items.Count - 1) As PropertyGrid You create a new instance as ctrlarray(i) … |
The End.