VS 2008 Select Users And Count Orders?
Aug 21, 2010
I've tried to write a code which will count the orders for each person in my users table. This is what I have but it's not working. What is wrong?
vb.net
Dim command As New SqlClient.SqlCommand("SELECT *, COUNT(Orders.Username) FROM Users LEFT OUTER JOIN Orders ON Users.Username = Orders.IssuedBy ORDER BY Users.PersonName")
View 3 Replies
ADVERTISEMENT
Sep 12, 2011
I have the following code for Customers and their orders. I want to list all the customerID and the corresponding count of orders. How do I achieve it using LINQ? [code]
View 3 Replies
Mar 9, 2009
I have a scenario at hand which has some design discussion going on. To break it down in simple words, think about a hierarchy as such Company -----> Customer ------> Orders (ignore the details of how the orders have products etc) if I was to expose an API to work with this, what would be a better design.
a)
Dim comp As New Company
comp.GetInfo(123)
Dim cust As New Customer
cust.Name= "CustomerName"
comp.Add( cust)
b)
Dim custhand As Customerhandler
Dim cust As New Customer
cust.Name= "CustomerName"
custhand.AddCustomer(cust,123) ''123 is CompanyID
View 5 Replies
Feb 29, 2012
I am working on an invoicing program that based on the Northwind database.I am pulling information from a 'view' for the orders form.How do i program the customer ID field to populate with the corresponding invoiceID (already done through the view) AND when i drop down the customerID box to list all possible customers from the customers table.I have the SQL for the operation I believe the problem is that the field is bound to the orders Orders Qry 'View'.How can i accomplish both of these tasks within the same dropdown?
View 1 Replies
Oct 4, 2011
I have the following problem: I select a customer from a dropdownlist and then the gridview should load all items of all orders of that customer. I have the following query:
Dim allorders = From ord In db.Orders
Where ord.CustomerID = Convert.ToInt32(CustomerDropDownList.SelectedValue)
[CODE]..............
I also tried to modify the query as follows:
Dim orderitems = From oi In db.OrderItems
Where oi.OrderNumber = (From From ord In db.Orders
[CODE]...........
But this does not work. I just started using LINQ.
View 5 Replies
Jan 7, 2011
count the number of users used an application?
View 2 Replies
Apr 23, 2010
how to call this Active Directory dialogue in .net?
View 9 Replies
Dec 29, 2010
I've got a code using SQLClient that loops though all users in a Users table inside each loop i want to preform another search in the UserOrders table, thus doing a count of all orders.
I get this error
HTML
There is already an open DataReader associated with this Command which must be closed first.
Here is my code
vb.net UserLists.Items.Clear()
Dim connection As New SqlClient.SqlConnection(My.Settings.ConnectString)
Dim command As New SqlClient.SqlCommand("SELECT * FROM Users ORDER BY PersonName",
[CODE]...
View 3 Replies
May 6, 2009
Look at the code. all i need to do is take all notes from orders table.
The connection is openned
Private Sub Load_History()
Dim myCnt As Integer
Dim myStr As String
Dim totalrows As Integer
Dim myDataset As New DataSet
[CODE]...
View 3 Replies
Jun 21, 2010
Is there a way to customformat DateTimePicker to only allow users to select M-F?
View 3 Replies
Jun 3, 2010
I am using a treeview to display projects, tasks, time entries, and the people who are working on a project. I would like to allow the user to define a custom grouping (ie. Project->Task->Time Entries or Project->Date (of time entry)->Task->TimeEntry).The relevant groups would be Project, Task, Time Entry, and Person, with some metadata from them. I want to have some modular way to allow a user to specify how they would like to display the information. Does anyone know of a good method by which this can be done? I currently have hard-coded a display which looks like this:
Project
Task
Time Entry
[code]....
View 1 Replies
Jul 16, 2010
I'm trying to get a simple count of rows meeting some criteria. The value returned does not coincide with the correct number of rows when running the same query in Management Studio (SQL 2005)
vb.net
Public Function RowsAffectedCount() As Integer
Dim result As Integer = 0
[code]....
'result' always returns 1, but I have 3 records meeting that criteria in the database. Been staring at the code for a couple hours now and can't figure it out... I just need to know if the Count of rows returned from a SELECT statement is greater than 1 (at least two records).
View 9 Replies
Apr 28, 2011
I am trying to build a nice-looking menu that allows users to select certain items. When they hover over the items, a nice highlight color fades in and then out when they leave the item. Anyways, it looks very nice, but I don't want to have to use a "page" style. (e.g., page 1 contains 6 items, click "Next" to go to the next page of 6 itesm) I'd like to allow the user to scroll through the items. I'll develop my own GUI for the scrollbar, however I have absolutely no idea where to start on actually fitting all of the items into like a 400x200 box, and allowing the user to scroll up and down through the items. The items are actual controls (e.g. each item contains a picturebox, a couple of labels, a couple of buttons collectively).
View 3 Replies
Sep 17, 2009
I am trying to make a form that can be used to allow users select file(s) from one control and drag them to another. I am stuck. I have done a bunch of research and now have a form that allows the user to select a directory and display the files in a listbox. It works intermittently. The select directory window works when I click the Browse button and it reports that it found a number of files. But they are not in the listbox. When I walk thought the code in DeBug the files are listed.
View 2 Replies
Jan 12, 2012
I want to do a SQL SELECT COUNT in VB .NET to an Access DB. I can get the code to work using a text fields and text criteria but if I use a date field and Date criteria it returns 0 when there are some 47 records that it should count.
Dim Results As String
Dim InvDT As String = Date.Today
InvDT = "#" & InvDT & "#"
Dim strCnn As String = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=S:MainData.mdb" connection string to your DB'
[Code] .....
View 3 Replies
Feb 24, 2009
how do i add a count down (eg, 20secs) and unless the user clicks something, then "Yes" is automatically selected? [code]
View 3 Replies
May 25, 2011
My tables sectionName column has an existing value. I want to update its Adviser column but my select count always evaluate to false. I want to check if my table's SectionName column record matches the selected value of my CboSectionName. if there is a match then i'll check if such section has an adviser already. If there is an adviser already, then ask the user if he/she wants to change the adviser of that section. If he/she wants to change/update the adviser then update it else exit. however, if there is no adviser yet then assign an adviser to column adviser from cboAdviser. If no record yet in table's SectionName column then prompt the user that there is no section name yet, then exit. I have been debugging the code below for hours now but I can seem to locate why my sql count always resulted to false. [Code]
View 11 Replies
May 23, 2010
I wanted to let the users to select their desired wallpapers dynamically in the window main form. Is it possible? Funtional spec:
1. Let the users to select their desired wallpapers from any directory.
2. Save the wallpaper in the database.
3. Load the wallpaper in the main form after login sucessful.
View 1 Replies
Oct 24, 2011
I am trying to create a program which will allow users to select multiple files from a list and then burn them all to a playable DVD. It would be wonderful if i could setup a custom menu programatically as well. I have seen some documentation on Imapi 2.0 but i have not been able to find too much suppoert for it. I have also found a few SDK's out there but most are over $1000 which just isnt in the budget.
1) Is there a library included in windows 7 that will allow me to do this.
2) Is there an inexpensive or open source sdk with good documentation out there to do this with
View 4 Replies
Nov 7, 2009
I am developing an application for an emergency services organisation using VB 2008 that will enable users to select a map zone of a city centre and plot icons onto it, then save/export the layered map with icons as an image.My problem at the moment is that I am struggling developing the point where the user imports in the icon (for example, a flame icon where a fire started) and drags it around the map within the picture box to the required area.I want them to be able to select their desired icon from a series of commandbuttons and for the icon to 'appear' on the picturebox and be enabled to be dragged around and dropped as required. The organisation already has such a thing working in Microsoft Word (!) and that uses the ActiveDocument.Shape.LoadImage function on a pushbutton to import the icon and then it is placed on the map as required, but this is really unreliable for them.I dont even know if you can layer images onto an existin picturebox within an application in this way and then export as a flat image.
View 3 Replies
Apr 21, 2009
I'm trying to access the Count Property on the array of rows returned by the datatables select method, this is after converting the Web Project to 3.5
View 2 Replies
Jul 9, 2009
I'm currently working on an application that allows users to select picture files and then categorize them into folders. Now I'm having two issues that are probably simple to fix but I only have a year of experience with vb so I just don't know how to fix them. The first and biggest issue is that once the user has selected and categorized a file, I want the program to select the next file in the folder that the first file was moved from. This way the number of clicks required is minimized. However I have no clue what I would need to do in order to accomplish this. Also, my other problem is that I want to be able to find the indexof a quotation mark but whenever I put it in the parameter it just reads it as a quote.
View 4 Replies
Jan 8, 2010
I'm working on a project and my boss insists I use a DataGrid for this. The grid holds information for work orders, one of the cols has a check box in it. I need the user to be able to select any number of those checkboxes/rows and then return a value to the table "stamping" that users ID. This is what I have so far to get the grids populated... I'm using 2005 with a 2000 Access Database if that helps. Though this will be changed to SQL Server once we get it working (yay more work)...
[code]...
I removed the code from the second grid to make it easier to read, obviously once I can get one to work the second shouldn't be as much trouble.
This is the check box: dgvNewBiz.Columns(1).HeaderText = "Select"At this point if someone knows how to get it to recognize the click event of the check box and pass that row info to a variable that would be super as I'm sure I could probably figure it out from there.
View 1 Replies
Feb 9, 2010
I have an asp.net web app that uses forms-based authentication, a SqlMembershipProvider (using an encrypted password format), and a SqlRoleProvider. I need to know if it's possible to administer the users (create new users, assign them to roles, etc.) from a windows application - the powers that be don't want any administrative functionality in the web app itself.Here is the membership provider definition from web.config:
<membership defaultProvider="MyProvider">
<providers>
<add name="MyProvider"
[code].....
View 3 Replies
Mar 7, 2010
I am wanting to create a VB.Net app that checks a database and then prints out the latest orders, the database is mysql and i need it to periodatically check and only print new orders i.e. not print ones it has already printed out.
View 3 Replies
Jun 5, 2011
So I have a program that is supposed to support a small business. I have the work completed and the professor said it was correct but I wanted to go do a little extra. Basically, on the Order screen, you begin to type the name of a customer/supplier/employee into a text box and a list of names that fit the criteria pops up in a list box (lbMatchingAccounts). When you select it, you can hit enter new order and be transported to the Order Details screen to enter the new order.
[Code]...
View 2 Replies
Jun 28, 2009
It's a basic Access database driven e-commerce site. I have a home page, a products page, an orders page, an order confirm page, a shopping cart page and a view current orders page. The site uses an Access database with three tables. A Customer table, with all of the customer details, (FirstName, LastName, EmailAdd, CardNo, CardEx, SortCode, DeliveryAdd, Postcode)A Products table, with all the product information, (ProductID, ProductName, Price, ProductType, Images, ProductDescription). And an Orders table which contains CustomerID and ProductID.I've managed to get the orders page to work, this leads to the order confirmation page which displays the details the customer just placed.Here is what I have in the order confirmation page load event so far. Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs)
[code]...
This returns this error "Syntax error in FROM clause." I'm guessing my SQL code is wrong. I noticed when I placed the order in the order page it added an entry in the Access database where the generated CustomerID was 12 on the customers table and 4 in the orders table. Shouldn't these numbers be the same when they are generated?
View 2 Replies
Jun 8, 2011
I need to make an application that can calculate the items the user chooses from. There is 7 different items the user can choose from.
Small Coffee ..... $4.95
Medium Coffee .... $6.87
Large Coffee ..... $8.52
Bagel ............ $2.99
Cream ............ $0.71
Sugar ............ $0.50
Lid .............. $0.99
Total the coffee order (subtotal + tax at 6% = grand total). Allow the user to delete items from the customer order and to allow the user to start the order for a new customer (clear all). Create a button that gives a 10% discount for coffee only and adjusts the subtotal, tax, and total. Make certain the user can not click the button more than once per customer and if an item is removed from the customer order, make sure the discounted price is removed rather than the list price of the coffee. The button can only be clicked after the coffee is ordered, not before the coffee is selected.
This is what I got so far
Public Class Form1
Private myCoolCheckBoxPrices() As Double = {4.95, 6.87, 8.52, 2.99, 0.71, 0.5, 0.99}
Private myTax As Double = 0.06 'Tax used to add to Total Price
Private Sub lstItems_DoubleClick(ByVal sender As Object, ByVal e As System.EventArgs) Handles lstItems.DoubleClick
[Code] .....
View 13 Replies
May 4, 2012
I have a home page, a products page, an orders page, an order confirm page, a shopping cart page and a view current orders page. The site uses an Access database with three tables. A Customer table, with all of the customer details, (FirstName, LastName, EmailAdd, CardNo, CardEx, SortCode, DeliveryAdd, Postcode)A Products table, with all the product information, (ProductID, ProductName, Price, ProductType, Images, ProductDescription).And an Orders table which contains CustomerID and ProductID.I've managed to get the orders page to work, this leads to the order confirmation page which displays the details the customer just placed.[code]This returns this error "Syntax error in FROM clause." I'm guessing my SQL code is wrong.I noticed when I placed the order in the order page it added an entry in the Access database where the generated CustomerID was 12 on the customers table and 4 in the orders table.
View 2 Replies
Mar 11, 2009
My table holds the following information:- ID- custID- ordered- amount- dateAddedFrom my ASP (VBScript) page I am trying to show all the rows where someone has not ordered, say in the last 30 days, 2 months, 1 year, etc. I am struggling to put the SQL statement together.
View 1 Replies