133 Posted Topics

Member Avatar for Papa_Don

Group, You've helped me write a routine that merges and formats a text file when multiple files exist. The code is as follows: If fileCount = 3 Then RestranName = getRestranName(0) RestranName2 = getRestranName(1) RestranName3 = getRestranName(2) Dim readtxt() As String = File.ReadAllLines(RestranName) 'Deleted the actual file. File.Delete(RestranName) 'Now time …

Member Avatar for Santanu.Das
0
969
Member Avatar for Papa_Don

Group, Some weeks back you helped me solve a formating issue with a text file that originates from a UNIX based program (see [https://www.daniweb.com/software-development/vbnet/threads/489626/remove-end-of-report-line-and-format-unix-text]). While reviewing this newly formated data I saw that a character was place at the beginning of each page. Thus, I assume it does set the …

Member Avatar for cgeier
0
502
Member Avatar for Papa_Don

Hi Group, I've written a macro to save a copy of the spreadsheet at the end of each day. I tried to test it as a shared file and learned the macro wouldn't work. Is this normal for a shared document? If so, is there a way around this? How …

Member Avatar for Reverend Jim
0
326
Member Avatar for Papa_Don

I need to identify how the code identifies that a file is at the "eof" (end of file). Here's why: On Monday's, I'm having to combine text files created over the weekend that will eventually be read and pulled into an Excel spreadsheet (generally there are three files). Using VB.net, …

Member Avatar for |-|x
0
448
Member Avatar for Papa_Don

Group, Today I learned with `Me.Cursor = Cursors.WaitCursor` and `Me.Cursor = Cursors.Default` do. I've seen other programs, when running, a "message box" comes up and let's the user know what in the routine is happening. If it's possible to do in VB.net, I'd like to do the same thing. However …

Member Avatar for §AE§
0
3K
Member Avatar for Papa_Don

I'm writing a routine where the user can populate up to 8 textboxes with numbers. Since there is potential for these numbers to be unsorted, I want to sort these prior to saving. However it's probable that all of the textboxes will not be used. My challenge then is how …

Member Avatar for Minimalist
0
704
Member Avatar for Papa_Don

Hi group, I've written some VBA code behind an Excel spreadsheet to check to see if another workbook is open. If it isn't open, I'm having the code open it for me. This works fine the first time the macro runs. However this same spreadsheet has a cell where a …

Member Avatar for Papa_Don
0
289
Member Avatar for Papa_Don

Hello Group, I'm trying to convert some VBA code into VB.net. Here is that VBA code: Open filePath For Input As #1 ' filePath = the text file I need to read Do Until textRowNo = 8 'discard these first 7 rows... Line Input #1, LineFromFile 'this is the row …

Member Avatar for Reverend Jim
0
9K
Member Avatar for Papa_Don

Group, When publishing my first program, I noticed that it put the program in the App folder as opposed to "C:\Program Files\". Is there a way to direct where everything should be stored when you install it on the users computer? Thanks, Don

Member Avatar for imti321
0
330
Member Avatar for Papa_Don

Group, I'm now having to merge several of these text files together. At the end of each of the text files is a line that says "End of Report". I need to eliminate this line completely. This code does the merge for me: RestranName = getRestranName(0) RestranName2 = getRestranName(1) System.IO.File.AppendAllText(RestranName2, …

Member Avatar for Papa_Don
0
754
Member Avatar for Papa_Don

Group, I'm counting the number of files in a folder using the following code: Dim counter = My.Computer.FileSystem.GetFiles(folderName) This produces a value that doesn't appear to be either a string or an integer. Would you know how to convert this value into an integer that can be used? Don

Member Avatar for Papa_Don
0
737
Member Avatar for Papa_Don

I'm making some "cleanup" changes to my 1st VB.net project that I'm publishing. The project has an "Assembly Name". But I've just realized that the Root Namespace has the default name of "WindowsApplication1". I've got to believe this needs to be changed. How important is the name I put here? …

Member Avatar for Nutster
0
1K
Member Avatar for Papa_Don

Group, I've published my first VB.net program (woo hoo!). This prompts me to ask a couple of questions: 1) I'm using a couple of text files to hold some user updated info. Is there a way to have the setup program to create the folder and attached the text files …

Member Avatar for cgeier
0
432
Member Avatar for Papa_Don

Hello Group! I am in need of converting a "text" file created by a UNIX based program (it is only semi-formatted) and put it into a more-formatted text (.txt) file. Put a different way, this needs to be converted such that it can be opened in Notepad and it be …

Member Avatar for Papa_Don
0
671
Member Avatar for Papa_Don

Group, In a post in VB 4/5/6, I question how to open a file with a wildcard as the file extension ([https://www.daniweb.com/software-development/visual-basic-4-5-6/threads/488809/accessing-a-file-with-a-ever-changing-name](null). That worked fine for VBA. However I'm trying to do the same thing using VB.net. I'm having trouble finding the correct syntax. I hope you can help. Specifically, …

Member Avatar for Papa_Don
0
4K
Member Avatar for Papa_Don

Group, I'm taking a text file that is storing ID numbers in a single column that looks like this: 123 3050 3971 I'm looping through the text file line for line and putting each ID number into a textbox. My question is: Am I writing this code the most efficient …

Member Avatar for Papa_Don
0
3K
Member Avatar for Papa_Don

Hello everyone! Is there a way in VBA to find a file name that has an unknown portion to it? Let me explain: Our computer system is UNIX based. It is creating a text file for us that uses the date, the hour, minutes and seconds that the file was …

Member Avatar for Minimalist
0
330
Member Avatar for Papa_Don

Hello group! I need to scrape data from the screen of an open application. It will be used as text, so it will need to be converted into a string that I can parse. I've looked around and found scrapers that use the "picture" as a bitmap or jpeg. The …

Member Avatar for cgeier
0
3K
Member Avatar for Papa_Don

Group, I'm trying to improve a macro in an EXCEL spreadsheet. The spreadsheet has multiple tabs (sheets), some of which have grouped rows in them. My "cleanup" routine needs to check to see if these grouped rows exist. Is there some code that does this (hopefully boolean)? If it helps, …

Member Avatar for ddanbe
0
758
Member Avatar for Papa_Don

Group, I've created a large spreadsheet with a fair amount of code behide it. Historically it has run well and with no issues. However it has started giving me a "Run-time error '9': Subscript out of range" error. I have no idea what is causing it. It is stoping at …

Member Avatar for Papa_Don
0
2K
Member Avatar for Papa_Don

Group, I'm trying to write some code that will read the clocktime. When it hits a predetermined time, I want it to run a routine. I know how to do this in VB.net. It would be done like this: Private Sub Timer1_Tick(sender As System.Object, e As System.EventArgs) Handles Timer1.Tick If …

Member Avatar for Santanu.Das
0
3K
Member Avatar for Papa_Don

Hello group! I've created a short program to open an application at a specific time. It's working but is attempting to open the application multiple times. What should I be doing to control the number of times it is opening? It only needs to open one time. Here's my code: …

Member Avatar for Papa_Don
0
365
Member Avatar for Papa_Don

Hello Group, I'm writing a macro to match dates from one spreadsheet to another. Specificially, SpreadsheetA has the date listed as text. I want to match that date to a range of dates in a column to find the row the matching date is on. I have some things that …

Member Avatar for Papa_Don
0
4K
Member Avatar for Papa_Don

I need to dynamically group rows together in an EXCEL worksheet. The obvious choice to do this will be VBA. I hope you can help. My spreadsheet has 18 columns and (up to) 5,000 rows of data. I've written the following code which works "OK" however it fails to group …

Member Avatar for Papa_Don
0
5K
Member Avatar for Papa_Don

Hi Group! I'm curious to know, is it is possible to build a custom control in Visual Basic? Specifically, I want to build a control that would be similar that would be similar to a ListView (in the Detail "view"). However the difference would be in how it actually displays. …

Member Avatar for deletedaccount
0
281
Member Avatar for Papa_Don

Group, I've got a protected spreadsheet at work that prevents me from creating links or writing macro's to do some repetitive copying and pasting from one spreadsheet to another. I hope someone can help. I'd like to use VB (if possible) to copy from a specific range in Spreadsheet1.Sheet1 (let's …

Member Avatar for jared.geli
0
404
Member Avatar for mikidrip

Here's the code that I use to make the connection to the database: Public sConnection As String = "Data Source=Don-PC;Initial Catalog=DataDesignSolutions;Integrated Security = True;User ID=DON-PC;Password=acd67011;" Public con As New SqlConnection Public cmd As New SqlCommand Public strQ As String Public sql As String con = New SqlConnection(sConnection) cmd.CommandText = "SELECT …

Member Avatar for Papa_Don
0
190
Member Avatar for Papa_Don

Hi group, I'm looking through the book "Mastering Microsoft Visual Basic 2010" by Evangelos Petroutsos. I'm trying to work through a chapter on designing windows controls. In the first step the directions read: "Start a new project, and in the New Project dialog box, select the template Windows Forms Control …

Member Avatar for Papa_Don
0
1K
Member Avatar for Papa_Don

Group, I've got 1000 questions regarding this "Rocket" (Unidata) database, but I digress. To give you some background, I do have some experience with SQL, but nothing with Unidata. But given what I've read, I can't believe it is that much different from SQL, aside from the command syntax (I …

Member Avatar for pritaeas
0
311
Member Avatar for Papa_Don

Hi group! I hope all is well! As part of my connection string and database insert/update, I have an exception command in it to display an error message. Can this also be read or made into a true/false answer? I would like to have my program run very short command …

Member Avatar for Reverend Jim
0
184
Member Avatar for Papa_Don

Hi group! I have what I hope is a unique question: In need to populate a combo Box with the information stored in 6 different columns on one row of a data table. I know how to do this if it just one column and one row. To be specific, …

Member Avatar for Papa_Don
0
174
Member Avatar for Papa_Don

In trying to teach myself about the properties of the textbox, I'm wondering what the propert "Lines" is all about. The value in the property says "String[]Array". When I click this, a box comes up that asks "Enter the strings in the collections (one per line)". Can someone explain to …

Member Avatar for Papa_Don
0
181
Member Avatar for Papa_Don

Group, I may have made a huge mistake repairing SQL Server Management 2008 Express. Here are the details: I'm running Windows 7 on a Toshiba Laptop. SQL Manager 2008 had been installed and was working fine. I had some registry errors popping up, so I ran ARO 2013 to do …

Member Avatar for Papa_Don
0
253
Member Avatar for Papa_Don

Group, I've found code that will format a number found in a TextBox to display it with two decimal places. It looks like this: Private Sub txbStateTaxPcnt_Leave(sender As System.Object, e As System.EventArgs) Handles txbStateTaxPcnt.Leave stateSlsTax = Convert.ToInt32(txbStateTaxPcnt.Text) txbStateTaxPcnt.Text = stateSlsTax.ToString("n2") End Sub This works great when a whole number is …

Member Avatar for nashy13
0
12K
Member Avatar for Papa_Don

Group, Historically I've used 'Convert.ToInt32(TextBox1.Text)' when moving the numbers stored in a TextBox to an integer variable. But it's made me wonder what the difference is between Int16, Int32 and Int64. In simple terms, can someone explain this to me (remember, I'm simple minded!)? As a follow-up question, I'm finding …

Member Avatar for Papa_Don
0
3K
Member Avatar for Papa_Don

Group, I'm not sure if this is a SQL Server issue or a Visual Basic issue. However during the runtime, I'm getting the following error message: String or binary data would be truncated. The statement has been terminated. I'm not sure why or where this is being caught. Searching this …

Member Avatar for Papa_Don
0
3K
Member Avatar for Papa_Don

Hello Group! I've looked around to see if there is specific code in VB.net to do this, but I haven't seen any. I'm using ListView/Detail and want to ensure that it is sorted ascending by one specific column. That column is called "hdrLineNo". I know that I can choose "Sorting …

Member Avatar for Jx_Man
0
8K
Member Avatar for Papa_Don

Group, I've written a short stored procedure in SQL Server 2008 to create a new Order Number. The code looks like this: INSERT INTO ORDRNUMBERREC(OrderNo,UserId,CreateDate) SELECT MAX(OrderNo)+1,'system',GETDATE() FROM ORDRNUMBERREC WITH (TABLOCKX) In VB2010, I've written the following code to execute the stored procedure: con = New SqlConnection(sConnection) cmd = New …

Member Avatar for G_Waddell
0
11K
Member Avatar for Papa_Don

Hi Group! I've created a stored SQL procedure that will need to be modified to lock the table, run the commands and then unlock the table. I need to do this because I want any other users/programs that will need access to "wait in line" until the procedure is finished. …

Member Avatar for Papa_Don
0
1K
Member Avatar for Papa_Don

Hi group, If you've seen my posts before on SQL Server stuff you know I'm a "raw rookie" with this. Again, I need some help. I'm going to need SQL to create an order number for me. I've created a datatable with two fields: OrderNoID (key) and OrderNumber. I've already …

Member Avatar for Papa_Don
0
132
Member Avatar for Papa_Don

Hi Group! I suppose this should be titled, "Everything You Wanted to Know about ListViews, but were Afraid to Ask". Here are my questions(s): I've used ListView with "Details". This has been great when getting smaller bits of information to easily display and edit. However I'd like to use it …

Member Avatar for pritaeas
0
109
Member Avatar for Papa_Don

Group, I've learned to find the index number of a specific character within a string by writing dIndex = myText.IndexOf("|") Obviously, this start counting left to right. But I'd like to do the same but start counting from the right side of the string to the left to find the …

Member Avatar for Papa_Don
0
8K
Member Avatar for Papa_Don

Group, I'm trying to write the commands to update a row within a SQL table. I've written the following: USE DATADESIGNSOLUTIONS SET IDENTITY_INSERT LocationID ON INSERT INTO LOCATIONS_SETUP(LocationID, LocationNumber, LocationName, LocationAddress1, LocationAddress2, LocationAddress3, LocationCity, LocationState, LocationZipCode, LocationZipCodeExt, PhoneNumber, FaxNumber, BillToAnswer, BillToLocation) VALUES(10, 1, 'Traditions in Tile / Buford RDC', '4325 …

Member Avatar for Papa_Don
0
215
Member Avatar for Papa_Don

Group, I'm working to use a second for to do task that will be populate texts boxes in the first form. However I'm getting an error that says, "An error occurred creating the form. See Exception.InnerException for details. The error is: Object reference not set to an instance of an …

Member Avatar for Papa_Don
0
751
Member Avatar for Papa_Don

Hello group! I've seen one short discussion of ensuring that the controls within a form will shrink, grown and stay in their proportional position as the user changes the form size. Unfortunately it covered parent/child forms, etc. It didn't make a lot of sense to me. Ultimately I do want …

Member Avatar for Papa_Don
0
556
Member Avatar for Papa_Don

Hi group, I recognize the today, most people navigate from control to control within a form with their mouse. However some old school people may want to use a "enter" key or a up, down, left or right arrow. I'm curious to know if these kinds of events (if that's …

Member Avatar for Maligui
0
567
Member Avatar for Papa_Don

Group, I'm working with a ListView box for the first time. I've figured out how to populate it with data from a database. I now want to click one line of that ListView and have it return each of the five cells from that line into 5 textboxes. I've written …

Member Avatar for Papa_Don
0
188
Member Avatar for Papa_Don

Hi group, I've been playing with a ListView and I'm struggling to get it to populated with info in a database. I'm hoping you may see something in my code that is creating the error. Dim con As New SqlConnection Dim cmd As New SqlCommand Dim rdr As SqlDataReader = …

Member Avatar for Hazuan Nazri
0
3K
Member Avatar for Papa_Don

Group, I'm declaring a variable in one form that I need to make available in a second form. My code in Form1 looks like this: Public Sub FuncKeysModule(ByVal value As Keys) Select Case value Case Keys.F5 Dim searchtype As Integer If txbPartNo.Focused = True Then Popup_PartNumbers.Label1.Text = "Enter the beginning …

Member Avatar for Papa_Don
0
221
Member Avatar for Papa_Don

Hi group, I'm still learning Visual Basic and SQL. Please overlook my inabilities. I'm writing a module that is meant to write a small amount of data to a database. I've named these fields 'PrinterID', 'PrinterName', 'PrinterNumber', 'PrinterLocation' and 'PrinterAddress'. The user will eventually have 30 or 40 records to …

Member Avatar for Papa_Don
0
2K

The End.