I have a table that could look like the left table in the following picture, but i want to present it as the right table in the picture. http://pici.se/549963/?size=fullsize
So i've found out that i could use pivots to do this, but am having some trouble getting it to work, so if you know how to do this.
i have a table for customer forecast which contains customer, week number and quantit as columns. now i need to write query and list the week as column for each customer and each cell should have a quantity. how to write query for this using pivot logic. i dont want to use cursor.
I'm assuming I need to use a pivot table from what I've found so far. However, every one that I've seen has not had the date setup like I have.
I have a Gridview on my page which I need to be populated like so
Date NCMR
1/1/10-1/31/10 #
2/1/10-2/28/10 #
I want to do this for 10 months... bottom record being the current month (or last month). I would also like the Date to format to January 2010 I used the above date format because that is how it is in the table. Basically, I need to know how to create the pivot table to search the table for 1/*/10, 2/*/10, etc
and here is my code that parses the xml and tries to bind the grid. What am I missing here?
var retVal = service.GetTripDetailsByTripID(tripId); var xmlTrips = XDocument.Parse(retVal); var tripTolls = from t in xmlTrips.Elements("TripTollCompleteDC") select new { TripTollId = (int)t.Element("TripTollId") , DMSLaneModeID = (int?)t.Element("DMSLaneModeID") , HOVOnly = (bool)t.Element("HOVOnly") , CreateDateTime = (DateTime)t.Element("CreateDateTime") , ConfigVTMSDelaySeconds = (int)t.Element("ConfigVTMSDelaySeconds") }; grdTripDetails.DataSource = tripTolls; grdTripDetails.DataBind();
I realize these are anonymous types. Is that a problem? I have verified the service is returning the Xml as stated above. Can anyone out there point me in the right direction? Just for completeness, here is the grid markup <asp:GridView runat="server" ID="grdTripDetails" />
How to achive this using any of the data control gridview, datalist or repeater control ?the numbers 1,2,3....31 are the days in a month while "HomePage", "Maps" etc are the name of the pages and the entry below each date will show no of users visited the page. I want to show the same for every month
i have fetched required data and the output is as follows .
I need to display an Excel like Pivot table in ASP.Net web.I knew there is OWC Pivot table but it looks really ugly and not like Excel's. Is there any control out there or we can create one of our own ?
I have a doubt and i am sending you the details below, what i want to display in Gridview.
below i am describing the sql Table Structure.
Original Table Structure.
ID               Date            TimeLogged(Hrs)       UserName
1Â Â Â Â Â Â Â Â Â Â Â Â 10/8/2012Â Â Â Â Â Â Â Â Â Â Â Â Â Â 5.50Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Bubai 2Â Â Â Â Â Â Â Â Â Â Â Â 11/8/2012Â Â Â Â Â Â Â Â Â Â Â Â Â Â 2.30Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Bubai 3Â Â Â Â Â Â Â Â Â Â Â Â 10/8/2012Â Â Â Â Â Â Â Â Â Â Â Â Â Â 3.30Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Bhanu 4Â Â Â Â Â Â Â Â Â Â Â Â 11/8/2012Â Â Â Â Â Â Â Â Â Â Â Â Â Â 7.30Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Bhanu
I want result like below. User Name should be dynamic. May be lot of users. User name will come from Database table.
i want to show details in Gridview(Front End).
Date                   Bubai              Bhanu                   Total
10/8/2012Â Â Â Â Â Â Â Â Â Â Â Â Â 5.30Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â 3Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â 8. 30 11/8/2012Â Â Â Â Â Â Â Â Â Â Â Â Â 2.30Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â 7.30Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â 10
 Total                  8                   10.30                 18.30  I have a doubt and i am sending you the details below, what i want to display in Gridview. below i am describing the sql Table Structure.Original Table Structure.
ID Date TimeLogged(Hrs) UserName 1 10/8/2012 5.50 Bubai 2 11/8/2012 2.30 Bubai 3 10/8/2012 3.30 Bhanu 4 11/8/2012 7.30 Bhanu
I want result like below. User Name should be dynamic. May be lot of users. User name will come from Database table. i want to show details in Gridview(Front End).
Date Bubai Bhanu Total 10/8/2012 5.30 3 8. 30 11/8/2012 2.30 7.30 10
I have a grid which displays a set of columns and I m trying to display only those rows in grid based on the options chosen or searched.
I filter options are
1) search for (textbox) - search from (listbox with columns product, product id , userid )
2) Date filter - choose 1 checkbox out of 3 checkboxes(create Date, submit date, Approve ) and whateevr is selected for the criteria we choose between date from and to calender.
3) Status - listbox with status ID 's Basec on this three filter options I need to frame a LINQ to SQL query that gives me results in grid any option can either be choosen or can be left blank I am using 3 - tier architecture and passing all this fields as parameters in a method from UI.cs to UI.DAL where I am writing a query to generate grid view rows. I think I need to use Dynamic LInq and I have not done that before !!
I'am developing a attendance software of employees with visual studio 2005 and sql server 2005, in which i have to display the attendance in a gridview withname and date as follows,
NAME (Date)1 2 3 4 5 6 7 8 9 10 .... ... 31 RAM P A P P P A P- Present A- Absent
I am bringing back a matrix from using a pivot table and displaying the results in a gridview. Here is the code to my gridview
[Code]....
This works fine but I want to total each column but they are dynamic so I don't know how many columns there will be. So it will look something like below:
East Midlands 0 0 0 0 0 0 0 0 0 North East 0 0 0 0 0 0 0 0 0 North London 0 0 0 0 0 0 0 0 0 North West 0 0 0 0 0 0 0 0 0 ROI 0 0 0 0 0 0 0 0 0 Scotland & NI 0 0 0 0 0 0 0 0 0 South East 1 1 0 0 0 0 0 0 0 South London 0 0 0 0 0 0 0 0 0 South Wales & West 0 0 0 0 0 0 0 0 0 West Midlands 0 0 0 0 0 0 0 0 0 Total 1 1 0 0 0 0 0 0
I am struggling to get the column totals in the footer. I have the code below which just brings back zero each time and if i move the Dim total as integer = 0 to the top as a global variable I get 54 in each of the total columns?
I have one database in which student enroll no with his sem is stored . I want that if i enter stud enroll no then in dropdown list all the sem related to that stud should come. My databaseÂ
Stud enroll no     sem1      sem2       sem3      sem4
    1          July 2013   Jan 2014    July 2014   Jan 2015     2          Feb 2013   Aug 2014    Feb 2014   Aug 2015      3         July 2012   Jan 2013   July 2013   Jan 2014
I have to in sert the gridview values into database, the values can be single or more than one values, so here i have to use the XML to store the data, but my question is?
i have to sent the values as a string, to the database, so how i convert that, and how could i retrieve the values as it is, and stored or display to the another gridview.
I have been chasing this erorr all day and coming up blank. I created a stored proceudre(fairly complicated logic), added it to the context, and set the return type to a specific entity type.
It generated this:
[Function(Name="dbo.usp_ServiceTemplateSelectByFkID")] public ISingleResult<ServiceTemplate> usp_ServiceTemplateSelectByFkID([Parameter(Name="FkId", DbType="Int")] System.Nullable<int> FkId) { IExecuteResult result = this.ExecuteMethodCall(this, ((MethodInfo)(MethodInfo.GetCurrentMethod())), FkId); return ((ISingleResult<ServiceTemplate>)(result.ReturnValue)); }
I call it from my service with the following method:
public ISingleResult<ServiceTemplate> GetByFkId(int FkId) { return Db.usp_ServiceTemplateSelectByFkId(FkId); }
I have tested the stored procedure and it returns the results I want. When I make the service call from the controller, it doesn't error out, however, it should return 4 records in this instance and instead, it returns the same 4 records (repeating the first record 4 times).
In addition, in my controller code, I am using the MVCContrib ToPagedList() method which doesn't appear to work with the ISingleResult interface (forward only cursor, I'm guessing). I have attempted converting the service results to IQuery, List, and Array, however, I still have the problem with the first record being repeated 4 times.
I need to display a large monthly calendar of events for one of my websites and was wondering if the DayRender event loops through all days in any given month when the calendar control is displayed on the webpage.
Here is some sample code i found on the MS website:
[URL]
This part for the DayRender event is what i am refering to:
[code]....
The code above looks like it loops through the DataSet row by row and matches the e.Day.Date item. But i'm just not too sure about the loop going through all days in a given month displayed on the calendar?
Not sure if this is for SQL or .net! I have 3 tables which looks like
table1 ID Name 1 Jon
and
table2 ID Number Job 1 1 IT 2 1 Web 3 1 Admin
table1 ID ContractType 1 Temp 1 Perm
An inner join makes one table with 3 rows (I excluding the ID from table 2 for the join) which is saved as a view
viewTable ID Name Number Job ContractType 1 Jon 1 IT Temp 2 Jon 1 Web Temp 3 Jon 1 Admin Temp 4 Jon 1 IT Perm 5 Jon 1 Web Perm 6 Jon 1 Admin Perm
I want to display these results on a web page via the grid view. However, I don't want to show the user 6 times! I want to show the user name once, the contract type once and each Job! What is the best way to do this? Is there a fault with the database design already? I assume the easiest answer is to not join them in a view but query each section 3 times from the website but I'd rather 1 connection only!