Hi guys , I have a tables called “scores” With the following Fields AdmNo,Name, Maths,English,Biology ,Avg Am loading this data to my datagridview using select “Select * from scores order by Avg Desc” Which works fine my question is how do i get the rank of every student from the datagridview in the form of Adm Name Maths Eng Biology Avg. rank 1. Peter. 80. 60. 70. 75. 1 2. Alex. 20. 20. 20. 20. 2 Etc How do I rank?

Member Avatar
+0 forum 0

<Grid> <Grid.RowDefinations> <RowDefinations></RowDefinations> <RowDefinations></RowDefinations> <RowDefinations></RowDefinations> <RowDefinations></RowDefinations> </Grid.RowDefinations> <Grid.ColumnDefinations> <ColumnDefinations></ColumdDefinations> <ColumnDefinations></ColumdDefinations> <ColumnDefinations></ColumdDefinations> <ColumnDefinations></ColumdDefinations> <Grid.ColumnDefinations> <Grid> </Grid> </Grid>

Member Avatar
Member Avatar
+0 forum 1

hello, I am trying to write a vb.net programme that reads data from a file and do a count for each column as shown in the format below and also write to an output file. i am able to do the count but i am unable to write the output base on the resturants & days. From what i have, i can only write the total sum from the array index. Here is the format of the file for better understanding and what i have done so far. Note; treat me as a newbie **File Format** is 001,1,5,6,21 001,1,5,6,21 001,1,5,6,21 …

Member Avatar
Member Avatar
+0 forum 1

Hi Im having an error with my app, Im still learning to code. It gives me error at line rs = cmdOLEDB.ExecuteReader Here's my full code Imports System.Data Imports System.Data.OleDb Imports System.IO Public Class Form11 Dim cnnOLEDB As New OleDbConnection Dim cmdOLEDB As New OleDbCommand Dim cmdInsert As New OleDbCommand Dim cmdUpdate As New OleDbCommand Dim cmdDelete As New OleDbCommand Dim strConnectionString = "Provider=Microsoft.ACE.OLEDB.12.0;Data Source=" & _ System.Environment.CurrentDirectory & "\Akademik.accdb" Public ADP As OleDbDataAdapter Public DS As New DataSet Private Sub Label1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Label1.Click End Sub Private Sub Form11_Load(ByVal sender As System.Object, ByVal …

Member Avatar
Member Avatar
+0 forum 1

Magento : Using app/design/frontend/default/theme/template/catalog/product/view.phtml how to display my text message on my selected products, workout : <?php $productId = '42150'; $product = Mage::getModel('catalog/product')->load($productId); if( $productId == '42150' ) { echo "Test"; } ?> if i wrong pls correct me.

Member Avatar
+0 forum 0

Hi All, I have 7 tables in my access database. i wrote a code to select the data table using the combobox and to display the selected table in the datagridview. Now i need to add,edit or update, delete the data into the selected tables. In which the text boxes are common to the all the tables, for ex: if i select the table "Capacitor" in the combobox, whatever the data i entered into the textboxes will go to the "capacitor" tables, likewise other tables. Please anyone help me to resolve this code, i am struck in it for long …

Member Avatar
+0 forum 0

Hi group, I'm attempting to populate a listview with data from my test database created via Visual Studio 2019. I'm getting a syntax error that says, "Incorrect syntax near the keyword 'FROM'." It's not clear to me what the error is. The code I've written is as follows: Dim strQ As String = String.Empty Dim datasource As String = "Data Source=(LocalDB)\MSSQLLocalDB;AttachDbFilename=C:\Users\Don\Documents\Visual Studio 2019\SalesForm\DWHRPT.mdf;Integrated Security=True" conn = New SqlConnection(datasource) Dim searchID As String = tbxCompanyName.Text strQ = "SEARCH CUST_ACCT_NO, CUST_COMPANY_NAME, CUST_FIRST_NAME, CUST_MIDDLE_INITIAL, CUST_LAST_NAME FROM CUSTREC WHERE CUST_COMPANY_NAME LIKE '" & searchID & "%'" cmd = New SqlCommand(strQ, conn) da = New …

Member Avatar
Member Avatar
+1 forum 5

Hi group, I'm trying to store the information from a various textboxes into my database. However it is not writing the data (I'm getting my planned error message, "New Record FAILED. Please contact your systems administrator." From the code below, do you see where my error may be? What corrections do I need to make to ensure a successful insert? Dim con As New SqlClient.SqlConnection con.ConnectionString = ("Data Source=(LocalDB)\MSSQLLocalDB;AttachDbFilename=C:\Users\Don\Documents\Visual Studio 2019\SalesForm\DWHRPT.mdf;Integrated Security=True") con.Open() Dim com As New SqlClient.SqlCommand("", con) com.CommandText = "INSERT INTO CUSTREC (CUST_ACCT_NO, CUST_COMPANY_NAME, CUST_LOCATION, CUST_TYPE, CUST_FIRST_NAME, CUST_MIDDLE_INITIAL, CUST_LAST_NAME, CUST_MAIL_ADDRESS1, CUST_MAIL_ADDRESS2, CUST_MAIL_CITY, CUST_MAIL_STATE, CUST_MAIL_ZIP_CODE, CUST_MAIL_ZIP_PLUS4, CUST_CREDIT_LIMIT, CUST_PRIMARY_PHONE, CUST_ALT_PHONE, …

Member Avatar
Member Avatar
+0 forum 4

I'm creating a program that maintains student scores. I've created a class called students that stores the data and displays it in a list box. Once the user clicks btnAdd a new form (frmAddStudent) loads that allows them to add the user by name and their scores and display it in the listbox in the main form. It also allows the update/delete functions. I can succesfully add students to the list and edit them, but when I press the ok button in the update students form I get the error, "System.ArgumentOutOfRangeException: 'Index was out of range. Must be non-negative and …

Member Avatar
+0 forum 0

Hi group, I'm attempting to write code to check to see if an existing account number exists. The user is to input a 10 digit account number. The code then is to query the database to see if that number exists. If it does, the message box displays the message that the number exists. However the code I've written isn't working as I wish. Can you offer some suggestions as to how to do this correctly? Here's what I've attempted: Private Sub tbxAccountNo_TextChanged(sender As Object, e As EventArgs) Handles tbxAccountNo.TextChanged If GlobalVariables.custpnl1 = 2 And tbxAccountNo.Text.Length = 10 And IsNumeric(tbxAccountNo.Text) …

Member Avatar
Member Avatar
+0 forum 2

Dear friends, I have a number of buttons ( New, Search, Update) on my Parent form (IsMdiContainer set to true) which work very well but once I load and unload a child form (from ToolsstripMenuItem), the buttons do NOT work anymore (i.e., one just clicks onthe buttons and nothing happens). Grateful if you can help me with this VB.NET issue. Thanks a lot

Member Avatar
Member Avatar
+0 forum 1

Group, I've written some code to populate a listview using 3 fields from a database. When creating the listview, I named the individual columns for appearance purposes, (Account No, Company Name and Name). Those columns are being populated appropriately as expected. However data column names are being shown in column 4 5 and 6, but with no data. What in my code is causing this? Any suggestions on how to fix this? My code is as follows: Private Sub tbxCompanyName_Leave(sender As Object, e As EventArgs) Handles tbxCompanyName.Leave lvwSearchCustomer.Visible = True Me.lvwSearchCustomer.View = View.Details Me.lvwSearchCustomer.GridLines = True Dim strQ As String …

Member Avatar
Member Avatar
+0 forum 2

Hi group, I've just installed Visual Studio 2019 and have started my first app using this. Within the program I created a database using the tools provided in Visual Studio. I now want to begin writing to the tables I've created. But I'm stumped on how to do this. Hopefully you can help. This database is installed on my laptop and is called DATAWHOUSE. Will I need some kind of connection string to write to the data table (and to read from it and/or make changes to it in the future)?

Member Avatar
Member Avatar
+0 forum 2

I have looked on the web for a solution to print scrollable panel larger than can be fitted on the screen but couldn't find any solution and it looks like that many people has this problem! PrintForm (printform powerpack component) can not do this because it only capture that part of the panel that is fitted on the screen. And if you want to do this with the PrintDocument component and print all the visible parts of the form grids,tablelayoutpanels etc and to formate it correctly then you can become really frustrated! Here is my solution to print scrollable panels …

Member Avatar
Member Avatar
+0 forum 4

Hi this is my first time using this site, so please bare with me. I'm also pretty new at coding and got thrown into connecting to a database in one of my classes. But anywho, I keep receiving a syntax error and I was wondering if anyone could help me figure out why. Thank you! Imports System.Data Imports System.Data.SqlClient Public Class PatientForm1 Dim con As New SqlClient.SqlConnection("deleted for privacy") Private Sub TextBox1_TextChanged(sender As Object, e As EventArgs) Handles lname.TextChanged End Sub Private Sub Form1_Load(sender As Object, e As EventArgs) Handles MyBase.Load End Sub Private Sub Label14_Click(sender As Object, e As …

Member Avatar
Member Avatar
+0 forum 2

I want when click on the Name Listed on a Listbox from the database to fill Textboxes with Username and Password of particular user from SQL database. I am able to see Names stored on the database on the listbox but when i click on the name its unable to fill the Textboxes. Here is the code that fills the Listbox with data from database (NOTE: I am able to view a list of names on the Listbox with the code below) Public Sub ListBox() Try If con.State = ConnectionState.Open Then con.Close() End If con.Open() Dim cmd As SqlCommand cmd …

Member Avatar
Member Avatar
+0 forum 4

first of all: I plugged USB modem to my Computer and I want to communicate that usb modem using C# Code as follows:- first connect to USB then access its services like internet and checking balance using Code. if any Idea please give me ENGs

Member Avatar
Member Avatar
+0 forum 5

Hi There! I'm working with application for adding contacts using Visual Basic 2012. The application have textboxes to add data, control buttons and ListView to display contents in columns. I want to save the information in listView box where a user click save button and savedialogbox open in order to choose file path. I'm unable to get it right with the code I wrote and it's as follows: Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click Dim iSave As New SaveFileDialog iSave.Filter = "txt Files (*.txt) |*.txt" iSave.FilterIndex = 2 iSave.RestoreDirectory = False If iSave.ShowDialog() = Windows.Forms.DialogResult.OK Then …

Member Avatar
Member Avatar
+0 forum 1

dear all i have a invoice table now in that datagrid table i have 4 columns itemcode itemdescription qty price now what i need is user come to itemcode and whenever he type itemcode, he should get a list of initial alphabetic itemnames like if i type A so itemcode must show all items codes related to A and when i get my required itemcode, after pressing enter it should fill the related field (item description,qty,price) please guide with codes thanks

Member Avatar
Member Avatar
+0 forum 7

Hello, I have question guys. basically, i have 2 forms which is login form and main form. On login form i have database consist of username,password,fullname, and contact. I have toolstripstatuslabel on my main form. the question is, how can i view the fullname on toolstripstatuslabel from the information i use to log on from login form after logging successfully. thanks in advance

Member Avatar
+0 forum 0

Hi everyone! I'm making an application which requires users with different permissions/previleges to login and use the application.For example, if the user is "admin", all menu items in the menu bar are shown and enabled. If the user is say "user_group1", some of the menu items are to be hidden. The same for "user_group2", "user_group3", "user_group4" and so on. I could put a code for each specific user in each form but that's a great deal since users and their user groups may be added after application deployment. So it has to be something flexible. I want the user "Administrator" …

Member Avatar
Member Avatar
+0 forum 24

I have the following code to connect to wi-fi, which works fine. Dim p = "netsh.exe" Dim wi-fi-name as string = "My-Wi-Fi-Connection" Dim sInfo As New ProcessStartInfo(p, "wlan connect " & wi-fi-name) sInfo.CreateNoWindow = True sInfo.WindowStyle = ProcessWindowStyle.Hidden Process.Start(sInfo) For i As Integer = 0 To 100 Application.DoEvents() System.Threading.Thread.Sleep(10) Next I want to be able to turn it off, changing connect to disconnect does not work. Any suggestions much appreciated

Member Avatar
Member Avatar
+0 forum 1

Hi guys, i'm having a difficulty to set the path in vb.net.i put the code in the module and every time i run the code it throws error "Could not find file 'C:\Users\Abdueie\Desktop\BMS\Bridge Asset Management\Bridge Asset Management\bin\Debug\Adigrat.accdb'." here's the code Public conn As OleDbConnection = New OleDbConnection("Provider=Microsoft.ACE.OLEDB.12.0; Data Source= .\\Adigrat.accdb;Persist Security Info=False")

Member Avatar
Member Avatar
+2 forum 12

Hello, Can someone help me adding two text box. example: textbox1 = (1) textbox2 =(50) textboxsum = (51) i have already values on textbox1 and textbox2, I want the two values of textbox automatically computed on textboxsum. Note: textchange event works but i need to manually input the values on textbox in order to get the sum. thanks in advance

Member Avatar
Member Avatar
+0 forum 6

hi members i am new in vb.net so i faced some problem resolving problems with datagridview i managed to resolve a lot in this days i have faced a problem with no solution if anyone can help me my problem is to add a new columns in datatgridview with data from database the datagridview if filled from text with 4 columns (command,article,Qte,PU) i want to add a new columns (designation) will be (command,article,Qte,PU,"designation") how i can do that please

Member Avatar
+0 forum 0

** Cannot open MSSQLSSQLEXPRESS service on computer'.'. ** **What I have tried:** Dim myController As New System.ServiceProcess.ServiceController("SQL Server (SQLEXPRESS)") ------------------------------------------------------------------------------------------------------------ Private Sub Service_status() If myController.Status = ServiceProcess.ServiceControllerStatus.Running Then TextBox1.Text = "Started" ElseIf myController.Status = ServiceProcess.ServiceControllerStatus.Stopped Then TextBox1.Text = "Stopped" End If End Sub ------------------------------------------------------------------------------------------------------------ Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click Service_status() End Sub ------------------------------------------------------------------------------------------------------------ Private Sub BtnStop_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles BtnStop.Click ProgressBar1.Value = 0 Try myController.Stop() Catch ex As Exception MsgBox(ex.Message) Finally ProgressBar1.Value = 100 myController.WaitForStatus(ServiceProcess.ServiceControllerStatus.Stopped) '//Add Service_status() End Try End Sub ------------------------------------------------------------------------------------------------------------ Private Sub BtnStart_Click(ByVal sender As System.Object, …

Member Avatar
+0 forum 0

Hi, How can i make query for this: Table1 Column1 Column2 LS11111 0 LS22222 100 LS33333 10 LS44444 0 LS55555 25 Table2 Column1 Column3 LS11111 100 LS22222 80 LS33333 25 Result i need is Column1 Column2 LS11111 100 LS22222 100 LS33333 25 LS44444 0 LS55555 25 Column1 is same on both tables, Column2 is pieces number in table1, and column3 is pieces number in Table2 I need maximum piece numbers. If table2 doesnt exist column1 value then shows table1 column2, and if it exist and is larger than table1 column2 then shows number from table2

Member Avatar
Member Avatar
+0 forum 4

Hello I am getting 3 errors (same errors for all 3 lines) in my Visual Studio 2017 Web Forms project: Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load pnlFormFields.Visible = False pnlThankYouMessage.Visible = True LblDate.Text = ReturnDate() End Sub pnlFormFields, pnlThankYouMessage, and LblDate, are not declared. In my aspx file, I have: <body> <asp:Label ID = "LblDate" runat="server" CssClass="dateStyle" Text="Label"></asp:Label> <asp:Panel ID="pnlFormFields" runat="server"> <form id="form1" runat="server" method="post"> and <asp:Panel ID="pnlThankYouMessage" runat="server" CssClass="panel" Visible="False"> Thank you. Your message has been sent. </asp:Panel> What am I coding wrongly, please? Thank you.

Member Avatar
Member Avatar
+0 forum 4

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

The End.