Answer Questions
Wildert How to do a loop to insert string to db in everyrows(Window Application)
Dear users, pls help me with this How to do a loop that enable the user to insert every single string in every rows for the subsequently rows to insert into DB.. Dim icount As Integer = Me.DataGridView1.Rows.Count For icount = 0 To icount Dim s As String = Me.DataGridView1.Rows(0).Cells(0).Value Dim s1 As String = Me.DataGridView1.Rows(0).Cells(1).Value Dim s2 As String = Me.DataGridView1.Rows(0).Cells(2).Value Dim s3 As String = Me.DataGridView1.Rows(0).Cells(3).Value Dim s4 As String = Me.DataGridView1.Rows(0).Cells(4).Value Dim s5 As String = Me.DataGridView1.Rows(0).Cells(5).Value Dim s6 As String = Me.DataGridView1.Rows(0).Cells(6).Value Dim s7 As String = Me.DataGridVie ...Show All
Bill Calkins Using Application Settings??????????????????????
I need to save an array of about ten elemnts in the application setting as application wide setting user scoped I've tried in settings page of My project properties but I don't figure out how to do it is there is any way to do that if there is no way has any one an idea of the best way that I can have the general Idea done Can you not use one of the types from system.collections such as an arraylist Are we talking one or multi-dimensional array / data structure If this is the case, then i dont know much about saving varialbes in the project settings. Another way to achieve the same goal would be to save the varialbe in a txt file on the computer somewhere ...Show All
michaewlewis Printing alignment vb2005
I am printing a schedule containing currency. I can set the x coordinate but my problem is aligning the values of differing lengths i.e. 123.33 4563.21 Is there a built in alignment method Thanks for the info, I have integrated it into my for loop and it works fine. I appreciate the need for a fixed font, but is there any other font that is more aesthetic than Courier New. Regards hemo You should be able to use any font you like. The numbers themselves usually have the same width. You will need to center things on the decimal point, and use the string methods to keep track of the parts before and after (and the - sign). Or use the Measu ...Show All
userxid Reading and Writting Special Charactor
Hi Anybody Please help me to read and write Text with special character from and to a file. Thanks Masi Use the stream reader and writer to write to files...and use the encodiing class to get and set the encodeing of characters.... (Object Browser) Public MustInherit Class Stream Inherits System.MarshalByRefObject Member of System.IO Summary: Provides a generic view of a sequence of bytes. Attributes: <System.Runtime.InteropServices.ComVisibleAttribute(True)> Public Class StreamReader Inherits System.IO.TextReader Member of System.IO Summary: Implements a System.IO.TextReader that reads characters from a byte stream in a particular ...Show All
SQL New how to use the progress Bar
i have developed an application that copies records from one table in Database1 to another table in Database2. i want to use the progress bar to display the progress of the copying. please how do i do this Why would you have to do any threading.... If you want to copy the records from one dataset to another - then as long as you have specific actions which you can set the progressbar property at then you can do it all on the main thread. Of course while the copy is going on the UI may become a little unresponsive - which if you wanted to remain responsive so you could do other things then a background thread may be a good idea - but if your simply wanting to show the progress after each row has been cop ...Show All
RaimondB I Need Help With Drop Down List Boxes
i was wondering if someone knew how to set drow down list boxes = a value in the table that is pulled up by the main drop down list box. I have a tracking No ddl that is sopposted to populate the entire table with the values for that record in the table. i have it where it will fill in the text boxes but the other ddls in the table are being filled by other tables that are f-keys in the trackingNo table. I now need the trackingNo DDL to select the right value for the other tables. here is the code for the ddlTrackingNo and see if that helps you help me... Please any help is welcomed.... Thanks, WoFe Private Sub ddlrackingNo_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ddlTrackingNo.Selecte ...Show All
ben5173 Reading Bytes From SerialPort.. Help...
Hi everybody there. I developed an application, that uses a serially connected device which responds with bytes. I read these bytes sychronously and I want to print each byte value in an output .txt file. My problem is that when the device stops sending bytes, in the txt file are printed only the first half values of the received data. When I am just counting how many times some bytes appeared I am getting corect results. My settings for the serial port are BaudRate = 9600, Parity =none, Handshake= none, StopBits = 1, DataBits =8 and ReadTimeOut = -1. What seems to be the problem and how can I overcome it Am I missing any properties of the serial port object intialization Is a problem of the serial port settings (ha ...Show All
MShetty Dealing with directory permissions while recursing the file system
I am working on some code that displays the filesystem in a treeview. I want to avoid showing any directories or files for which the user does not have permissions. I tried the following code but it is not working. The last tree node displayed is one that causes an UnauthorizedAccessException Any help would be greatly appreciated. Private Sub BuildFromFS(ByVal node As TreeNode) Dim strDir As String = node.FullPath node.Nodes.Clear() Dim currFldr As DirectoryInfo Dim fldr As DirectoryInfo currFldr = New DirectoryInfo(strDir) Try If currFldr.GetDirectories.Length > 0 Then For Each fldr In currFldr.GetDirectories() If Not (File.GetAttributes(fldr.FullName) And F ...Show All
Amos Soma How to save active page displayed through I.E.6 under text page.
Hello, I would like , through Visual Basic 2005 command, save under c:\test.txt an active sheet displayed on the screen through I.E.6 browser. I am working Windows XP . Any support will be welcome ! Here more information about the webbrowers class: http://msdn2.microsoft.com/en-us/library/system.windows.forms.webbrowser.aspx Many thanks for yr reply.. It sounds good ! As I am a beginner in V.B. I have some problem in "copying" the programe.. sorry for that ! If I undersatnd well I have to : 1) Open a win form 1, with a webbrowser 2) Open a win form 2, with the two buttons "save" and "browse" buttons 3) copy your programe on win form 3 ...Show All
lachlanj How to delete the Vbnewline
Hi, I open a textfile into a Textbox using readstream.readtoend. after split and delete all the space in the file, i get a array with all the data and Vbnewline. The vbnewline are not counted as elements in the arrary but they do exist in the array.. This made some troubles to me converting the array to type short. Does anyone has any similar problems before Thanks.. I'm not sure how you splitting the items Dim crlf() As String = {vbCrLf} Dim line As String() = strContents.Split(crlf, StringSplitOptions.None) I found that if I had a CRLF at the end of each line and did a split using VBCR but not stringsplitoption parameter that it would leave the lf character in the string arra ...Show All
project2n5e0o1 Writing and Reading data from Excel using a Rich Text Box
Hi Can anybody help me with this I am trying to insert large values into the Excel from a Rich text box, But when i try to read the data back it shows me a lot of garbage value along with the data which i wrote. Please help me Thanks in anticipation Vipin Rathaur Can you show the "garbage" that is being returned and the code your using. Perhaps these are encoding or formatting information which rich text boxes allow. If you want to simply write straight text and read it - why not use the standard textbox control instead of the richtextbox. Hi I wont the text to be stored in a particular format like with bullets s ...Show All
Worf Invoke - trying to call a sub on a form from a separate thread
frmMain has called a background thread to do work, this thread creates other threads to do work. From these threads I want to update a textbox with status updates (text) from those threads. I have tried setting up a delegate and using Invoke to pass the text back to a sub on frmMain, but it doesn't work. I need help. Thanks Not sure what your specific error is without code to look at, but here is some example code. To build, create a form with three TextBoxes (Status1TextBox, Status2TextBox, Status3TextBox) and a Button (GoButton). Then add this code: That will launch one thread that starts three more which each run until the app is closed. Each of the three threads updates it's textbox with the current number of iterations, ...Show All
Al Christoph List Folderames in a folder
How do I list the names of all the folders inside another folder Thanks Spotty, Like that, one liner, problem is that in the listbox I'm showing C:\MYFOLDER\Folder1 C:\MYFOLDER\Folder2 C:\MYFOLDER\Folder3 What I want to show is just the folder name not the full path Folder1 Folder2 Folder3 you can either do a remove: currentFolder.Remove("\\", "") or Me.theListBox.Items.Add(currentFolder.SubString(currentFolder.LastIndexOf("\") + 1)) safer would be the first one :) Thanks again Ahmedilyas, The second worked Me .lstTheme.Items.Add(currentFolder.Substring(currentFolder.LastIndexOf( "\" ) + 1)) The first one ...Show All
Yasir Imran using variables across different subs.
Hi all, I'm trying to include logging in my backup app at every level i can, but i'm running into a snag in how to set up the option of where the log file should be kept. Here's the structure of what i have that works: public class form1 dim logfilename as string = "some filename" dim object as io-stream(logfilename) private sub do something object.write end sub private sub do something else object.write end sub ...and so on. What i'd like to do is give the user the option to specify the log file, like this: public class form1 dim object as io-stream(logfilename) private sub (setting options) dim logfilename as user-defined-string end sub private sub do something object.write end sub pr ...Show All
David Hubbard Question about Hiding the command console while executing a module.
Hi, Would somebody please tell me how to hide the command console when executing the module that creates it No no, I have two windows to hide; the window that shows when I execute the module (affectionately called Window #1) and the window that shows when I execute the process from the module (Window #2). I know how to hide Window #2 (and it works to boot!). However, I do not know how to hide Window #1 (which is the window that appears when I execute the module). I appreciate your effort and am trying to explain my problem correctly. Thank you for your patience. Except that "Me" is not valid within a module. I'm developing a VB Module so that the executable wi ...Show All
