Web Forms :: How To Get Balance Based On Three Tables
Jun 7, 2010This is Table Stucture..
[Code]....
This is Table Stucture..
[Code]....
I have two table , how to sum and show balance ...
Table 1
ClientID Amount
001 100
002 200
003 300
001 400
004 500
001 600
004 100
Table 2
ClientID Amount
001 200
002 50
003 100
001 150
004 75
001 25
I need the result set like this Here Table 1 minus Table 2.
ClientID BalanceAmount
001 725
002 150
003 200
004 525
I am using asp.net2.0 , C#. I am binding menu control with sitemap to display menus and submenues. Which also restrict access and display of menu or submenu based on user's roles. I want to know Is it Possible to show/ Hide submenu based on sql tables with existing sitemap method
View 1 RepliesI am trying to create my own profile provider based upon the tables I have made for my website, I have watched the video and read several articles on creating one, but none of them goes very indepth when you have several tables and groups to profile from. First: I have three groups
1. Employees
2. Customers
3. Applicants
PROBLEM: Video and tutorials don't show how to integrate groups into your profile. Based upon the UserId, I want to load only Table ID's into the profile. IE for a customer it would be
CustomerID from [customer_data]
LocationID from [customer_location]
ContactID from [customer_contacts]......................
I don't know how to go about this. I have web form with two dropdown lists. one named Recruiter and the other Account manager. I have two two SQL tables named Perm_Commision_Lookup & UserList. The Perm_Commision_Lookup table does not contain recruiter's email, so I decided to Inner Join it with UserList table which contain recruiter emails. The LookupValue column from the Perm_Commision_Lookup table is what's displayed to the end user and the pk_LookupID column is the one that's inserted into the database. What I want to achieve is this: When a user select let's say "John Doe" from the Recruiter dropdown list, I want to send out an email to John Doe and at the same time insert the selected value (pk_LookupID) into the database. I set the DataTextField="LookupValue" and DataValueField="pk_LookupID but how to get the User_Email is another problem. Below is my SQL select...
SELECT Perm_Commision_Lookup.pk_LookupID, Perm_Commision_Lookup.LookupValue, UserList.User_Email FROM Perm_Commision_Lookup INNER JOIN UserList ON Perm_Commision_Lookup.LookupUserName = UserList.GM_Username
I am writting a directory website that advertises fitness classes. These classes are listed by Class Type, and Geographical Area. Each Class Type can satisfy one or more of four Fitness Goals such as Loose Weight etc...
I have a table for Classes (classid, classname, classdesc, classtypeid, geoareaid) I have a table for geographic areas (geoareaid, geoarea) And I have a table for ClassTypes (classtypeid, classtypename, classtypedesc)
Which obviously links geographic area via the classes.geoareaid as a forgien key and classtypes by classes.classtypeid as a forgien key.
I can list all classes by type and also by geo area no problem, the problem arrises when I then also want to filter by goal.
The Goals Table (goalid, goal, goaldesc) is linked to the classtypes table via another table classtypes_goals (classtypeid, goalid) as each classtype can satisfy any of the 4 goals.
I am using a DataSet to fetch the data from a Stored Procedure in the SQL Database but because the classtypes can be linked to multiple goals I am getting duplication in my list depending on how many goals a classtype satisfies.
All I need in my data list is class name, class type and area I don't even need to display the goal I just want a drop down above the table that will filter the list and show only classes of classtype that satisfy the goal chosen.
Environment: C#, ASP.NET 4.0, SQL Server 2008.
Here's the scenario: Buyers and Sellers (where all of the sellers have a unique D&B number).
I'm catering to the buyers, and I want them to be able to import a list of sellers based on the D&B number.
Here are the tables:
BuyersSellers - unique list of sellers - one record, no matter how many buyers work with them.BuyerSellers - lookup table - buyer_id, seller_id sets which buyers work with which sellers
ImportedSellers - temp table that holds sellers the buyer wants to add.AllSellers - master table that has all known sellers with D&B numbers (remote database).
Here's the process:
Buyer uploads list of new sellers, they get added to ImportSellers tableMatch ImportedSellers against AllSellers (valid), ignore unmatched (invalid).Add valid ImportedSellers to the Sellers table if they don't exist.Create BuyerSeller records for all valid ImportedSellers - using data from AllSellers.Delete all valid ImportedSellers, leave the unmatched behind so they know what they need to fix.
I've got the upload and import working, but now I'm a little stuck on how to do all of the matching and inserting, and do it as quickly as possible.
How To Compare Two Tables Qty Based On Purchase and Sales?
View 3 RepliesIm using asp.net 2.0 with Visual studio 2005... My requirement is i want to show my balance sheet from MS SQL 2005 database to graphical Chart... so Would u guyz will let me know the best high qulaity chat which support asp.net 2.0 with Visual studio 2005..
View 3 RepliesOne of my peer wrote a query based on multiple tables using joins. One of the table is in a different database The query was taking much time
1. Create an SP
2. Create a temp table and copy all records from the external db
3. Avoid using Left Join as much as possible and use Inner Join
4. Create and use indexes
5. Remove tables/columns that are not necessary
In this scenario, I would like to suggest to use Covering Index, but how can it be created for multiple tables and a temp table?
I have a insert into statement thats inserting my numbers from a numeric text box on my aspx page. I am choosing the Amount Type then putting in a a number.
So i have a drop down that i select example Direct Charge then i enter 600.00 and click add it puts that in to the databse for me woot..
I then put in say Misc Credit and enter 200.00 it inserts in that into the database woot.
The look up table that has my amount types has a field called numeric opperator which is either + or - the Credit being a - and the Charge being a + then my stored procedure takes all my + numbers and adds them up and subtracts all the - numbers.
I want to change that so that it actuall be inserted into the table as a - number form the start. So I want choose Misc Credit enter 200.00 and click add then my event says o yea thats a credit insert 200.00 as -200.00
How can I do that?
[code]...
I have a web page that allows user to make transaction and they are allowed to choose if they want their transaction to be immediately transferred to the payee or for future transfer. I have problem handling future transfer, for an example, I want to transfer $100 to A on 12 August but today is only 09 August. So the amount should be deducted . I decided to make 2 balances; Available and Ledger balances. Available balance is the net balance after doing all the future transfers etc. but for ledger balance is what is available at the point of time. I'm thinking how should I form the query for the SQL statement. Currently, this is what I have. Transfer code = 2 -> future transfer
IF (@TransferCode = '2')
BEGIN
--Insert into the account transaction table first--
INSERT INTO ACCOUNTTRANSACTIONS (AccountTransID, CustID, TransDate, TransType, Reference)
VALUES (@AccTransID,@CustID,@Date,@TransType,@Reference)
IF NOT (@Date = Getdate())
IF (@Withdraw > @BankBal)
BEGIN
INSERT INTO ACCOUNTTRANSITEM (AccountTransItemID, AccountTransID, AccNum, Withdraw, Deposit, status)
VALUES (@AccTransItemID, @AccTransID, @AccNum,@Withdraw,@Deposit, 0)
PRINT 'INSUFFICIENT AMOUNT IN BANK'
SET @ReturnValue = 4
RETURN @ReturnValue
END
ELSE
BEGIN
INSERT INTO ACCOUNTTRANSITEM (AccountTransItemID, AccountTransID, AccNum, Withdraw, Deposit, status)
VALUES (@AccTransItemID, @AccTransID, @AccNum,@Withdraw,@Deposit, 1)
END
ELSE IF (@Date = GETDATE())
BEGIN
IF (@Withdraw > @BankBal)
BEGIN
INSERT INTO ACCOUNTTRANSITEM (AccountTransItemID, AccountTransID, AccNum, Withdraw, Deposit, status)
VALUES (@AccTransItemID, @AccTransID, @AccNum,@Withdraw,@Deposit, 0)
PRINT 'INSUFFICIENT AMOUNT IN BANK'
SET @ReturnValue = 4
RETURN @ReturnValue
END
I have just created an extra table named AccountDetails with four columns named AccNo,Balance,Transfer and UserId as foreign key to aspnet_userID primary key. I want to display users account and balance whenever the user successfully loged in.
View 4 RepliesI want to display opening balance in page header of the report.
ex :
opening balance :
aaaaa bb 340 2000.00
item brand qty amt
aaaaa bb 34 340
aaaaa bb 34 340
How do you currently find the balance between javascript and code behind. I have recently come across some extremely bad (in my eyes) legacy code that lends itself to chaos (someHugeJavafile.js) which contains a lot of the logic used in many of the pages.
Let's say for example that you have a Form that you need to complete.
1. Personal Details
2. Address Information
3. Little bit more about yourself
You don't want to overload the person with all the fields at once, so you decide to split it up into steps.
Do you create separate pages for Personal Details, Address Information and a Little bit more about yourself.
Do you create controls for each and hide and show them on a postback or using some update panel?
Do you use jQuery and do some checking to ensure that the person has completed the required fields for the step and show the new "section" by using .show()?
We are currently running an asp.net application with 3.5 framework, using a SQL 2008 back-end. We have found that when we go from http to https we lose our session. Basically you come in on Server01 in http, add an item to your cart go to the secure checkout page (https) and you are now on Serve
View 2 RepliesI'm seeking an algorithm to split a list of items of varying sizes into "N" number of similarly-sized groups.
Specifically, I'm working on an ASP.NET site in C# where I have a (database-retrieved) list of strings. The strings are of varying lengths. I have a set of columns which need to display the strings. I need an algorithm that will find the most balanced sets (item order is irrelevant) to allow the final columns to be as balanced as possible.
Abstracted Example:
Creating 3 columns.
Items to distribute:
- Item A - height 5
- Item B - height 3
- Item C - height 7
- Item D - height 2
- Item E - height 3
Desired output:
Column 1: Item A, Item D
Column 2: Item C
Column 3: Item B, Item E
I have two tables Emp,Dept
EMP DEPT
EmpNo(PKEY) Id(FKEY) to Empno
Fname Location
Lname Date
Mname
I want to display Gridview columns like this ....
E.Fname,E.Lname,D.date based on Id
(or)
Display E.Fname,E.Lnamebased ob Id
I have 3 tables in Oracle database. From my asp.net C# page, I am inserting records into all three tables as shown below:
[code].....
My question is, how do I make sure that either all the above are executed or none is executed in C#.
If the first 2nd or 3rd insert fails, everything should fail.
I have an C# ASP application I am writing that needs to have the capability to import a generated excel or a comma delineated sheet each day. A clerk will have this job each morning so it doesn't need to be automated. My problem in trying to understand the solution to this is that the 1 sheet contains loan information, including customer information all in the same sheet. I would like to send certain columns to update information in the loan table and send other information to update the customer table. I need it to create relationships when new loans appear in the spreadsheet.
View 1 RepliesI am using bulk insert concept to export the data from dat file to tables(Two tables). I am using the temporary table for to do the calculation and insertion to two tables. My problem is whenever I selecting the temp table data after the execution of bulk insertion , the order is changing .I need to get the order as it is in file order(csv,dat,txt).
View 5 RepliesI'm trying to convert a windows based application to a web based using vb.net.
I am having a problem with the following:
System.Windows.Forms.WebBrowser
is there any similar web calling to this?
I'm doing this:
Dim htmlbox As System.Windows.Forms.WebBrowser
But obviously im unable to do this since it's a windows.. I need to find something similar for web.
I make use of SMO namaspace to get Table, Function, Procedure names from the DB.
Now I've intended to get the tables [Column] name and the relation (dependency) among the tables. Is this possible?
I need to develop in ASP.NET or in SilverLight a web-based editor and a web-based player for PowerPoint presentation. Are there any components I can use to do this?
View 2 RepliesI have a simple intranet site. It has a role based authorization in the web.config file.
Any user's in a specific role called as "Apr-Sales-Writers" will be authorized to use those pages. If not, they will not be authorized. So far so good. Works fine. But we added additional functionality where a new active directory group (means new role) has to be added and user's belonging to this new AD group should be given access to only specific .aspx pages on the intranet site. I am using a web.sitemap and it looks like this.
If the user's belong to say AD group "Apr-Sales-Writers", they should access only default.aspx and salesData.aspx pages. User's belonging to new AD group (which I did not include in the web.config file below), should have access to other .aspx pages.
[CODE]<?xml version="1.0" encoding="utf-8" ?>
<siteMap xmlns="http://schemas.microsoft.com/AspNet/SiteMap-File-1.0" >
<siteMapNode url="default.aspx" title="Home" description="Home">
<siteMapNode title="sales Data" description="sales Data">
<siteMapNode url="salesData.aspx" title="sales Data" description="sales Data" />
[Code] ....