Search Results

Search found 6257 results on 251 pages for 'columns'.

Page 26/251 | < Previous Page | 22 23 24 25 26 27 28 29 30 31 32 33  | Next Page >

  • Linq to Datarow, Select multiple columns as distinct?

    - by Beta033
    basically i'm trying to reproduce the following mssql query as LINQ SELECT DISTINCT [TABLENAME], [COLUMNNAME] FROM [DATATABLE] the closest i've got is Dim query = (From row As DataRow In ds.Tables("DATATABLE").Rows _ Select row("COLUMNNAME") ,row("TABLENAME").Distinct when i do the above i get the error Range variable name can be inferred only from a simple or qualified name with no arguments. i was sort of expecting it to return a collection that i could then iterate through and perform actions for each entry. maybe a datarow collection? As a complete LINQ newb, i'm not sure what i'm missing. i've tried variations on Select new with { row("COLUMNNAME") ,row("TABLENAME")} and get: Anonymous type member name can be inferred only from a simple or qualified name with no arguments. Also, does anyone know of any good books/resources to get fluent?

    Read the article

  • WPF Binding to DataRow Columns

    - by Trindaz
    Hi, I've taken some sample code from http://sweux.com/blogs/smoura/index.php/wpf/2009/06/15/wpf-toolkit-datagrid-part-iv-templatecolumns-and-row-grouping/ that provides grouping of data in a WPF DataGrid. I'm modifying the example to use a DataTable instead of a Collection of entities. My problem is in translating a binding declaration {Binding Parent.IsExpanded}, which works fine where Parent is a reference to an entity that has the IsExpanded attribute, to something that will work for my weakly typed DataTable, where Parent is the name of a column and references another DataRow in the same DataTable. I've tried declarations like {Binding Parent.Items[IsExpanded]} and {Binding Parent("IsExpanded")} but none of these seem to work. How can I create a binding to the IsExpanded column of the DataRow Parent in my DataTable? Thanks in advance, Dave

    Read the article

  • CSS issue with elements spanning columns

    - by bigFoot
    Hi folks. Overview: I'm trying to create a relatively simple page layout detailed below and running into problems no matter how I try to approach it. Concept: - A standard-size-block layout. I'll quote unit widths: each content block is 240px square with 5px of margin around it. - A left column of fixed width of 1 unit (245px - 1 block + margin to left). No problems here. - A right column of variable width to fill the remaining space. No problems here either. - In the left column, a number of 1unit x 1unit blocks fixed down the column. Also some blank space at the top - again, not a problem. - In the right column: a number of free-floating blocks of standard unit-sizes which float around and fill the space given to them by the browser window. No problems here. - Lastly, a single element, 2 units wide, which sits half in the left column and half in the right column, and which the blocks in the right column still float around. Here be dragons. Please see here for a diagram: http://is.gd/bPUGI Problem: No matter how I approach this, it goes wrong. Below is code for my existing attempt at a solution. My current problem is that the 1x1 blocks on the right do not respect the 2x1 block, and as a result half of the 2x1 block is overwritten by a 1x1 block in the right-hand column. I'm aware that this is almost certainly an issue with position: absolute taking things out of flow. However, can't really find a way round that which doesn't just throw up another problem instead. Code: <html> <head> <title>wat</title> <style type="text/css"> body { background: #ccc; color: #000; padding: 0px 5px 5px 0px; margin: 0px; } #leftcol { width: 245px; margin-top: 490px; position: absolute; } #rightcol { left: 245px; position: absolute; } #bigblock { float: left; position: relative; margin-top: -240px; background: red; } .cblock { margin: 5px 0px 0px 5px; float: left; overflow: hidden; display: block; background: #fff; } .w1 { width: 240px; } .w2 { width: 485px; } .l1 { height: 240px; } </head> <body> <div class="cblock w2 l1" id="bigblock"> <h1>DRAGONS</h1> <p>Here be they</p> </div> <div id="leftcol"> <div class="cblock w1 l1"> <h1>Left 1</h1> <p>1x1 block</p> </div> </div> <div id="rightcol"> <div class="cblock w1 l1"> <h1>Right 1</h1> <p>1x1 block</p> </div> <div class="cblock w1 l1"> <h1>Right 2</h1> <p>1x1 block</p> </div> <div class="cblock w1 l1"> <h1>Right 3</h1> <p>1x1 block</p> </div> <div class="cblock w1 l1"> <h1>Right 4</h1> <p>1x1 block</p> </div> <div class="cblock w1 l1"> <h1>Right 5</h1> <p>1x1 block</p> </div> <div class="cblock w1 l1"> <h1>Right 6</h1> <p>1x1 block</p> </div> <div class="cblock w1 l1"> <h1>Right 7</h1> <p>1x1 block</p> </div> </div> </body> </html> Constraints: One final note that I need cross-browser compatibility, though I'm more than happy to enforce this with JS if necessary. That said, if a CSS-only solution exists, I'd be extremely happy. Thanks in advance!

    Read the article

  • android: tablerow mixed with columns and multiline text

    - by Yang
    I am trying to have a tablelayout contains several tablerows. One of the rows contains 4 buttons, while the second row contains a very long text. However, the width of the button stretches with the text in the second row. Is there anyway to prevent this? http://img684.imageshack.us/i/tableview1.jpg/ http://img521.imageshack.us/i/tableview2.jpg/ Here is my xml file: (somehow this website is not friendly to xml file) AbsoluteLayout android:id="@+id/widget0" android:layout_width="fill_parent" android:layout_height="fill_parent" xmlns:android="http://schemas.android.com/apk/res/android" TableLayout android:id="@+id/widget28" android:layout_width="fill_parent" android:layout_height="wrap_content" android:orientation="vertical" android:layout_x="0px" android:layout_y="10px" TableRow android:id="@+id/widget29" android:layout_width="fill_parent" android:layout_height="wrap_content" android:orientation="horizontal" Button android:id="@+id/widget30" android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="Button" Button android:id="@+id/widget31" android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="Button" Button android:id="@+id/widget32" android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="Button" Button android:id="@+id/widget33" android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="Button" TableRow android:id="@+id/widget35" android:layout_width="fill_parent" android:layout_height="wrap_content" android:orientation="horizontal" TextView android:id="@+id/widget40" android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="TextViewTextViewTextViewTextViewTextViewTextView"

    Read the article

  • SQL Reporting Services - Subreports Broken into multiple columns

    - by devin
    Hi, I inherited an SQL Reporting Services .rdl project from somebody and need help fixing some functionality. In each row of the report, there is a subreport. In order to save space the subreport is divided into 3. Such that in each row of the report, it splits the data of the subreport into 3 smaller tables. Right now, it fills these 3 subreports horizontally. (ie. if the result has 9 values, the first subtable will have 1, 4 & 7, the second subtable will have 2, 5 & 8, etc) Is there a way to have it fill the subtables vertically? (ie. the first subtable would have 1,2 & 3) Thanks!

    Read the article

  • CSS layout with 2 columns, taking up all width of browser, where left column can collapse

    - by Matt Dawdy
    I want to have a 2 column layout, and have the left column able to be 200 px at first, and have a "shrink" button to shrink it down to 10px, and have the right column expand to fill all the rest of the available space. Then if they click on the "show" button (which will be all they see in the now 10px wide left column) have the left grow back to 200px and have the right column shrink by that amount. I can't figure out how to make the right column grown and shrink without knowing the exact width of the window. I hope this makes sense, and I really hope someone can point me in the right direction. Browser requirements are IE8, FF3.6, Safari, and Chrome, so in theory I can use some advanced CSS techniques. At least I don't have to support IE6.

    Read the article

  • mysql query to dynamically convert row data to columns

    - by Anirudh Goel
    I am working on a pivot table query. The schema is as follows Sno, Name, District The same name may appear in many districts eg take the sample data for example 1 Mike CA 2 Mike CA 3 Proctor JB 4 Luke MN 5 Luke MN 6 Mike CA 7 Mike LP 8 Proctor MN 9 Proctor JB 10 Proctor MN 11 Luke MN As you see i have a set of 4 distinct districts (CA, JB, MN, LP). Now i wanted to get the pivot table generated for it by mapping the name against districts Name CA JB MN LP Mike 3 0 0 1 Proctor 0 2 2 0 Luke 0 0 3 0 i wrote the following query for this select name,sum(if(District="CA",1,0)) as "CA",sum(if(District="JB",1,0)) as "JB",sum(if(District="MN",1,0)) as "MN",sum(if(District="LP",1,0)) as "LP" from district_details group by name However there is a possibility that the districts may increase, in that case i will have to manually edit the query again and add the new district to it. I want to know if there is a query which can dynamically take the names of distinct districts and run the above query. I know i can do it with a procedure and generating the script on the fly, is there any other method too? I ask so because the output of the query "select distinct(districts) from district_details" will return me a single column having district name on each row, which i will like to be transposed to the column.

    Read the article

  • SubSonic 3 ignoring columns in Select()

    - by jessegavin
    I have a table like so.. CREATE TABLE [dbo].[Locations_Hours]( [LocationID] [int] NOT NULL, [sun_open] [nvarchar](10) NULL, [sun_close] [nvarchar](10) NULL, [mon_open] [nvarchar](10) NULL, [mon_close] [nvarchar](10) NULL, [tue_open] [nvarchar](10) NULL, [tue_close] [nvarchar](10) NULL, [wed_open] [nvarchar](10) NULL, [wed_close] [nvarchar](10) NULL, [thu_open] [nvarchar](10) NULL, [thu_close] [nvarchar](10) NULL, [fri_open] [nvarchar](10) NULL, [fri_close] [nvarchar](10) NULL, [sat_open] [nvarchar](10) NULL, [sat_close] [nvarchar](10) NULL, [StoreNumber] [int] NULL, [LocationHourID] [int] IDENTITY(1,1) NOT NULL, CONSTRAINT [PK_Locations_Hours] PRIMARY KEY CLUSTERED ( [LocationHourID] ASC )WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY] ) ON [PRIMARY] And SubSonic 3 is generating a class with the following properties int LocationID string monopen string monclose string tueopen string tueclose string wedopen string wedclose string thuopen string thuclose string friopen string friclose string satopen string satclose string sunopen string sunclose int? StoreNumber int LocationHourID When I try to perform a query against this class like so.. var result = DB.LocationHours.Where(o => o.LocationID == _locationId); This is the resulting SQL query that SubSonic generates. SELECT [t0].[LocationHourID], [t0].[LocationID], [t0].[StoreNumber] FROM [dbo].[Locations_Hours] AS t0 WHERE ([t0].[LocationID] = 4019) I cannot figure out why SubSonic is omitting the nvarchar fields when it generates the SELECT statement. Anyone got any ideas?

    Read the article

  • Retrieve sequence of data from different columns.

    - by janetsmith
    Let's say I have a table containing following data: | id | t0 | t1 | t2 | | 1 | 4 | 5 | 6 | | 2 | 3 | 3 | 2 | | 3 | 6 | 4 | 5 | | 4 | 4 | 5 | 5 | I want to retrieve all the rows containing 4, 5, 6 (regardless the position of numbers in the tables), so row 1 & row 3 will be selected. How to do that with SQL query?

    Read the article

  • How do I correctly organize output into columns?

    - by wrongusername
    The first thing that comes to my mind is to do a bunch of \t's, but that would cause words to be misaligned if any word is longer than any other word by a few characters. For example, I would like to have something like: Name Last Name Middle initial Bob Jones M Joe ReallyLongLastName T Instead, by including only "\t"'s in my cout statement I can only manage to get Name Last Name Middle initial Bob Jones M Joe ReallyLongLastName T or Name Last Name Middle initial Bob Jones M Joe ReallyLongLastName T What else would I need to do?

    Read the article

  • Storing Objects in columns using Hibernate JPA

    - by user210791
    Is it possible to store something like the following using only one table? Right now, what hibernate will do is create two tables, one for Families and one for people. I would like for the familymembers object to be serialized into the column in the database. @Entity(name = "family") class Family{ private final List<Person> familyMembers; } class Person{ String firstName, lastName; int age; }

    Read the article

  • Manipulating columns of numbers in elisp

    - by ~unutbu
    I have text files with tables like this: Investment advisory and related fees receivable (161,570 ) (71,739 ) (73,135 ) Net purchases of trading investments (93,261 ) (30,701 ) (11,018 ) Other receivables 61,216 (10,352 ) (69,313 ) Restricted cash 20,658 (20,658 ) - Other current assets (39,643 ) 14,752 64 Other non-current assets 71,896 (26,639 ) (26,330 ) Since these are accounting numbers, parenthesized numbers indicate negative numbers. Dashes represent 0 or no number. I'd like to be able to mark a rectangular region such as third column above, call a function (format-column), and automatically have (-73135-11018-69313+64-26330)/1000 sitting in my kill-ring. Even better would be -73.135-11.018-69.313+0.064-26.330 but I couldn't figure out a way to transform 64 -- 0.064. This is what I've come up with: (defun format-column () "format accounting numbers in a rectangular column. format-column puts the result in the kill-ring" (interactive) (let ((p (point)) (m (mark)) ) (copy-rectangle-to-register 0 (min m p) (max m p) nil) (with-temp-buffer (insert-register 0) (goto-char (point-min)) (while (search-forward "-" nil t) (replace-match "" nil t)) (goto-char (point-min)) (while (search-forward "," nil t) (replace-match "" nil t)) (goto-char (point-min)) (while (search-forward ")" nil t) (replace-match "" nil t)) (goto-char (point-min)) (while (search-forward "(" nil t) (replace-match "-" nil t) (just-one-space) (delete-backward-char 1) ) (goto-char (point-min)) (while (search-forward "\n" nil t) (replace-match " " nil t)) (goto-char (point-min)) (kill-new (mapconcat 'identity (split-string (buffer-substring (point-min) (point-max))) "+")) (kill-region (point-min) (point-max)) (insert "(") (yank 2) (goto-char (point-min)) (while (search-forward "+-" nil t) (replace-match "-" nil t)) (goto-char (point-max)) (insert ")/1000") (kill-region (point-min) (point-max)) ) ) ) (global-set-key "\C-c\C-f" 'format-column) Although it seems to work, I'm sure this function is poorly coded. The repetitive calls to goto-char, search-forward, and replace-match and the switching from buffer to string and back to buffer seems ugly and inelegant. My entire approach may be wrong-headed, but I don't know enough elisp to make this more beautiful. Do you see a better way to write format-column, and/or could you make suggestions on how to improve this code?

    Read the article

  • SQL Server: SELECT rows with MAX(Column A), MAX(Column B), DISTINCT by related columns

    - by z531
    Scenario: Table A MasterID, Added Date, Added By, Updated Date, Updated By, 1, 1/1/2010, 'Fred', null, null 2, 1/2/2010, 'Barney', 'Mr. Slate', 1/7/2010 3, 1/3/2010, 'Noname', null, null Table B MasterID, Added Date, Added By, Updated Date, Updated By, 1, 1/3/2010, 'Wilma', 'The Great Kazoo', 1/5/2010 2, 1/4/2010, 'Betty', 'Dino', 1/4/2010 Table C MasterID, Added Date, Added By, Updated Date, Updated By, 1, 1/5/2010, 'Pebbles', null, null 2, 1/6/2010, 'BamBam', null, null Table D MasterID, Added Date, Added By, Updated Date, Updated By, 1, 1/2/2010, 'Noname', null, null 3, 1/4/2010, 'Wilma', null, null I need to return the max added date and corresponding user, and max updated date and corresponding user for each distinct record when tables A,B,C&D are UNION'ed, i.e.: 1, 1/5/2010, 'Pebbles', 'The Great Kazoo', 1/5/2010 2, 1/6/2010, 'BamBam', 'Mr. Slate', 1/7/2010 3, 1/4/2010, 'Wilma', null, null I know how to do this with one date/user per row, but with two is beyond me. DBMS is SQL Server 2005. T-SQL solution preferred. Thanks in advance, Dave

    Read the article

  • multiple columns per day with fullcalendar

    - by Emanuel Schwarz
    I want to show a scheduling plan for a couple of seminar-rooms, each of them in a seperate column, within a fullcalendar day view. So it schould look like a current fullcalendar week view but for every single day. Is there an obvious solution for this? And if not, where in the source should i start, what to go for, what to avoid? Some suggestions would be nice. Thanks Emanuel

    Read the article

  • Constructing dynamic columns from parameters in Sybase

    - by Chapax
    Hi, I'm trying to write a stored proc (SP) in Sybase. The SP takes 5 varchar parameters. Based on the parameters passed, I want to construct the column names to be selected from a particular table. The below works: DECLARE @TEST VARCHAR(50) SELECT @TEST = "country" --print @TEST execute("SELECT DISTINCT id_country AS id_level, Country AS nm_level FROM tempdb..tbl_books INNER JOIN (tbl_ch2_bespoke_report INNER JOIN tbl_ch2_bespoke_rpt_mapping ON tbl_ch2_bespoke_report.id_report = tbl_ch2_bespoke_rpt_mapping.id_report) ON id_" + @TEST + "= tbl_ch2_bespoke_rpt_mapping.id_pnl_level WHERE tbl_ch2_bespoke_report.id_report = 14") but gives me multiple results: 1 1 row(s) affected. id_level nm_level 1 4376 XYZ 2 4340 ABC I would like to however only obtain the 2nd result. Do I need to necessarily use dynamic SQL to achieve this? Many thanks for your help. --Chapax

    Read the article

  • count columns group by

    - by zhangzhong
    I hava the sql as below: select a.dept, a.name from students a group by dept, name order by dept, name And get the result: dept name -----+--------- CS | Aarthi CS | Hansan EE | S.F EE | Nikke2 I want to summary the num of students for each dept as below: dept name count -----+-----------+------ CS | Aarthi | 2 CS | Hansan | 2 EE | S.F | 2 EE | Nikke2 | 2 Math | Joel | 1 How shall I to write the sql?

    Read the article

  • ASP, sorting database with conditions using multiple columns...

    - by Mitch
    First of all, I'm still working in classic ASP (vbScript) with an MS Access Database. And, yes I know its archaic, but I'm still hopeful I can do this! So now to my problem: Take the following table as an example: PROJECTS ContactName StartDate EndDate Complete Mitch 2009-02-13 2011-04-23 No Eric 2006-10-01 2008-11-15 Yes Mike 2007-05-04 2009-03-30 Yes Kyle 2009-03-07 2012-07-08 No Using ASP (with VBScript), and an MS Access Database as the backend, I’d like to be able to sort this table with the following logic: I would like to sort this table by date, however, depending on whether a given project is complete or not I would like it to use either the “StartDate” or “EndDate” as the reference for a particular row. So to break it down further, this is what I’m hoping to achieve: For PROJECTS where Complete = “Yes”, reference “EndDate” for the purpose of sorting. For PROJECTS where Complete = “No”, reference “StartDate” for the purpose of sorting. So, if I were to sort the above table following these rules, the output would be: PROJECTS ContactName StartDate EndDate Complete 1 Eric 2006-10-01 2008-11-15* Yes 2 Mitch 2009-02-13* 2011-04-23 No 3 Kyle 2009-03-07* 2012-07-08 No 4 Mike 2007-05-04 2009-03-30* Yes *I’ve put a star next to the date that should be used for the sort in the table above. NOTE: This is actually a simplified version of what I really need to do, but I think that if I could just figure this out, I’ll be able to do the rest on my own. ANY HELP IS GREATLY APPRECIATED; I’VE BEEN STRUGGLING WITH THIS FOR FAR TOO LONG NOW! Thank you!

    Read the article

  • SQL - Order against two columns at the same time (intersecting)

    - by Alex
    I have a table with the fields CommonName and FirstName. Only either field has data, never both. Is there a way to order rows in an intersecting manner on SQL Server? Example: CommonName FirstName Bern Wade Ashley Boris Ayana I want records ordered like this: CommonName FirstName Ashley Ayana Bern Boris Wade Is this possible, and if so, how?

    Read the article

  • SQL to retrieve aggregated data with computed columns

    - by Remnant
    I have a table that looks like this for about ~30 students: StudentID Course* CourseStatus 1 Math Pass 1 English Fail 1 Science Pass 2 Math Fail 2 English Pass 2 Science Fail etc. *In my actual database the 'Course' column is a CourseID e.g. (1 = Math; 2 = English etc.) which references a 'CourseName' table. I amended the table above just to make it clear the nature of the problem. I want to write a query (stored procedure) in SQL that summarises performance for a given course and returns the following: EXEC usp_GetCourseSummary 'Math' Total Students Total Pass % Pass Total Fail % Fail 25 15 60 10 40 Have been scratching my head on this one for some time. Any ideas?

    Read the article

  • transform a matrix wtih 2 columns into a multimap

    - by Derek
    Hi, I am wondering if there is a way to transform a matrix of 2 column into a multimap or list of list. The first column of the matrix is an id (with possibly duplicated entries) and the 2nd column is some value. For example, if I have to following matrix m<-matrix(c(1,2,1,3,2,4), c(3,2)) i would like to transform it into the following list [[1]] 3,4 [[2]] 2 Thanks, Derek

    Read the article

  • Rows in their own columns depending on their date and simbolized by 'x'

    - by Chandradyani
    Dear All, please help me since I'm newbie in SQL Server. I have a select query that currently produces the following results: DoctorName Team Visit date dr. As A 5 dr. Sc A 4 dr. Gh B 6 dr. Nd C 31 dr As A 7 Using the following query: SELECT d.DoctorName, t.TeamName, ca.VisitDate FROM cActivity AS ca INNER JOIN doctor AS d ON ca.DoctorId = d.Id INNER JOIN team AS t ON ca.TeamId = t.Id WHERE ca.VisitDate BETWEEN '1/1/2010' AND '1/31/2010' I want to produce the following: DoctorName Team 1 2 3 4 5 6 7 ... 31 Visited dr. As A x x ... 2 times dr. Sc A x ... 1 times dr. Gh B x ... 1 times dr. Nd C ... X 1 times

    Read the article

< Previous Page | 22 23 24 25 26 27 28 29 30 31 32 33  | Next Page >