Hi.. I am Using This Code For Join Table.. - con.Open()
-
Dim strSQL5 As String = "SELECT Fees_Transaction.Regno, Fees_Transaction.ST_Name, SUM(Fees_Transaction.Amount_Paid) as FTAmountPaid, SUM(FeesMaster.FeeAmount) As TotalFeeAmount FROM Fees_Transaction" & _
-
" INNER JOIN FeesMaster ON Fees_Transaction.Regno=FeesMaster.Regno WHERE Fees_Transaction.class='" & cboClass.Text & "' AND Fees_Transaction.FeeType=FeesMaster.FeeType " & _
-
"GROUP BY Fees_Transaction.Regno, Fees_Transaction.ST_Name"
-
-
-
Dim DaAp5 As New SqlDataAdapter(strSQL5, con)
-
Dim DSet5 As New DataTable
-
DaAp5.Fill(DSet5)
-
'========================================
-
With Me.DGV1
-
.Columns.Add("Regno", "RegNo")
-
.Columns.Add("ST_Name", "Student Name")
-
.Columns.Add("Amount_Paid", "Amount Paid")
-
.Columns.Add("Remaining", "Remaining")
-
.Columns.Add("TotalAmt", "Total Amount")
-
.Columns.Add("FeeType", "Fee Type")
-
.Columns.Add("Class", "Class")
-
.Columns.Add("Section", "Section")
-
.Columns(0).Width = 85
-
.Columns(1).Width = 250
-
.Columns(2).Width = 150
-
.Columns(3).Width = 150
-
.Columns(4).Width = 140
-
.Columns(5).Width = 150
-
.Columns(6).Width = 90
-
.Columns(7).Width = 90
-
' .AllowUserToAddRows = False
-
.EditMode = DataGridViewEditMode.EditProgrammatically
-
.ColumnHeadersDefaultCellStyle.Alignment = DataGridViewContentAlignment.TopCenter
-
End With
-
-
For Each dr As DataRow In DSet5.Rows
-
Me.DGV1.Rows.Add()
-
With Me.DGV1.Rows(Me.DGV1.Rows.Count - 1)
-
.Cells("Regno").Value = dr("Regno")
-
.Cells("ST_Name").Value = dr("ST_Name")
-
.Cells("Amount_Paid").Value = dr("FTAmountPaid")
-
.Cells("TotalAmt").Value = dr("TotalFeeAmount")
-
' .Cells("FeeType").Value = "Total"
-
' .Cells("Class").Value = dr("Class")
-
' .Cells("Section").Value = dr("Section")
-
End With
-
Next
-
-
con.Close()
But This Code is Woking.. Wht is my Problem.. I Use SUM both Table. Fees_Transcatio n SUM Function working For Two condition (regno and Feetype) and FeesMaster I Want Sum FeeAmount For Regno and Class wise but it's not sum that condition.. Please wht prb i did ..
1 4330 Rabbit 12,516
Recognized Expert Moderator MVP
Do you mean the code is not working? I have no idea what you are trying to say. Your english is unclear. Try posting sample data and results and reword what you're trying to do.
Sign in to post your reply or Sign up for a free account.
Similar topics |
by: Keith Simeon |
last post by:
Hello all,
I've recently started playing with Hibernate, and have a question
regarding many-to-many relationships using a join or cross table (I've
also heard these referred to as a transition tables).
Given the following table structures :
|------| |-------| |------|
|a | | a_b | | b |
|
by: bodleyhenley |
last post by:
Please help me with this! :)
I have a database of servers, one of the things I am recording
information about is what software is on each server. Obviously this
is a many to many so I have a join table which has a primary key of
soft2servID and also has the server id and the software title id kinda
like this ...
---->ServerID
SoftwareTitleID<-------Softwaretable
|
by: davegb |
last post by:
I'm trying to create a self-join table to show the relationship between
employee and supervisor. In another thread, I was advised to create a
SupervisorID in the employee table, a separate Supervisor table, and
join the Supervisor table to the Employee table and a copy of the
Supervisor table to create the self-join. I can't figure out how to do
this from reading Viescas or from researching it here. I can start a
query and create 2 copies...
|
by: LL |
last post by:
Hi,
My sql join two table, how to call the fill method? thanks.
string sqlStr = "select * from table1, table2";
SqlDataAdapter myCommand = new SqlDataAdapter(sqlStr, myConnection);DataSet
ds = new DataSet();
myCommand.Fill(ds, ?);
|
by: CanFlightSim |
last post by:
I am not very strong in databases, so you must forgive any obvious
stupidity.
After having a good look at our Sales Managemend database, we decided
there is something basially wrong.
Our Agents sell financials to only a few customers. The database was
set up as...
Table Table (Join)
Table
Agent (AgentID ) (AgentID)( >Customer(CustomerID)
| |
by: ssims |
last post by:
I've been thinking about this problem for awhile, and can't seem to
come up with a valid answer. I've got two tables, Surveys and
Instructors. When a survey is completed there are one or two
instructors associated with it (no surveys with zero, and no surveys
with more than two). I'd like to take the data from both tables and
join them to display the results. Right now I accomplish displaying
all surveys with two instructors with the...
|
by: koehlerc14 |
last post by:
I'm trying to create a form that imports a text file and join zip code fields to our "Master" database x2. I import the txt file and name it based on a "strTableName" which includes the date, a title, and information I put in a textbox on the form. Up to this point it works well, but beyond that I cannot JOIN the fields as I don't know what to put in the table name.
A second thing that I would like to do is add criteria to the queries if...
|
by: RP |
last post by:
I am using I want to transfer certain columns from my DataGridView (or
table) to a text file. Though it is easy to read a row and write into
a file, but I want that each column written is equally tabbed (spaced)
with other columns. Even the values passed must properly align with
the top values.
|
by: BD |
last post by:
Hi, all.
I need to enforce a one-to-many relationship on 2 tables, with a join
table.
Say the join table contains account information. It has cust_no and
acct_no. Both cust_no and acct_no are child FKs to other tables (no
nulls will exist in these columns).
Logically, one customer can have several accounts, but one account can
|
by: Todd Nichols |
last post by:
I have the main form for the "one" side of the relationship and a subform for the "many" side, linked by the primary key of the main table to the foreign key of the join table (the many-side table). But at the initial start, the form shows no entries in the subform because none have been created yet. How do I create the situation where the user can select from a list and make the proper entries into the join table in the subform? Otherwise,...
|
by: marktang |
last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look !
Part I. Meaning of...
| |
by: jinu1996 |
last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth.
The Art of Business Website Design
Your website is...
|
by: Hystou |
last post by:
Overview:
Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
|
by: tracyyun |
last post by:
Dear forum friends,
With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
|
by: agi2029 |
last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own....
Now, this would greatly impact the work of software developers. The idea...
|
by: isladogs |
last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM).
In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules.
He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms.
Adolph will...
|
by: conductexam |
last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one.
At the time of converting from word file to html my equations which are in the word document file was convert into image.
Globals.ThisAddIn.Application.ActiveDocument.Select();...
| |
by: TSSRALBI |
last post by:
Hello
I'm a network technician in training and I need your help.
I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs.
The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols.
I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
|
by: bsmnconsultancy |
last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...
| |