467 Posted Topics
Re: > PictureBox1.Top = Panel1.Height / 2 - PictureBox1.Height / 2 > PictureBox1.Left = Panel1.Width / 2 - PictureBox1.Width / 2 you can do it as PictureBox1.Top = (Panel1.Height - PictureBox1.Height) / 2 PictureBox1.Left = (Panel1.Width - PictureBox1.Width) / 2 | |
Re: > cmd.CommandText = "INSERT INTO Login (log_username,log_password) values(values ('" & TxtUsername.Text.Trim() & "','" & Txtpassword.Text.Trim() & "' )" It should be cmd.CommandText = "INSERT INTO Login (log_username,log_password) values(@Username,@Password)" "This codes not suitable for Log-In form . It should be for Sign-Up form. " | |
Re: Without opening recordset how do you access it. Create a SQL query statement to match data between two dates. If there then exit or insert new data. I just give you an example 'Creating a function to open recordset 'It is at module lavel to reuse it 'So it is … | |
Re: @Christopher_12 : What do you mean with Encrytion / Decryption of your password. You already entered 5 uid and pwd manually. You can [encrypt / decrypt](https://www.daniweb.com/software-development/vbnet/code/366392/encryption-and-decryption-functions-in-vb-net) programmatically at the time of save and retrieve pwd from database. Secondly clear your logic about **dr.HasRow()**. Are you sure uid and pwd distinct … | |
Re: Please post your codes , how far you write and describe your probs and exceptions what are you facing. Everyone in this forum always you to help, don't hesitate to post your Qse. | |
Re: @Hardz : This is good suggession to create a field for department Id. And obviously it is needful to enter in a particular department by checking User Id and Password, where all id and passwords for all departments have stored in a single table. But your codes specially between line … | |
Re: Please read the following links [Link - 1](https://msdn.microsoft.com/en-us/library/wch2c4sf.aspx) [Link - 2](http://stackoverflow.com/questions/7167414/vs-2010-reading-configuration-settings) Suppose they an help you. | |
Re: You can follow the following links [Link 1](http://stackoverflow.com/questions/2278234/change-desktop-background-using-vb-net) [Link 2](http://www.codeproject.com/Questions/306097/How-to-set-or-change-Desktop-background-in-Csharp) [Link 3](http://www.codeguru.com/vb/gen/vb_misc/gamesandfun/article.php/c14319/Customising-Your-Desktop-with-Visual-BasicNET-2005.htm#page-1) Suppose they can help you. | |
Re: You can read this great [tutorial](https://www.daniweb.com/software-development/vbnet/code/444231/printing-text-with-word-wrap). | |
Re: > Conversion from string 'FA15' to type integer is not valid Please check the feild data types of that table which are not matching with your supplied data types. | |
Re: You can use **RTB.Lines.Count()** method to get total lines number. It gives you the total count on every press of Return Key. | |
Re: > & " order by serialno" From which table you are taking that field. Please mention in SQL Statement. And also for **cashflowcode** in your SQL Statement. > = RsTrandet("Accountno") Here also mention the table name, like *TableNAme.Fieldname*. DO not understand Which condition is stored in the variable **curtm**. Finally, … | |
Good morning members. I am now in a small project on request of a friend for his school. This a WPF with VB.Net 2010 project with .accdb database. when I am trying to insert a blank data to the database only entering **Student Name** and **Roll No** and others are … | |
Re: Please, read this [tutorial](https://www.daniweb.com/software-development/vbnet/tutorials/475628/how-to-pass-data-between-two-forms-in-vb-net). It can help you.to solve your problem. | |
![]() | Re: Make sure that is the table name **customer details** contains a space. If this, rename your table name and remove the space, then write the actual table name in the place of **"customer details"**. No need to use **dbo.** before table name. Hope it can help you. ![]() |
Re: Instead of `Caminho.WriteLine(ListBox1.Items.Item(i))` use **Caminho.WriteLine(ListBox1.Items(i))** which can return you the value of the lisboxitem at the position of i. | |
Re: You can do this by passing object type argument value to the sub procedure. To do this you have to declare object type paprameters in the procedure. The codes should be Public Class ClassfrmLoad Private Sub FormLoad(btnAdd As Button , btnEdit As Button) btnAdd.Visible = True btnAdd.Enabled = True btnEdit.Visible … | |
![]() | Re: You can do it anywhere and anytime in your project, where you assume that you must need to do this. For this you can use 9 sets of data objects (dataadeptor, dataset, datatable) or if you want to use a single set every time you must have to dispose or … ![]() |
Re: It should be **Column_Name like '10%'** The **LIKE** predicate allows comparison of one string value with another string value, which is not identical. This is achieved by using wildcard characters. Two wildcard characters are available here. 1) % - allows to match any string of any length(including zero length) 2) … | |
Re: You can use **Picture1.Picture = Picture2.Picture** or **Picture1.Picture = Picture2.Image** to transfer picture from one picture control to another. The **Image** property transfers entire edited picture (if you did any editing in picture2 over the original picture) from picture2 to picture1 but the **Picture** property transfer only the original one … | |
Re: > GROUP BY tmp.percentage, tmp.product For this line you can get an error, because `percentage` column is not included in query. The Select Statement should be SELECT tmp.percentage, tmp.product, tmp.location FROM ( SELECT * FROM mysample WHERE location = 'TPJ' GROUP BY percentage, product HAVING COUNT(*) = 1 ) tmp, … | |
![]() | Re: You can use **Format()** function to attach a $ or Currency Symbol before the value. It should be like For N As Integer = 0 To LV1.Items.Count - 1 LV1.Items(N).SubItems(7).Text = String.Format("{0:C}", Val(LV1.Items(N).SubItems(7).Text)) Next Hope it can help you. ![]() |
![]() | Re: @westsiderailway : Your thinking is in right way. Make a nested loop through 1 to DataTable Rows Item Counts - 1 to capture the subitems. The loop should be For i As Integer = 0 To dt.Rows.Count - 1 LVitem.Text = dt.Rows(i).Item(0).ToString For j as Integer = 1 to dt.Rows(i).Item.Count … ![]() |
Submitted answer is now going to vanish. I tried two times simultaneously, but it does not show my answer or does not increase the replies count of the [discussion](https://www.daniweb.com/software-development/vbnet/threads/496355/passing-multiple-arguments-to-new-form) thread. | |
Re: > but If in the form there are many textbox and i want to use same code for all, What do you mean to use same code for all? Please post the codes you did in your project and describe your problems and what do you want. | |
Re: You can do it by clicking another controls except the dropdownmenu. Like this Public Class Form1 Private Sub Form1_Load(sender As System.Object, e As System.EventArgs) Handles MyBase.Load ToolStripMenuItem1.DropDown.AutoClose = False End Sub Private Sub Form1_MouseDown(sender As Object, e As System.Windows.Forms.MouseEventArgs) Handles Me.MouseDown ToolStripMenuItem1.DropDown.Close() End Sub Private Sub MenuStrip1_ItemClicked(sender As Object, e … | |
Re: Please show your codes first. Here are many exparts, who can give you correct way to solve your problems. | |
Re: Please post how far you did. Which can a way to give you proper solution for your problem. You can rau a loop through the DGV's row count and deduct the quantity value into the Button Click event. The codes should be like Private Sub Button1_Click(sender As System.Object, e As … | |
Re: You can read the followings [https://msdn.microsoft.com/en-us/library/system.web.ui.webcontrols.listcontrol.selectedvalue(v=vs.110).aspx](https://msdn.microsoft.com/en-us/library/system.web.ui.webcontrols.listcontrol.selectedvalue(v=vs.110).aspx) [https://msdn.microsoft.com/en-us/library/system.web.ui.webcontrols.dropdownlist.selectedindex(v=vs.110).aspx](https://msdn.microsoft.com/en-us/library/system.web.ui.webcontrols.dropdownlist.selectedindex(v=vs.110).aspx) [https://msdn.microsoft.com/en-us/library/system.web.ui.webcontrols.listcontrol.selecteditem(v=vs.110).aspx](https://msdn.microsoft.com/en-us/library/system.web.ui.webcontrols.listcontrol.selecteditem(v=vs.110).aspx) | |
Re: You declare the **Command** object at Form Level, so imidiate after calling **ExecuteNonQuery()** method **Clear** the parameters and dispose the command object. Or you can declare the **Command** object at Procedure level. From my opinion the codes should be Public Class frmCreate Dim con As New OleDb.OleDbConnection Dim cmd As … | |
Re: Crystal reports can give you a formated report as you desire. To make a report you can use **PrintDocument** object and **PrintPreview** Control to make your reports by codification from vb. You can [read the post](https://www.daniweb.com/software-development/vbnet/threads/485201/dataset-contents-not-displayed-on-printpreview-on-second-click#post2123707) in DaniWeb which can give you a way. | |
Re: You can use an array to save the list of all selected file names with full path and show only the file name to the listbox. Here I just creae a structure to hold the filename with full path and it can return the filename to the listbox. The structure … | |
Re: Why are not not trying to use **ListView** Control instead of **ListBox** to display your data. ListBox is not perfect for this type of display.From my point of view ListView would be more suitable for that and more flexible to display than Listbox. | |
Re: > Dim FineName As String = "names.txt" You must have to write the full path of the file **"names.txt"**. If it resides at **D:\My Folder\** then the codes is Dim FineName As String = "D:\My Folder\names.txt" unless, you would be unabled to open the file. Your codes should be Private … | |
Re: which controls you want to disable. in your sub procedure **DisableAll()** you have tried to enable each and every controls except **cmbLineNo** ComboBox. How do you get every controls are disabled. Your Procedure is too much lengthy. you can shorten it. Private Sub DisableAll() For Each c As Control In … | |
Re: you can use this [free online utility](http://www.developerfusion.com/tools/convert/csharp-to-vb/). | |
Re: Firstly no need to declare **AddNewListV()** as a Function. It has nothing to return. Just declare it as Sub Procedure and remove the 3 **Return** keywords from the end. Secondly who is the **Sender** in your Btn_Click Event ? >Dim ListV As ListView = TryCast(sender, ListView) How do the sender … | |
![]() | Re: Do not understand, why are you using same messagebox repeatedly for each weekdays. You can do it simply in 1 line. It should be Private Sub TreeView1_AfterSelect(sender As Object, e As TreeViewEventArgs) Handles TreeView1.AfterSelect MessageBox.Show("The user clicked on the Child Node " & e.Node.Text, " Which Node Selected", MessageBoxButtons.OK, MessageBoxIcon.Information) … ![]() |
Re: You can read the followings [http://www.codeproject.com/Tips/465179/Convert-a-Windows-Form-to-PDF](http://www.codeproject.com/Tips/465179/Convert-a-Windows-Form-to-PDF) [http://www.codeproject.com/Questions/463290/How-to-convert-Windows-Form-to-PDF-including-value](http://www.codeproject.com/Questions/463290/How-to-convert-Windows-Form-to-PDF-including-value) [http://www.gnostice.com/nl_article.asp?id=63&t=Use_Visual_Studio_To_Create_and_Design_PDF_Forms_AcroForms_Documents](http://www.gnostice.com/nl_article.asp?id=63&t=Use_Visual_Studio_To_Create_and_Design_PDF_Forms_AcroForms_Documents) | |
Re: Is here moderators are perticipatng in discussions as a member? I have bitter experiance. | |
Re: @Pompy: Function always returns a value, which type it may be. > Label3.Text = Lettergrade(grade) The construction of the function **Lettergrade** should be Function Lettergrade(ByVal Numgrade As Integer) As Char Select Case NumGrade Case 0 - 69 Return "F" Case 70 - 79 Return "C" Case 80 - 89 Return … | |
Re: > WHERE pID =" & cmbID.Text & ";" Does visual basic accept **";"** Semicolon delimited code lines? if **proQuantity** is numeric then you can use the Val() function to convert string to numeric type. The SQL Statement should be cmdUpdate.CommandText = "UPDATE tblProducts SET proQuantity=" & Val(txtTotalqty.Text) & " WHERE … | |
Re: From my opinion to load data to the dropdownlist **ddl1** do this job in seperate sub procedure and call it from where you desire. The sub procedure to load data is following Private sub LoadDropdownList() Dim rs As DataSet ddl1.Items.Clear() ddl1.Items.Add("") rs = db.ExecuteSelect("SELECT value, text FROM dropdownlist ", Session("CnnStr").ToString) … | |
![]() | Re: @tinstaafl: Great illustration about **structure** and also awasome tutorial for n'bees. Truely great. Thank u. @rnyamonga: Referencing and using tinstaafl's supporting, I want to show you, how could you add and remove items from listbox object. Public Class Form1 Public Structure Item Public strItemName As String Public dblPrice As Double … ![]() |
Re: > If Sales > 2500 Then How could you compair **Sales** variable without assigning any value to it. Everytime it can give you wrong result. From my opinion the comparision would be If Val(txtSales.Text) > 2500 Then Hope it can help you. | |
Re: > "UPDATE PDC_CHQ_IN_HAND set PDC_CHQ_IN_HAND.PDF='" & data & "'," _ > & "'WHERE PDC_CHQ_IN_HAND.RefNo='" & TxtRefNo.Text & "'" From my opinion the SQL Statement is in incorrect formation. How could you use a **,** Comma and a **'** SingleQuatation Charactor before **Where** Clause. And also an **&** Ampersand charactor before … | |
Re: Have you imported the SqlClint ? If not please write **Import System.Data.SqlClient** at the begining of your module. From my opinion the connection string structure should be Data Source=myServerAddress;Initial Catalog=myDataBaseName;Integrated Security=True; or you can follow [this](https://www.connectionstrings.com/sql-server-2008/). | |
Re: Please post full codes. seeing a part, it is impossible to say about your problems. |
The End.