Search Results

Search found 12215 results on 489 pages for 'identity column'.

Page 63/489 | < Previous Page | 59 60 61 62 63 64 65 66 67 68 69 70  | Next Page >

  • Create serial number column in telerik mvc grid

    - by Jayaraj
    I could create a grid with telerik mvc <% Html.Telerik().Grid(Model) .Name("ProductGrid") .Columns(columns => { columns.Bound(h => h.ProductName).Width("34%"); columns.Bound(h => h.Description).Width("60%"); columns.Bound(h => h.ProductID).Format(Html.ImageLink("Edit", "Products", new { Id = "{0}" }, "/Content/images/icon_edit.gif", "", new { Id = "edit{0}" }, null).ToString()).Encoded(false).Title("").Sortable(false).Width("3%"); columns.Bound(h => h.ProductID).Format(Html.ImageLink("Delete", "Products", new { Id = "{0}" }, "/Content/images/icon_delete.gif", "", new { onclick = string.Format("return confirm('Are you sure to delete this add on?');") },null).ToString()).Encoded(false).Title("").Sortable(false).Width("3%"); }) .EnableCustomBinding(true) .DataBinding(databinding => databinding.Ajax().Select("_Index", "ProductGrid")) .Pageable(settings => settings.Total((int)ViewData["TotalPages"]) .PageSize(10)) .Sortable() .Render(); %> but I need to add a serial number column in telerik grid.How can i do this?

    Read the article

  • JCo | How to iterate column wise

    - by cedar715
    The data from SAP is returned as a JCo.Table. However, we don't want to display ALL the columns in the VIEW. So, what we have done is, we have created a file called display.xml which has the JCO.Table columns to be displayed. The display.xml is converted to a List and each field is verified if it is present in the display list(see the code below) which is redundant from second row onwards. final Table outputTable = jcoFunction.getTableParameterList(). getTable("OUTPUT_TABLE"); final int numRows = outputTable.getNumRows(); for (int i = 0; i < numRows; i++) { final FieldIterator fields = outputTable.fields(); while (fields.hasNextFields()) { final JCO.Field recordField = fields.nextField(); final String sapFieldName = recordField.getName(); final DisplayFieldDto key = new DisplayFieldDto(sapFieldName); if (displayFields.contains(key)) { System.out.println("recordField.getName() = " + recordField.getName()); final String sapFieldName = (String)recordField.getValue(); } else { // ignore the field. } } } What is the better way to filter the fields in JCo? Can I iterate column wise? Thank you :)

    Read the article

  • R: outlier cleaning for each column in a dataframe by using quantiles 0.05 and 0.95

    - by Rainer
    hi, I am a R-novice. I want to do some outlier cleaning and over-all-scaling from 0 to 1 before putting the sample into a random forest. g<-c(1000,60,50,60,50,40,50,60,70,60,40,70,50,60,50,70,10) If i do a simple scaling from 0 - 1 the result would be: > round((g - min(g))/abs(max(g) - min(g)),1) [1] 1.0 0.1 0.0 0.1 0.0 0.0 0.0 0.1 0.1 0.1 0.0 0.1 0.0 0.1 0.0 0.1 0.0 So my idea is to replace the values of each column that are greater than the 0.95-quantile with the next value smaller than the 0.95-quantile - and the same for the 0.05-quantile. So the pre-scaled result would be: g<-c(**70**,60,50,60,50,40,50,60,70,60,40,70,50,60,50,70,**40**) and scaled: > round((g - min(g))/abs(max(g) - min(g)),1) [1] 1.0 0.7 0.3 0.7 0.3 0.0 0.3 0.7 1.0 0.7 0.0 1.0 0.3 0.7 0.3 1.0 0.0 I need this formula for a whole dataframe, so the functional implementation within R should be something like: > apply(c, 2, function(x) x[x`<quantile(x, 0.95)]`<-max(x[x, ... max without the quantile(x, 0.95)) Can anyone help? Spoken beside: if there exists a function that does this job directly, please let me know. I already checked out cut and cut2. cut fails because of not-unique breaks; cut2 would work, but only gives back string values or the mean value, and I need a numeric vector from 0 - 1. for trial: a<-c(100,6,5,6,5,4,5,6,7,6,4,7,5,6,5,7,1) b<-c(1000,60,50,60,50,40,50,60,70,60,40,70,50,60,50,70,10) c<-cbind(a,b) c<-as.data.frame(c) Regards and thanks for help, Rainer

    Read the article

  • populatin jComBobox with data from a db tbl(table) column

    - by mnmyles
    Hi guyz? I have a JComboBox which i have named "venue_JCB" i want to load details from a tbl column on form load at the initcomponets() i have declared the method "accessDBinit() ;" and after the initComponets() i have implemented the accessDBinit(); method as follows: ================================code============================ void accessDBinit() //Get Student List in the List Box { try { sql = "SELECT classLevel FROM class_session ORDER BY classLevel"; java.lang.Class.forName("com.mysql.jdbc.Driver"); Connection con2=DriverManager.getConnection("jdbc:mysql:///coast","root",""); Statement stmt2 = (Statement)con2.createStatement(); boolean hasResults = stmt2.execute(sql); if(hasResults) { ResultSet rs2 = stmt2.getResultSet(); if(rs2!=null) { displayResultsinit(rs2); } db.stmt.close(); } } catch(Exception e) { System.out.println(e+"Error in connection"); } } void displayResultsinit(ResultSet r) throws SQLException { ResultSetMetaData rmeta = r.getMetaData(); int numColumns=rmeta.getColumnCount(); while(r.next()) { for(int i=1;i<=numColumns;++i) { if(i<=numColumns) { venue_JCB.addItem(r.getString(i)); } } } } ====================================end of code=================================== the method works (Populate the combobox) but at the output bar i get the following on form load and also whenever i select a component from the combobox ======= error===== java.lang.NullPointerExceptionError in connection could some one please tell me where i am going wrong with the method? Thanks in advance regards Malachi

    Read the article

  • Creating an SQL variable character column > 255 characters supporting multiple databases

    - by Piers
    I have an application that stores data through an ODBC data source of the user's choosing. So far it has worked well on a range of database systems (e.g. JET, Oracle, SQL Server), as the SQL syntax is fairly simple. Now I am running into a problem where I need to store more than 255 characters in my strings. Previously I created the table using column type VARCHAR (255). Now if I try to create a table using, e.g. VARCHAR (512) then it falls over on Access databases. I know that I can use the MEMO type for Access, but this is non-standard SQL and will thus likely fail on other database systems (e.g. Oracle). Is there any widely supported SQL standard for creating text columns wider than 255 characters, or do I need to find another solution? The alternatives seem to me to be: 1) Profile the database system and customise the SQL CREATE TABLE command based on the database system. I don't like this as it defeats the purpose of using ODBC. 2) Add extra columns of 255 chars as required (e.g. LONGSTRING1, LONGSTRING2, ...) and concatenate after reading. I don't like this because it means the number of columns can vary between tables and it complicates read/write. Are there any other viable alternatives to these two options? Or is it possible to have an SQL compliant CREATE TABLE command supported by the majority of database vendors, that supports strings longer than 255 chars?

    Read the article

  • Counting total sum of each value in one column w.r.t another in Perl

    - by sfactor
    I have tab delimited data with multiple columns. I have OS names in column 31 and data bytes in columns 6 and 7. What I want to do is count the total volume of each unique OS. So, I did something in Perl like this: #!/usr/bin/perl use warnings; my @hhfilelist = glob "*.txt"; my %count = (); for my $f (@hhfilelist) { open F, $f || die "Cannot open $f: $!"; while (<F>) { chomp; my @line = split /\t/; # counting volumes in col 6 and 7 for 31 $count{$line[30]} = $line[5] + $line[6]; } close (F); } my $w = 0; foreach $w (sort keys %count) { print "$w\t$count{$w}\n"; } So, the result would be something like Windows 100000 Linux 5000 Mac OSX 15000 Android 2000 But there seems to be some error in this code because the resulting values I get aren't as expected. What am I doing wrong?

    Read the article

  • gridview column popup window

    - by peter
    i want to implement ajax hover menu and i have a grid gridview1 like this <asp:GridView ID="GridView1" OnRowCommand="ScheduleGridView_RowCommand" runat="server" AutoGenerateColumns="False" Height="60px" Style="text-align: center" Width="869px" EnableViewState="False"> <Columns> <asp:BoundField HeaderText="Topic" DataField="Topic" /> <asp:BoundField DataField="Moderator" HeaderText="Moderator" /> <asp:BoundField DataField="Expert" HeaderText="Expert" /> <asp:BoundField DataField="StartTime" HeaderText="Start"> <HeaderStyle Width="175px" /> </asp:BoundField> <asp:BoundField DataField="EndTime" HeaderText="End"> <HeaderStyle Width="175px" /> </asp:BoundField> <asp:TemplateField HeaderText="Join" ShowHeader="False"> <ItemTemplate> <asp:Button ID="JoinBT" runat="server" CommandName="Join" Text="Join" Width="52px" /> </ItemTemplate> <HeaderStyle Height="15px" /> </asp:TemplateField> </Columns> </asp:GridView> so i registered <%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="asp" %> and added I added this way in code of gridview columns But i am getting fixed Edit/delete link in a new column rather than Hover menu,,Can any one tell me the solution to get hover menu

    Read the article

  • change column widths in mysql query

    - by addi
    <?php // Connection Database $search = $_POST ['Search']; mysql_connect("xxxxxx", "xxxxxxxxx", "xxxxxx") or die ("Error Connecting to Database"); mysql_select_db("xxxxxx") or die('Error'); $data = mysql_query("SELECT* FROM course WHERE MATCH (CourseName, CourseDescription, CourseLeader) AGAINST ('". $search ."')") or die (mysql_error()); Print "<table border cellpadding=3>"; while($info = mysql_fetch_array( $data )) { Print "<tr>"; Print "<th>Course Name:</th> <td>".$info['CourseName'] . "</td> "; Print "<th>Course Description:</th><td>".$info['CourseDescription'] . "</td> "; Print "<th>Course Leader:</th><td>".$info['CourseLeader'] . " </td></tr>"; } Print "</table>"; ?> In my php code I print the columns CourseName, CourseDescription, CourseLeader after a search, as a resultset. CourseDescription has a lot of text, how do I print it all? is there a way to change the column widths?

    Read the article

  • how to place dropdown list box in jquery grid column

    - by kumar
    Hello friends, I have a jquery grid columns defined like this.. using System; using System.Collections.Generic; using System.Linq; using System.Web; using Trirand.Web.Mvc; using System.Web.UI.WebControls; namespace JQGridMVCExamples.Models { public class OrdersJqGridModel { public OrdersJqGridModel() { OrdersGrid = new JQGrid { Columns = new List<JQGridColumn>() { new JQGridColumn { DataField = "OrderID", Width = 50 }, new JQGridColumn { DataField = "OrderDate", Width = 100, DataFormatString = "{0:d}" }, new JQGridColumn { DataField = "CustomerID", Width = 100 }, new JQGridColumn { DataField = "Freight", Width = 75 }, new JQGridColumn { DataField = "ShipName" } }, Width = Unit.Pixel(640) }; OrdersGrid.ToolBarSettings.ShowRefreshButton = true; } public JQGrid OrdersGrid { get; set; } } } and in the view I am caling like this <div> <%= Html.Trirand().JQGrid(Model.OrdersGrid, "JQGrid1") %> </div> I am getting result perfect.. but for column Freight in the Jquery grid I need to place a dropdown list dynamically for all result rows.. can anyone help me out.. THanks

    Read the article

  • Reporting Services - can't group by a column called "LanguageId"

    - by marc_s
    Folks, I have a really odd behavior here: I have a SQL Server 2008 Reporting Services report which gets grouped and sorted dynamically. One of the column in my data set which I display is called LanguageId and I was trying to get a grouping going by this LanguageId field. I checked, double-checked and triple-checked the data being returned - it does contain my expected values for LanguageId and everything seems fine and dandy. It just never worked - I didn't get the expected groups, I got things like a specific node actually changing its display value from one ID to another when expanding its subitems, and other really whacky stuff. I discovered that grouping and sorting by LanguageCaption works just fine. It also started working fine after I renamed LanguageId to MyLanguageId. So where on earth is this documented that LanguageId appears to be a system variable / reserved word / keyword of some sort in SQL Server Reporting Services that must be avoided at all costs?? I can't seem to find anything on that topic - even Mr. Google and Mrs. Bing came up empty so far....

    Read the article

  • convert divs displaying as row to divs displaying as column

    - by C-Link
    I have as the following divs. Suppose each div is floated left or set display to inline-block. +-----------+ +-----------+ +--------------+ | 1 | | 2 | | | +-----------+ | | | 3 | +-----------+ | | +--------------+ +-----------+ +-----------+ +--------------+ | 4 | | 5 | | | +-----------+ | | | 6 | +-----------+ | | +--------------+ +-----------+ +-----------+ +--------------+ | | | 8 | | 9 | | 7 | +-----------+ | | | | +--------------+ | | +-----------+ I want to achieve like this +-------------+ +-----------+ +-------------+ | 1 | | 4 | | | +-------------+ +-----------+ | 7 | +-------------+ +-----------+ | | | 2 | | 5 | | | | | | | +-------------+ +-------------+ +-----------+ +-------------+ +-------------+ +-----------+ | 8 | | | | | +-------------+ | 3 | | 6 + +-------------+ | | | | | 9 | | | +-----------+ | | +-------------+ +-------------+ I know I can do this by column-wise as this <div class="col1"> <div></div> <div></div> <div></div> </div> <div class="col2"> <div></div> <div></div> <div></div> </div> <div class="col3"> <div></div> <div></div> <div></div> </div> But In my website there more pages like this, so I would like to achieve without touching markup. Is there any idea to perform this with css or any javascript/jquery method?

    Read the article

  • getting attribute as column headers

    - by edwards
    I have the following XML: <DEVICEMESSAGES> <VERSION xml="1" checksum="" revision="0" envision="33050000" device="" /> <HEADER id1="0001" id2="0001" content="Nasher[&lt;messageid&gt;]: &lt;!payload&gt;" /> <MESSAGE level="7" parse="1" parsedefvalue="1" tableid="15" id1="24682" id2="24682" eventcategory="1003010000" content="Access to &lt;webpage&gt; was blocked due to its category (&lt;info&gt; by &lt;hostname&gt;)" /> </DEVICEMESSAGES> I am using the following XSLT: <xsl:stylesheet version="2.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"> <xsl:output method="text"/> <xsl:strip-space elements="*"/> <xsl:template match="DEVICEMESSAGES/HEADERS"> <xsl:value-of select="@id2"/>,<xsl:text/> <xsl:value-of select="@content"/>,<xsl:text/> <xsl:text>&#xa;</xsl:text> </xsl:template> </xsl:stylesheet> I get the following output: 0001 , Nasher[<messageid>]: <!payload> whereas I need the column headings, too: id2, content 0001 , Nasher[<messageid>]: <!payload>

    Read the article

  • Filemaker XSL Select Column By Name

    - by Kevin Sylvestre
    I am looking to export from Filemaker using column names (instead of positions). Currently I export the following XSL stylesheet that exports by position with: <?xml version="1.0" encoding="utf-8"?> <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:fm="http://www.filemaker.com/fmpxmlresult" exclude-result-prefixes="fm" > <xsl:output method="xml" version="1.0" encoding="utf-8" indent="yes"/> <xsl:template match="/"> <people> <xsl:for-each select="fm:FMPXMLRESULT/fm:RESULTSET/fm:ROW"> <person> <name> <xsl:value-of select="fm:COL[01]/fm:DATA"/> </name> <location> <xsl:value-of select="fm:COL[02]/fm:DATA"/> </location> </person> </xsl:for-each> </people> </xsl:template> </xsl:stylesheet> Any ideas? Thanks.

    Read the article

  • Problem convert column values from VARCHAR(n) to DECIMAL

    - by Kevin Babcock
    I have a SQL Server 2000 database with a column of type VARCHAR(255). All the data is either NULL, or numeric data with up to two points of precision (e.g. '11.85'). I tried to run the following T-SQL query but received the error 'Error converting data type varchar to numeric' SELECT CAST([MyColumn] AS DECIMAL) FROM [MyTable]; I tried a more specific cast, which also failed. SELECT CAST([MyColumn] AS DECIMAL(6,2)) FROM [MyTable]; I also tried the following to see if any data is non-numeric, and the only values returned were NULL. SELECT ISNUMERIC([MyColumn]), [MyColumn] FROM [MyTable] WHERE ISNUMERIC([MyColumn]) = 0; I tried to convert to other data types, such as FLOAT and MONEY, but only MONEY was successful. So I tried the following: SELECT CAST(CAST([MyColumn] AS MONEY) AS DECIMAL) FROM [MyTable]; ...which worked just fine. Any ideas why the original query failed? Will there be a problem if I first convert to MONEY and then to DECIMAL? Thanks!

    Read the article

  • Django: DatabaseError column does not exist

    - by Rosarch
    I'm having a problem with Django 1.2.4. Here is a model: class Foo(models.Model): # ... ftw = models.CharField(blank=True) bar = models.ForeignKey(Bar) Right after flushing the database, I use the shell: Python 2.6.6 (r266:84292, Sep 15 2010, 15:52:39) [GCC 4.4.5] on linux2 Type "help", "copyright", "credits" or "license" for more information. (InteractiveConsole) >>> from apps.foo.models import Foo >>> Foo.objects.all() Traceback (most recent call last): File "<console>", line 1, in <module> File "/usr/local/lib/python2.6/dist-packages/django/db/models/query.py", line 67, in __repr__ data = list(self[:REPR_OUTPUT_SIZE + 1]) File "/usr/local/lib/python2.6/dist-packages/django/db/models/query.py", line 82, in __len__ self._result_cache.extend(list(self._iter)) File "/usr/local/lib/python2.6/dist-packages/django/db/models/query.py", line 271, in iterator for row in compiler.results_iter(): File "/usr/local/lib/python2.6/dist-packages/django/db/models/sql/compiler.py", line 677, in results_iter for rows in self.execute_sql(MULTI): File "/usr/local/lib/python2.6/dist-packages/django/db/models/sql/compiler.py", line 732, in execute_sql cursor.execute(sql, params) File "/usr/local/lib/python2.6/dist-packages/django/db/backends/util.py", line 15, in execute return self.cursor.execute(sql, params) File "/usr/local/lib/python2.6/dist-packages/django/db/backends/postgresql_psycopg2/base.py", line 44, in execute return self.cursor.execute(query, args) DatabaseError: column foo_foo.bar_id does not exist LINE 1: ...t_omg", "foo_foo"."ftw", "foo_foo... What am I doing wrong here?

    Read the article

  • PHP MySQLi isn't letting me alter a table (adding a new column)

    - by asdasd
    Well thats pretty much it. This is my query: $query = 'ALTER TABLE permissions ADD '.$name.' INT NOT NULL DEFAULT \'0\''; Where $name is already checked to exist with only lower case alpha letters, and not more than 20 length. Im just starting this out with very simple names. The next 4 lines of code after that one are: if($stmt = $db -> prepare($query)) { $success = $stmt -> execute(); $stmt -> close(); if(!$success) echo 'ERROR: Unsuccessful query: ',$db->error,PHP_EOL; } And I get back, every time ERROR: Unsuccessful query: And no error message. Is there a way to get more error messages so I can see what is failing? I can add new columns through phpmyadmin, but that really doesnt help me at all. The $db is fine, i do lots of stuff before and after this one section. It is only adding new column to the table that fails. side question: prepare() rejected my query every time when i tried to make those 2 variables, the $name and the 0 value as ? ? prepared statement values. Thats why they are in the real query and not bound later. If i could change that too I would like that.

    Read the article

  • datatables add combobox as a column

    - by user403295
    Hi to all, I have got a datatable (http://www.datatables.net/). I have created and filled the table as shown below. Now I need to implement a combobox (assume that I have got 2010, 2011,2012) to allow the user select a year . then when user clicks View or Modify link, which is placed in the table, selected year will be passed to another page as a parameter. Now how can I turn my year column into a combobox?Thanks. rulesTableGlobal = $('#rulesTable').dataTable( { //"bJQueryUI": true, "sPaginationType": "full_numbers", "aoColumns": [ { "sTitle": "Id", "sWidth" : "20px" }, { "sTitle": "Property ID" , "sWidth" : "20px"}, { "sTitle": "Adress" , "sWidth" : "130px"}, { "sTitle": "Suburb" , "sWidth" : "50px"}, { "sTitle": "Bond", "sWidth" : "25px" }, { "sTitle": "Year", "sWidth" : "25px" , "aType": "dom-select"}, { "sTitle": "View or Modify" , "sWidth" : "50px"}] }); function addPropertyToTable( lt_id, lt_uid, address, suburb_name, min_guests, max_guests, bondFee,cleaningFee,bookingServiceFee, weekly_rate,nightly_rate){ var _lt_id = "\'" + lt_id + "\'"; var viewLink = '<A href="#" onclick="forwardDetails('+_lt_id+');">View and Modify</A>'; var year= ""; $('#rulesTable').dataTable().fnAddData( [ lt_id, lt_uid, address, suburb_name, bondFee,cleaningFee,bookingServiceFee, weekly_rate,nightly_rate, min_guests, max_guests, year, viewLink ] ); } }); }

    Read the article

  • How to detect column conflicts with Hibernate?

    - by Slim
    So let's say I have an ArrayList full of Products that need to be committed to the database via Hibernate. There are already a large number of Products in the database. Each product has an ID. Note this is NOT the PK that is autogenerated by Hibernate. My questions is: what is the best way to detect conflicts with this ID? I am looking for a relatively efficient method of obtaining, from the the database, a List of Products that share an ID with any of the Products in my ArrayList. This is all in a single table called Products and the ID attribute is in column ProductID. The way I've done it is grabbing a list of all Products in the database, and compared each one with each entry in my ArrayList - but that is seriously inefficient and I don't think it would work well with a larger database. How should it be done? Thanks. I say "relatively" efficient because efficiency is not the primary concern, but it shouldn't take noticeably long to test against a table of ~1000-5000 rows. Help? EDIT* I'm very new to hibernate and below is the best I've come up with. How does this look? for(long id : idList){ //idList just holds the IDs of each Product in my ArrayList Query query = session.createQuery("select product from Product product where product.id = :id"); query.setLong("id", id); for(int i = 0; i < query.list().size(); i++){ listOfConflictingProducts.add((Product) query.list().get(i)); } }

    Read the article

  • Fluent NHibernate - How to map the foreign key column as a property

    - by Steve
    I am sure this is a straightforward question but consider the following: I have a reference between company and sector as follows: public class Company { public Guid ID { get; set; } public Sector Sector { get; set; } public Guid SectorID { get; set; } } public class Sector { public Guid ID { get; set; } public string Name { get; set; } } Ok. What I want is the SectorID of the Company object to be populated after I go: (new Company()).Sector = new Sector() { Name="asdf" } and do a flush. The mapping I am using kindly creates an additional column in the database called Sector_Id in the Company table, but this is not available as a property on Company. I want the SectorID property to be filled. The mapping i am currently using in the CompanyMap is References(c = c.Sector).Cascade.All(); Does anyone have any ideas?

    Read the article

  • shreding xml column

    - by csetzkorn
    Hi, I have a XML column which contains XML like this: <Set> <Element> <ID> 1 </ID> <List> <ListElement> <Part1> ListElement 1 </Part1> </ListElement> <ListElement> <Part1> ListElement2 </Part1> </ListElement> </List> </Element> <Element> <ID> 2 </ID> <List> <ListElement> <Part1> ListElement3 </Part1> </ListElement> <ListElement> <Part1> ListElement4 </Part1> </ListElement> </List> </Element> </Set> I would like to shred this into a relation table containing this: ID, ListElement 1, ListElement1 1, ListElement2 2, ListElement3 2, ListElement4 I am able to obtain the content of the Parts using something like this: select List.value('(Part1/text())[1]', 'varchar(max)') as test from Table CROSS APPLY xml.nodes('// Element/List/ListElement') AS List(List) but I have not yet achieved to keep the ‘foreign key’ (the ID value). Thanks. Best wishes, Christian

    Read the article

  • Populate two column grid with databinding?

    - by Richard
    How do i populate a two column grid with objects from my observable collection? I've tried to achieve this effect by using the tookits wrap panel but the items just stack. <toolkit:WrapPanel Margin="5,0,0,0" Width="400"> <ItemsControl ItemsSource="{Binding Trips}"> <ItemsControl.ItemTemplate> <DataTemplate> <StackPanel Height="236" Width="182"> <Button Style="{StaticResource VasttrafikButtonTrip}"> <StackPanel Width="152" Height="140"> <TextBlock Text="{Binding FromName}" /> <TextBlock FontFamily="Segoe WP Semibold" Text="till" /> <TextBlock Text="{Binding ToName}" /> </StackPanel> </Button> <TextBlock HorizontalAlignment="Left" Width="160" FontSize="16" FontWeight="ExtraBlack" Text="{Binding TravelTimeText}" /> <TextBlock HorizontalAlignment="Left" Width="160" Margin="0,-6,0,0" FontSize="16" Text="{Binding TransferCountText}" /> </StackPanel> </DataTemplate> </ItemsControl.ItemTemplate> </ItemsControl> </toolkit:WrapPanel>

    Read the article

  • Get top 2 rows from each unique field in a column

    - by Sai
    I have a table named tblItemResources in which I want to get the only 2 rows from each unique field in a column named effectiveDate (order by: ascending): tblItemResources Table |   empID   |   effectiveDate    |    Company   |    Description |   0-123    |    2014-01-23     |   DFD Comp  |   Analyst |   0-234    |    2014-01-23     |   ABC Comp   |  Manager |   0-222    |    2012-02-19     |   CDC Comp  |  Janitor |   0-213    |    2012-03-13     |   CBB Comp  |  Teller and so on. Any help would be much appreciated.

    Read the article

  • Column Header Styling Issue in Data Grid in WPF

    - by sbrakl
    I have formated the Wcf Toolkit Datagrid and below in the is the ColumnHeader Style for it But, there are still some area in Column Header, which are not styled as shown in the image http://www.freeimagehosting.net/uploads/9aba4fbd93.jpg <Style x:Key="ColumnHeaderStyle" TargetType="{x:Type dg:DataGridColumnHeader}"> <Setter Property="VerticalContentAlignment" Value="Center" /> <Setter Property="Background" Value="Orange" /> <Setter Property="Foreground" Value="White" /> <Setter Property="Template"> <Setter.Value> <ControlTemplate TargetType="dg:DataGridColumnHeader"> <dg:DataGridHeaderBorder x:Name="headerBorder" Background="Orange"> <Border BorderThickness="2" CornerRadius="5" Background="Orange" BorderBrush="DarkOrange"> <Grid> <TextBlock Text="{TemplateBinding Content}" VerticalAlignment="Center" HorizontalAlignment="Center" TextWrapping="Wrap"/> </Grid> </Border> </dg:DataGridHeaderBorder> </ControlTemplate> </Setter.Value> </Setter> </Style> <dg:DataGrid Grid.Row="1" Grid.RowSpan="1" Name="dgQuestion" HorizontalAlignment="Left" AutoGenerateColumns="True" Width="740" MinWidth="200" MaxWidth="740" Background="Wheat" ColumnHeaderHeight="30" ColumnHeaderStyle="{DynamicResource ColumnHeaderStyle}" RowStyle="{StaticResource RowStyle}" CanUserAddRows="False" CanUserDeleteRows="False" AlternationCount="2"/>

    Read the article

  • UITableView not getting populated with sqlite database column

    - by Ingila Ejaz
    Here's the code of a method I used to populate UITableView with the contents of a column in sqlite database. However, this is giving no errors at run-time but still does not give any data in UITableView. If anyone could help, it'll be highly appreciated. - (void)viewDidLoad{ [super viewDidLoad]; self.title = @"Strings List"; UITableViewCell *cell; NSString *docsDir; NSArray *dirPaths; sqlite3_stmt *statement; // Get the documents directory dirPaths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES); docsDir = [dirPaths objectAtIndex:0]; // Build the path to the database file databasePath = [[NSString alloc]initWithString: [docsDir stringByAppendingPathComponent:@"strings.sqlite"]]; NSFileManager *filemgr = [NSFileManager defaultManager]; if ([filemgr fileExistsAtPath: databasePath ] == NO) { const char *dbpath = [databasePath UTF8String]; if (sqlite3_open(dbpath, &contactDB) == SQLITE_OK) { NSString * query = @"SELECT string FROM strings"; const char * stmt = [query UTF8String]; if (sqlite3_prepare_v2(contactDB, stmt, -1,&statement, NULL)==SQLITE_OK){ if (sqlite3_step(statement) == SQLITE_ROW) { NSString *string = [[NSString alloc]initWithUTF8String:(const char*)sqlite3_column_text(statement, 0)]; cell.textLabel.text = string; } } else NSLog(@"Failed"); sqlite3_finalize(statement); } sqlite3_close(contactDB); } }

    Read the article

  • Multiple column sorting (SQL SERVER 2005)

    - by Newbie
    I have a table which looks like Col1 col2 col3 col4 col5 1 5 1 4 6 1 4 0 3 7 0 1 5 6 3 1 8 2 1 5 4 3 2 1 4 The script is declare @t table(col1 int, col2 int, col3 int,col4 int,col5 int) insert into @t select 1,5,1,4,6 union all select 1,4,0,3,7 union all select 0,1,5,6,3 union all select 1,8,2,1,5 union all select 4,3,2,1,4 I want the output to be every column being sorted in ascending order i.e. Col1 col2 col3 col4 col5 0 1 0 1 3 1 3 1 1 4 1 4 2 3 5 1 5 2 4 6 4 8 5 6 7 I already solved tye problem by the folowing program Select x1.col1 ,x2.col2 ,x3.col3 ,x4.col4 ,x5.col5 From (Select Row_Number() Over(Order By col1) rn1, col1 From @t)x1 Join(Select Row_Number() Over(Order By col2) rn2, col2 From @t)x2 On x1.rn1=x2.rn2 Join(Select Row_Number() Over(Order By col3) rn3, col3 From @t)x3 On x1.rn1=x3.rn3 Join(Select Row_Number() Over(Order By col4) rn4, col4 From @t)x4 On x1.rn1=x4.rn4 Join(Select Row_Number() Over(Order By col5) rn5, col5 From @t)x5 On x1.rn1=x5.rn5 But I am not happy with this solution. Is there any better way to achieve the same? (Using set based approach) If so, could any one please show an example. Thanks

    Read the article

< Previous Page | 59 60 61 62 63 64 65 66 67 68 69 70  | Next Page >