Want to automate a process

IndigoMontoya

Member
Joined
Oct 3, 2012
Messages
17
Programming Experience
Beginner
I manually query an access database that my front office staff input data into. I need to see production for my employees for the day/week/month. So the output looks like this:
EmployeeName ProductSold Quantity ProductValue SaleDate
Richard Jones TV 4 $12,000 10/03/2012
JJ Smith Laptop 3 $15,000 10/03/2012

Basically that set up for the day, the week and the month. Can someone show me how to do this automatically in .Net?
 
What exactly do you mean by "automatically"? The code to query a database is one thing but "automatically" implies no human intervention. Exactly how do you want this action initiated and exactly how do you want the data output, e.g. to the screen or to a file?
 
I am using a datagrid to import data from an access database onto my vb.net form. I can not find out much about manipulating datagrids in vb.net...do you have any insight?
 
First up, you're not using the grid to import data from a database. The grid simply displays the data that you've already retrieved, most likely using a data adapter. The basic steps would be to use a data adapter to populate a DataTable and bind that to a DataGridView. There's lots of information around about using a DataGridView so I'm not really sure where you've looked but if you tell us what you're actually having trouble with then we can either help directly or point you to where you can find relevant information.
 
sorry, I am new to all of this. I am using a dataadapter to import my data from access to my datagrid to display the data on my window form. I just want to see what all I can do with a datagrid. Like what the avaliable features/functions of datagrid are.
 
The first thing I would be doing is reading the documentation for the class and then following some of the links provided at the bottom. If you then need more information, you'll have a much better idea of exactly what you're looking for.

DataGridView Class (System.Windows.Forms)
 
Thank you for that link, I am definitely going to read it over! :) I do not see on the page how to add a row programmatically...however I may just not be seeing it cause I loooked for addrow or rowadd something of that nature.
 
That's why you read all the documentation and follow the links. In a very common pattern in .NET. The grid has a Rows property that is a collection of DataGridViewRow objects and, like all collection, it has an Add method. If you're binding data to the grid though, which should be the case more often than not, you won't be adding rows to the grid directly. If you want to add a row in code then you add it to the data source.
 
I think I have the solution you are looking for, in your form_load, set a statement that will fetch the details you want. You mean data's that will be visible is within that day only? If yes then

make a query something like this - "Select * from tblname where datesold = '" & date.now & "',myconnection" that will be displayed to your datagridview/listview.
 
Back
Top