Search Results

Search found 7127 results on 286 pages for 'calculated columns'.

Page 10/286 | < Previous Page | 6 7 8 9 10 11 12 13 14 15 16 17  | Next Page >

  • Increase columns width in Silverlight DataGrid to fill whole DG width

    - by Henrik P. Hessel
    Hello, I have a DataGrid Control which is bound to a SQL Table. The XAML Code is: <data:DataGrid x:Name="dg_sql_data" Grid.Row="1" Visibility="Collapsed" Height="auto" Margin="0,5,5,5" AutoGenerateColumns="false" AlternatingRowBackground="Aqua" Opacity="80" > <data:DataGrid.Columns> <data:DataGridTextColumn Header="Latitude" Binding="{Binding lat}" /> <data:DataGridTextColumn Header="Longitude" Binding="{Binding long}" /> <data:DataGridTextColumn Header="Time" Binding="{Binding time}" /> </data:DataGrid.Columns> </data:DataGrid> Is it possible increase the single columns sizes to fill out the complete width of the datagrid? thx!, rAyt Edit: Columns with "*" as width are coming with the Silverlight SDK 4.

    Read the article

  • SQL Server PIVOT with multiple X-axis columns

    - by HeavenCore
    Take the following example data: Payroll Forname Surname Month Year Amount 0000001 James Bond 3 2011 144.00 0000001 James Bond 6 2012 672.00 0000001 James Bond 7 2012 240.00 0000001 James Bond 8 2012 1744.50 0000002 Elvis Presley 3 2011 1491.00 0000002 Elvis Presley 6 2012 189.00 0000002 Elvis Presley 7 2012 1816.50 0000002 Elvis Presley 8 2012 1383.00 How would i PIVOT this on the Year + Month (eg: 201210) but preserve Payroll, Forename & Surname as seperate columns, for example, the above would become: Payroll Forename Surname 201103 201206 201207 201208 0000001 James Bond 144.00 672.00 240.00 1744.50 0000002 Elvis Presley 1491.00 189.00 1816.50 1383.00 I'm assuming that because the Year + Month names can change then i will need to employ dynamic SQL + PIVOT - i had a go but couldnt even get the code to parse, nevermind run - any help would be most appreciated! Edit: What i have so far: INSERT INTO #tbl_RawDateBuffer ( PayrollNumber , Surname , Forename , [Month] , [Year] , AmountPayable ) SELECT PayrollNumber , Surname , Forename , [Month] , [Year] , AmountPayable FROM RawData WHERE [Max] > 1500 DECLARE @Columns AS NVARCHAR(MAX) DECLARE @StrSQL AS NVARCHAR(MAX) SET @Columns = STUFF((SELECT DISTINCT ',' + QUOTENAME(CONVERT(VARCHAR(4), c.[Year]) + RIGHT('00' + CONVERT(VARCHAR(2), c.[Month]), 2)) FROM #tbl_RawDateBuffer c FOR XML PATH('') , TYPE ).value('.', 'NVARCHAR(MAX)'), 1, 1, '') SET @StrSQL = 'SELECT PayrollNumber, ' + @Columns + ' from ( select PayrollNumber , CONVERT(VARCHAR(4), [Year]) + RIGHT(''00'' + CONVERT(VARCHAR(2), [Month]), 2) dt from #tbl_RawDateBuffer ) x pivot ( sum(AmountPayable) for dt in (' + @Columns + ') ) p ' EXECUTE(@StrSQL) DROP TABLE #tbl_RawDateBuffer

    Read the article

  • How to Retrieve Dynamic Columns?

    - by user2514925
    I have a table: EmpId FirstName LastName Domain Vertical Account City 345 Priya Palanisamy DotNet LS Abbott Chennai 346 Kavitha Amirtharaj DotNet CG Diageo Chennai 647 Kala Haribabu DotNet IME IMS Chennai I want to take the particular columns dynamically. I am using the following procedure but I can take only one column at a time: create PROC columnlist ( @COLUMNS VARCHAR(1000) ) AS BEGIN DECLARE @sql nvarchar(max) = 'SELECT '+ @COLUMNS + ' FROM Table'; exec sp_executesql @sql,N'' END

    Read the article

  • How to select records as columns in SQL

    - by Leigh
    Hi, I have two tables: tblSizes and tblColors. tblColors has columns called ColorName, ColorPrice and SizeID. There is one size to multiple colors. I need to write a query to select the size and all the colors (as columns) for a that size with the price of each size in its respective column. The colors must be returned as columns, for instance: SizeID : Width : Height : Red : Green : Blue 1---------220-----220----£15----£20-----£29 Hope this makes sense Thank you

    Read the article

  • Performance impact when using XML columns in a table with MS SQL 2008

    - by Sam Dahan
    I am using a simple table with 6 columns, 3 of which are of XML type, not schema-constrained. When the table reaches a size around 120,000 or 150,000 rows, I see a dramatic performance cost in doing any query in the table. For comparison, I have another table, which grows in size at about the same rate, but only contain scalar types (int, datetime, a few float columns). That table performs perfectly fine even after 200,000 rows. And by the way, I am not using XQuery on the xml columns, i am only using regular SQL query statements. Some specifics: both tables contain a DateTime field called SampleTime. a statement like (it's in a stored procedure but I show you the actual statement) SELECT MAX(sampleTime) SampleTime FROM dbo.MyRecords WHERE PlacementID=@somenumber takes 0 seconds on the table without xml columns, and anything from 13 to 20 seconds on the table with XML columns. That depends on which drive I set my database on. At the moment it sits on a different spindle (not C:) and it takes 13 seconds. Has anyone seen this behavior before, or have any hint at what I am doing wrong? I tried this with SQL 2008 EXPRESS and the full-blown SQL Server 2008, that made no difference. Oh, one last detail: I am doing this from a C# application, .NET 3.5, using SqlConnection, SqlReader, etc.. I'd appreciate some insight into that, thanks! Sam

    Read the article

  • Inconsistent table width when hideing/showing a set of columns

    - by Salman A. Kagzi
    I have got a an HTML table of around 40+ columns. To make this table fit in the screen and have the data in a re presentable format we have section in this table. i.e. there are some column that are always visible and the remainder a made visible when s specific radio button (describing a section) is selected. Each radio button is associated to different number of columns. We show/hide a column by setting/removing "display:none" style in all the cell under that column. This all works Just fine. Now the real problem is with the width of the columns in this table. I cant use fixed with with pixel settings. I have tried using the percentage setting by giving 50% to the always visible part and rest 50% is divided between the column in a section. But I am unable to get a fixed behavior i.e. the size of the table columns across IE & FF. Some columns are just right while some are really huge. How can I get the table to give consistent column width across browsers?

    Read the article

  • Simplifying a four-dimensional rule table in Matlab: addressing rows and columns of each dimension

    - by Cate
    Hi all. I'm currently trying to automatically generate a set of fuzzy rules for a set of observations which contain four values for each observation, where each observation will correspond to a state (a good example is with Fisher's Iris Data). In Matlab I am creating a four dimensional rule table where a single cell (a,b,c,d) will contain the corresponding state. To reduce the table I am following the Hong and Lee method of row and column similarity checking but I am having difficulty understanding how to address the third and fourth dimensions' rows and columns. From the method it is my understanding that each dimension is addressed individually and if the rule is true, the table is simplified. The rules for merging are as follows: If all cells in adjacent columns or rows are the same. If two cells are the same or if either of them is empty in adjacent columns or rows and at least one cell in both is not empty. If all cells in a column or row are empty and if cells in its two adjacent columns or rows are the same, merge the three. If all cells in a column or row are empty and if cells in its two adjacent columns or rows are the same or either of them is empty, merge the three. If all cells in a column or row are empty and if all the non-empty cells in the column or row to its left have the same region, and all the non-empty cells in the column or row to its right have the same region, but one different from the previously mentioned region, merge these three columns into two parts. Now for the confusing bit. Simply checking if the entire row/column is the same as the adjacent (rule 1) seems simple enough: if (a,:,:,:) == (a+1,:,:,:) (:,b,:,:) == (:,b+1,:,:) (:,:,c,:) == (:,:,c+1,:) (:,:,:,d) == (:,:,:,d+1) is this correct? but to check if the elements in the row/column match, or either is zero (rules 2 and 4), I am a bit lost. Would it be something along these lines: for a = 1:20 for i = 1:length(b) if (a+1,i,:,:) == (a,i,:,:) ... else if (a+1,i,:,:) == 0 ... else if (a,i,:,:) == 0 etc. and for the third and fourth dimensions: for c = 1:20 for i = 1:length(a) if (i,:,c,:) == (i,:,c+1,:) ... else if (i,:,c+1,:) == 0 ... else if (i,:,c,:) == 0 etc. for d = 1:20 for i = 1:length(a) if (i,:,:,d) == (i,:,:,d+1) ... else if (i,:,:,d+1) == 0 ... else if (i,:,:,d) == 0 etc. even any help with four dimensional arrays would be useful as I'm so confused by the thought of more than three! I would advise you look at the paper to understand my meaning - they themselves have used the Iris data but only given an example with a 2D table. Thanks in advance, hopefully!

    Read the article

  • how to design a schema where the columns of a table are not fixed

    - by hIpPy
    I am trying to design a schema where the columns of a table are not fixed. Ex: I have an Employee table where the columns of the table are not fixed and vary (attributes of Employee are not fixed and vary). Nullable columns in the Employee table itself i.e. no normalization Instead of adding nullable columns, separate those columns out in their individual tables ex: if Address is a column to be added then create table Address[EmployeeId, AddressValue]. Create tables ExtensionColumnName [EmployeeId, ColumnName] and ExtensionColumnValue [EmployeeId, ColumnValue]. ExtensionColumnName would have ColumnName as "Address" and ExtensionColumnValue would have ColumnValue as address value. Employee table EmployeeId Name ExtensionColumnName table ColumnNameId EmployeeId ColumnName ExtensionColumnValue table EmployeeId ColumnNameId ColumnValue There is a drawback is the first two ways as the schema changes with every new attribute. Note that adding a new attribute is frequent. I am not sure if this is the good or bad design. If someone had a similar decision to make, please give an insight on things like foreign keys / data integrity, indexing, performance, reporting etc.

    Read the article

  • sorting a gridview alphabetically when columns are codes

    - by nat
    hi there i have a gridview populated by a Web Service search function. some of the columns in the grid are templatefields, because the values coming back from the search (in a datatable) are ids - i then use these ids to lookup the values when the rowdatabound event is triggered and populate a label or some such. this means that my sorting function for these id/lookup columns sorts by the ids rather than the textual value that i have looked up and actually populated the grid with (although i do put the ids in the grids datakeys). what i want to do is top be able to sort by the looked up textual value rather than the codes for these particular columns. what i was going to do to get around this was to when the datatable comes back from the search, adding more columns the textual values and doing all the looking up then, thus being able to sort directly from the manually added columns. is there another way to do this? as that approach seems like a bit of a bodge. although i guess it does remove having to do the looking up in the rowdatabound event.... my sorting function works by sticking the datatable in the session and on each bind grabbing the sort column and binding the gridview to a DataView with the sort attribute set to the column - and the direction. thanks nat

    Read the article

  • Auto-generated values for columns in database

    - by Jamal
    Is it a good practice to initialize columns that we can know their values in database, for example identity columns of type unique identifier can have a default value (NEWID()), or columns that shows the record create date can have a default value (GETDATE()). Should I go through all my tables and do this whereever I am sure that I won't need to assign the value manually and the Auto-generated value is correct. I am also thinking about using linq-to-sql classes and setting the "Auto Generated Value" property of these columns to true. Maybe this is what everybody already knows or maybe I am asking a question about a fundamental issue, if so please tell me.

    Read the article

  • Create DataGridView columns from Table values

    - by fireBand
    Hi, I am using data grid view to display items as excel spread sheet in VB.NET. I got a table named CostTypes with column names [CostTypeID, CostType] and values [1,External] and [2,Internal] (These are constant but more values can be added to table). I want to create columns with names of the values[External , Internal] in DataGridView. If I use databiding directly I get columns [CostTypeID,CostType] which is not what I am looking for. If some one could explain how to create columns at runtime in datagridview or how to retrieve data from data base using LINQ so that [External , Internal] turn out to be columns that would be great. Thanks in advance.

    Read the article

  • flex grid scrollbar pushing all columns to the left

    - by jon
    I have a flex grid where I have the verticalScrollPolicy="auto".But every time when the scrollbar appears all the columns get pushed to the left, making the columns not align as they should. I tried setting minWidth on all the columns to prevent this, but that doesn't seem to work. Any ideas?

    Read the article

  • ssrs column groups disable multiple columns

    - by DKS
    I'm using ASP.NET 4.0 Visual Studio 2010 RC version Sql Server Report Services (SSRS) ReportViewer and are aware that columns only display on PDF export - not the preview. I want to use a matrix embedded in a table on a page that has multiple columns. I've done some testing and frustratingly found that if you have a tablix with at least one grouped column (even if there is only one displayed matrix-like column group) the columns seem to be disabled. Once I remove the tablix with a grouped column from the tablix from the report the report does multiple-columns. Does anyone know a way around this?

    Read the article

  • Select Columns Only if String length is greater than 2

    - by Zee-pro
    Similar Question may be asked but I am unable to find anything that fits my needs. How can I select only columns where string length is greater than 2 This is how much has done yet. SELECT * FROM Table1 WHERE (Table1.ID = @ID) Or something like WHERE (Table1.ID = @ID) AND (LEN(*) > 2) Thank for all of your help I have a Table, in which I have 35 columns and a User ID column, now I want to select and display information from only those columns which have 2 string. I Like to Select only columns which have 2 string and the defined ID by User not the Whole Row !! I hope I am making sense. Table Desired Result DI 35 Lesson 4 Maths Lesson 9 ICT Lesson 12 English

    Read the article

  • MYSQL Query with 2 columns in Table A related to 1 column in Table B

    - by CYREX
    I have 2 Tables, User and Mail. In User Table i have 2 columns that i will use, the ID column which makes the relation with the Mail Table and it is the Index of User Table and the Name column. In Mail Table i have Receiver Column and Sender Column. Both columns, Receiver and Sender have a number that relates to the ID Column in the User Table. In the User Table is where the name columns resides and i want to make a query that shows me the Receiver and Sender Columns but with the name of the user, not the ID. Up to this point i have this: SELECT name AS Send, name AS Receive FROM mail,user WHERE sender=guid; I know there is still a part of the query missing but i can not figure out what else to put to tell it to show in the SEND output column the name of the sender and in the RECEIVE output column the name of the receiver.

    Read the article

  • Hibernate one to one with multiple columns

    - by Erdem Emekligil
    How can i bind two columns, using @OneToOne annotation? Lets say I've 2 tables A and B. Table A: id1 (primary key) id2 (pk) other columns Table B: id1 (pk) id2 (pk) other columns In class A i want to write something like this: @OneToOne(fetch = FetchType.EAGER, targetEntity = B.class) @JoinColumn(name = "id1 and id2", referencedColumnName = "id1 and id2") private B b; Is it possible to do this using annotations? Thanks.

    Read the article

  • LaTeX, Two columns, Listings and Numbers

    - by Valdor65
    Hi, I'm trying to get a report done and I have a small problem with the twocolums and the line numbering in listings. The text is on two columns, the listings can be on the two columns as well. If I put the number=left, the space between the columns is not sufficient and the text from the first column is written over. Is there any way to ask the listings to put the line numbers "outside" ? Thanks

    Read the article

  • How to insert several thousand columns into sqlite3?

    - by user291071
    Similar to my last question, but I ran into problem lets say I have a simple dictionary like below but its Big, when I try inserting a big dictionary using the methods below I get operational error for the c.execute(schema) for too many columns so what should be my alternate method to populate an sql databases columns? Using the alter table command and add each one individually? import sqlite3 con = sqlite3.connect('simple.db') c = con.cursor() dic = { 'x1':{'y1':1.0,'y2':0.0}, 'x2':{'y1':0.0,'y2':2.0,'joe bla':1.5}, 'x3':{'y2':2.0,'y3 45 etc':1.5} } # 1. Find the unique column names. columns = set() for _, cols in dic.items(): for key, _ in cols.items(): columns.add(key) # 2. Create the schema. col_defs = [ # Start with the column for our key name '"row_name" VARCHAR(2) NOT NULL PRIMARY KEY' ] for column in columns: col_defs.append('"%s" REAL NULL' % column) schema = "CREATE TABLE simple (%s);" % ",".join(col_defs) c.execute(schema) # 3. Loop through each row for row_name, cols in dic.items(): # Compile the data we have for this row. col_names = cols.keys() col_values = [str(val) for val in cols.values()] # Insert it. sql = 'INSERT INTO simple ("row_name", "%s") VALUES ("%s", "%s");' % ( '","'.join(col_names), row_name, '","'.join(col_values) )

    Read the article

  • Oracle: Finding Columns with only null values

    - by Jorge Valois
    I have a table with a lot of columns and a type column. Some columns seem to be always empty for a specific type. I want to create a view for each type and only show the relevant columns for each type. Working under the assumption that if a column has ONLY null values for a specific type, then that columns should not be part of the view, how can you find that out with queries? Is there a SELECT [columnName] FROM [table] WHERE [columnValues] ARE ALL [null] I know I COMPLETELY made it all up above... I'm just trying to get the idea across. Thanks in advance!

    Read the article

  • Add Unique Key For Nullable Columns - SQL Server

    - by Ruby
    I'm using sql server 2008 R2 and would like to apply unique key constraint to nullable columns. This code works good, but if I have multiple columns to add this rule to, it would generate as many 'nullbuster' columns. ALTER TABLE tblBranch ADD nullbuster AS (CASE WHEN column1 IS NULL THEN BranchID ELSE NULL END); CREATE UNIQUE INDEX UK_Column1 ON tblBranch(column1,nullbuster); tblBranch is the table name, nullbuster would be the new column name, BranchId is the Primary key column of the target table, and Column1 is the column name of the target column. Is there any way that I could achieve the goal without generating new columns.

    Read the article

  • Sort MySQL result set using comparison between 2 columns of same value type

    - by Kyobul
    Hello, I have a table containing last_updated_1 and last_updated_2 columns, used respectively for text and images update time on a post. I wish I could get a result set of 10 rows based on all time last updated records contained in the 2 columns, ex. row 1 = last_updated_1 record, row 2 = last_updated_2 record, row 3 = last_updated_1 record, etc. How could I compare inside a MySQL query the both columns values, to get unique & mixed result set ? Thank you in advance for your help

    Read the article

  • designing the database if depending on dynamic columns

    - by phani_yelugula
    In my project,"admin" can create text fields dynamically (using jsp +javascript) and enter can enter data in text fields for saving.in the back end i have to save them in database. here the problem is 1)how we can create columns dynamically depending on the textfields admin is creating. like if he is creating 5textfields then we should create 5 columns in database,if he going with 10 we should do 10 columns. im doing this in mysql,jsp,struts,hibernate

    Read the article

  • Excel 2007: "Format as Table" Increments Column Names

    - by Mark
    I love using the formatting styles for tables in Excel 2007, but in my data I'm using the same column name for multiple columns. When I format my table using the pre-defined styles, it automatically adds an incremental number to each subsequent column name which I don't want. Is there any way to stop this from happening? If I attempt to manually rename the column back to the original name, it automatically appends the incremented number.

    Read the article

< Previous Page | 6 7 8 9 10 11 12 13 14 15 16 17  | Next Page >