i want to add some text at the begining of every line in a text file. i'm only able to append text to the file Imports System.IO Module Module1 Sub Main() ' Append the first line of text to a new file. Using writer As StreamWriter = New StreamWriter("C:\append.txt", True) writer.WriteLine("First line appended; rtp") End Using ' Append the second line. Using writer As StreamWriter = New StreamWriter("C:\append.txt", True) writer.WriteLine("Second line appended; 2") End Using End Sub End Module

Member Avatar
Member Avatar
+0 forum 7

Hello, I wrote some codes for student login. the codes checks for the "username", "password" as well as their type of "status", from the database. once this input are met, the student logs in successful, otherwise a message pops up. The problem i encountered is this, i have 11 student records in my database and only the first 6 students can login successfully. the remaining 5 students cannot login. Despite entering the correct username, password and status for the last 5 students in the database, the message "Invalid username and password" comes up. I don't know where my code went …

Member Avatar
Member Avatar
+0 forum 6

Hello guys! I'm doing some game here in VB.NET with age limitation. In my registration form, when user put his/her birthday, the computer identify his/her age. Only 15 years old to above who can play/register in my game. I used date time picker for the birthday. And age is not counted in my registration form.. just the birthday :'( Please help meeeeeeh

Member Avatar
Member Avatar
+0 forum 1

Good Day I have a program I am coding, but I have a peoblem with the calculation below. Oh the Application is for a Wallpaper App to calculate the number of single rolls of wallpaper required to cover a room. I attached a picture of the program Question: If the roll coverage is 45.5 sqrFt and the length, width and height of the room are 15, 18 and 20 respectively, the number of single roll will be 30 [Click Here](https://imgur.com/EY2JoSM)

Member Avatar
Member Avatar
+0 forum 2

hi I have datagridview which i want to add on several forms. Number of columons and all ather functionality remains the same. to avoid creating size, columns, column names each time, i am trying to create class control for datagridview which will give me by default number of columns and size once i add the datagrid to form. i have tried this . **But it shows ten columns instead of five** . attached picture Public Class ClsDgvJournal Inherits DataGridView Public Sub New() Width = 500 Height = 200 Dim Col1 = New DataGridViewTextBoxColumn With {.HeaderText = "AAA", .Name = "A", …

Member Avatar
Member Avatar
+0 forum 13

Hi! I've found this code in the net that merges rows successfully. However, the data is being written in the last row of the merge rows. What I want is that it should be written on the first instead. This is the code: Using gridBrush As Brush = New SolidBrush(Me.dgSM.GridColor), backColorBrush As Brush = New SolidBrush(e.CellStyle.BackColor) Using gridLinePen As Pen = New Pen(gridBrush) e.Graphics.FillRectangle(backColorBrush, e.CellBounds) If intRow < dgSM.Rows.Count - 1 AndAlso dgSM.Rows(intRow + 1).Cells(7).Value.ToString() = e.Value.ToString() Then e.Graphics.DrawLine(gridLinePen, e.CellBounds.Left, e.CellBounds.Bottom - 1, e.CellBounds.Right - 1, e.CellBounds.Bottom - 1) e.Graphics.FillRectangle(backColorBrush, e.CellBounds) End If e.Graphics.DrawLine(gridLinePen, e.CellBounds.Right - 1, e.CellBounds.Top, e.CellBounds.Right - …

Member Avatar
Member Avatar
+1 forum 6

hi everybody i need to get the application of software whoos breake the setup of vb.net whoose i built ago, becouse i forget it's password , tell me you know , thank you....

Member Avatar
Member Avatar
+0 forum 1

Hello all, I was wondering if I could get some questions answered about how cupons work in the work place. I have an idea which involves creating a very flexible cupon service, but would require knowing the rudiments of how cupons work. The main question I have is how is tax calculated on a ware as it is sold under a cupon service. I believe that would be the only thing I would have to stringently mandate as far as the cupon goes, since the institution wishes to clear the merchendise from the floor. The service would involve some C# …

Member Avatar
Member Avatar
+0 forum 3

Hey community, how can i show the connected USB-Device like keyboard, mouse, webcam and so on? Or how can i search in the connected USB-Devices, if I know the name or only a part of the name? I am looking for some examples since 2 days, but no one doesn´t work. So I hope you can help me with some code examples in vb.net. best regards joshi

Member Avatar
Member Avatar
+1 forum 21

Hi Mr Dani first i would like to thank you for help always for a lot of hard issues , i always check your site to have some help and now plz help me to get thime and date from server , becouse the clients in my school has a problem with bios battrey always so the time and date are not correct and i made an electronic exam wich save the records of information in addition to date and time to server coming from client my database is Ms Access and the programming language is vb.net 2013

Member Avatar
Member Avatar
+0 forum 1

Dear All i am developing .Net Application with MS Access and Crystal Report i am using DSN for crystal report to view the data from database. on each new client i have to go there to make DSN and then crystal reoport work, my application forms using database through physical connection string, i have managed query in my crystal report and then that command represent the data into crystal reports. everything working fine. my question is can i provide crystal report database source at runtime where is my database installed in application folder, so client just download my software and …

Member Avatar
+0 forum 0

hello sir getting error when run the loop and going to last value of row count please help and i can not use the 2nd loop in the place of cells(?????) number how can i use this **Index was out of range. Must be non-negative and less than the size of the collection. Parameter name: index** *** What I have tried:*** Dim aa As Integer For Z1 = 0 To DataGridView1.RowCount If Me.DataGridView1.Rows(Z1).Cells(2).Value = True Then aa = 1 Else aa = 0 End If Me.DataGridView1.Rows(Z1).Cells(7).Value = aa If Me.DataGridView1.Rows(Z1).Cells(3).Value = True Then aa = aa & 1 Else aa …

Member Avatar
Member Avatar
+0 forum 1

Hello, I want to have a manual IP-input-box like windows. ![tcpip_properties.gif](/attachments/large/4/1b3cb2d2b7b2be11e2b4abcef8d6fcc5.gif) I tried by MaskedTextBox but the problem is, the 3 pionts are sliding when i insert some numbers and i can insert letters and numbers higher then 255 (higher is not allowed in IP´s). I hope anyone helps me, maybe with some codesnips!?! :) best regards josh

Member Avatar
Member Avatar
+1 forum 7

Hi, I have checked all the prior forum questions on this topic, but none of the options seem to be working for me. I am creating an output file that goes into a specific folder for getting MP3 file information. When I run inside of Visual Studio Community 15, it works great ... no errors. When I take the EXE and create a new folder for the actual application and run by itself is when I get the error. I have tried turning on the UAC to Admin rights, with no luck. Here is my code Private Sub cmdCreateFile_Click(sender As …

Member Avatar
Member Avatar
+0 forum 8

Please tell what's wrong in this code.. I am using 3 DateTimePicker.. I think that line has some problem...Please Help.. ![Untitled.jpg](/attachments/large/4/f42d519e8bc5ead2edc0bf81395f227c.jpg)

Member Avatar
Member Avatar
+0 forum 5

Hello, i got a table in Excel (or exported to CSV). There are 3 columns (1. column = specification / 2. columns = value1 / 3. column = value2). On my vb.net form i got a textbox, 2 labels and a button. If i write in in the textbox "5" it should search in the Excel or CSV-File in columns A (specification" the "5" and then it should show the both values in this row in label1 and label2. I tried much things but i can only read and show the complete row in only one label and only from …

Member Avatar
Member Avatar
+0 forum 3

"Error in Line 4- System.NullReferenceException: 'Object reference not set to an instance of an object." Private Sub btnsearch3_Click(sender As Object, e As EventArgs) Handles btnsearch3.Click Dim vSearch As String = InputBox("Enter Employee Id to search the details:") If vSearch <> "" Then cmdSearch.CommandText = "SELECT * from Employee_Details WHERE Emp_Id =" & CInt(vSearch) cmdSearch.Connection = cnnOLEDB Dim rdrOLEDB As OleDbDataReader = cmdSearch.ExecuteReader If rdrOLEDB.Read = True Then txteid1.Text = rdrOLEDB.Item(0).ToString txtepn2.Text = rdrOLEDB.Item(1).ToString txtadd3.Text = rdrOLEDB.Item(2).ToString txtphon4.Text = rdrOLEDB.Item(3).ToString dtpdobirth5.Value = rdrOLEDB.Item(4).ToString txtapt6.Text = rdrOLEDB.Item(5).ToString dtpduty7.Value = rdrOLEDB.Item(6).ToString dtpdoa8.Value = rdrOLEDB.Item(7).ToString rdrOLEDB.Close() MsgBox("Record found") Exit Sub Else rdrOLEDB.Close() MsgBox("Record not …

Member Avatar
Member Avatar
+0 forum 2

Hi All Brothers I am working on ERP system and i need one help I wrote code for Datagrid auto complete. this code is working perfect but it only showing one Column record from database what i need is i want first column is to autocomplete as i did and it should fill related columns automatically linked with first column. please guide me with Codes many Thanks My Code Dim strConn As String Dim da As SqlDataAdapter Dim conn As SqlConnection Dim ds As New DataSet strConn = ("Server= DESKTOP-QN6F623; Database = stock_in;Integrated Security = false;User ID=dis;Password=0m3rP@ss") conn = New …

Member Avatar
Member Avatar
+0 forum 3

pls can iny one help me , i want to display table from database or datagridview to template word for exmlple i have table "items" with 3 champ id_items,name_items,price_items

Member Avatar
Member Avatar
+0 forum 1

Getting error when showing data in list view, please help me..... Error :* Cannot add or insert the item '10-07-2018' in more than one place. You must first remove it from its current location or clone it. Parameter name: item* I use Vb.net 2010 visual basic sql server 2008 r2 stored procedure one listview I want this type of structure (example) id date item_name qty. amount 1 1/1/2019 a 2 10 B 1 12 x 14 100 zz 4 52 2 4/1/2019 M 5 80 N 4 50 But when I showing to the data 1st item show on list …

Member Avatar
Member Avatar
+0 forum 4

I would like to create a Microsoft Access database and integrate it into my VB.net application. I am also hoping to distribute this application to others. My concern though is whether or not users who download my application will also need Microsoft Access in order for the database (and app) to work properly. Will the app still be able to create, modify and delete records if the users themselves don't have Access? Should i be looking into a different database software?

Member Avatar
Member Avatar
+0 forum 1

i have a mssql datagridviewer. i only need when user load the form..they must get empty datagrid...data only show when they search any item or add item....i worked on search and add but i am confused on load event ....please help with code

Member Avatar
Member Avatar
+0 forum 1

I have a text file with the following contents: Andrew Law 32 6'1 123 Pounds Tom Harris 19 5'5 180 Pounds Randy Poffo 45 5'3 141 Pounds Now on my form i have a listbox and four labels. What i would like to do is have the listbox show only the names of the people in the text file (Andrew Law, Tom Harris, Randy Poffo) and when the user clicks the persons name in the listbox i would like each of the labels to show the corresponding details for that person (one label showing age, one showing their height and …

Member Avatar
Member Avatar
+0 forum 2

I have a worksheet of about 388 items that each item is exported into a template worksheet that is created to itemize each item. It creates the worksheets but I can't get it to stop looping at the line of code in bold comments icons. The line that it stops at is to name the worksheet from the column "A" of the list of 388. I have shorten the list to work on the code. So when I'm done I would have workbook of 388 worksheets from the template made. The template worksheet name is "wbs_template" (hidden). I have attached …

Member Avatar
Member Avatar
+0 forum 11

Dear all I am working on a project for my customer . I wrote code to search items from sql using vb.net Now my code working fine.....when I search data using itemid it show me data in all related textboxes but not in datagrid here my code Dim connection As New SqlConnection("Server= DESKTOP-QN6F623; Database = dbo_main; Integrated Security = true") Dim command As New SqlCommand("select * from items where itemnumber=@itemnumber", connection) command.Parameters.Add("@itemnumber", SqlDbType.Int).Value = ItemnumberTextBox.Text Dim adapter As New SqlDataAdapter(command) Dim table As New DataTable() adapter.Fill(table) ItemnameTextBox.Text = "" If table.Rows.Count() > 0 Then ' return only 1 row ItemnameTextBox.Text …

Member Avatar
Member Avatar
+0 forum 1

Greetings, I'm kinda new to ASP.NET so I'm unsure as to how to proceed with accomplishing this task. I have a webpage that contains a GridView and controls associated to that such as Add, Issue Equipment, Edit, Delete. What I'm trying to do is when I click on a cell on the gridview the row will be selected then when I click Edit, the modal popup for editting will display with the values and details of that gridview item that Ive selected. How do I pass that gridview item and its values to that Edit modal popup? I use a …

Member Avatar
Member Avatar
+0 forum 2

Hi, I Have below table I want all rows with all coloumn from below table where ActCode is 1162828 and sum of DocAmount for DocNo. i.e where the docNo is repeated i want only one row with sum of amount of all repeated rows. ** "Select *, Sum (DocAmount) from TblPurLedTranData whre TblPurLedtranData.ActCode='" & 1162828 & "' Groupby DocNo " ** PosDate DocDate DocNo DocAmount DueDate Status Period DocType FinYear Chan ActCode 10/10/2018 12/10/2018 369896     36980      11/11/2018 INV      5         PUST       2018       PUST       1243684    10/10/2018 12/12/2018 665        36000      11/01/2019 INV …

Member Avatar
Member Avatar
+0 forum 4

[B][COLOR="Green"]Hi Guys :).. I hope you fine :), I need the best and easist way for printing the form ,nested of PrintForm tool coz it is very bad :angry:,it prints the form [U][COLOR="Red"]like screen shot :angry:[/COLOR][/U] ,what I want print entire form on A4 ... Any suggestions ? :( Thanks for your help :)[/COLOR][/B]

Member Avatar
Member Avatar
+1 forum 4

Hello all, I am relatively new to Visual Basic and have managed to muttle my way through creating a 2013 Word document that has some ActiveX controls. The final control I put in place is a Command Button that, when clicked, it sends the form off to an email. That is all working great, however, I would like to have a pop-up message that displays after the button is clicked, letting the form sender know the form has actually been sent. I have put the code I used for this Command Button below. Any help would be much appreciated. Private …

Member Avatar
Member Avatar
+0 forum 9

Hi guys, This is my first post and so glad to start sharing the knowledge. I am using Mysql database with VB.NET and I have this code : Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click Dim str As String = "Server=localhost;Port=3306;Database=testdb;Uid=root;Pwd=password" Using con As New MySqlConnection(str) Dim query As String = "select * from testdata where rfid_tag='" & TextBox3.Text & "' and Date_serve<= '" & Date.Now.ToString("yyyy-MM-dd ") & "' and Start_Time<= '" & Date.Now.ToString("HH:mm:ss ") & "' and End_Time>= '" & Date.Now.ToString("HH:mm:ss ") & "' or amount_serve='' " Dim cm As New MySqlCommand(query, con) con.Open() Dim rd …

Member Avatar
Member Avatar
+1 forum 2

The End.