Search Results

Search found 10420 results on 417 pages for 'item'.

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

  • LINQ to Entites - Left Outer Join - SQL 2000

    - by user255234
    Hi! I'm using Linq to Entities. I have the following query in my code, it includes left outer Join: var surgeonList = (from item in context.T1_STM_Surgeon.Include("T1_STM_SurgeonTitle") .Include("OTER").Include("OSLP") join reptable in context.OSLP on item.Rep equals reptable.SlpCode into surgRepresentative where item.ID == surgeonId select new { ID = item.ID, First = item.First, Last = item.Last, Rep = (surgRepresentative.FirstOrDefault() != null) ? surgRepresentative.FirstOrDefault().SlpName : "N/A", Reg = item.OTER.descript, PrimClinic = item.T1_STM_ClinicalCenter.Name, Titles = item.T1_STM_SurgeonTitle, Phone = item.Phone, Email = item.Email, Address1 = item.Address1, Address2 = item.Address2, City = item.City, State = item.State, Zip = item.Zip, Comments = item.Comments, Active = item.Active, DateEntered = item.DateEntered }) .ToList(); My DEV server has SQL 2008, so the code works just fine. When I moved this code to client's production server - they use SQL 2000, I started getting "Incorrect syntax near '(' ". I've tried changing the ProviderManifestToken to 2000 in my .edmx file, then I started getting "The execution of this query requires the APPLY operator, which is not supported in versions of SQL Server earlier than SQL Server 2005." I tied changing the token to 2005, the "Incorrect syntax near '(' " is back. Can anybody help me to find a workaround for this? Thank you very much in advance!

    Read the article

  • PHP: Three item validation comparison

    - by DavidYell
    I have 3 featured product panels on the homepage, and I'm writing a CMS page for it. I'm trying to validate the items. They are selected via three <select> elements, featured1, featured2 and featured3. The default is <option value="0" selected>Select an element</option> I need to validate the $_POST to ensure that the user hasn't selected the same product for more than one of the panels. I have worked out that each $_POST needs to be $_POST['featuredN'] > 0 but I can't seem to find a logical way of processing the 7 potential outcomes. Using a logic table, where 1 is a set value. 1 2 3 ------- 0 0 0 1 1 1 1 0 0 0 1 0 0 0 1 1 1 0 0 1 1 If an item is 0, then I will not update it, but I want the user to be able to update a single item if needs be. I cannot find a logical way to see if the item is not 0, and then compare it to another item if that also is not 0. So far my colleague suggested, adding up the values. Which works to see if condition 1 0 0 0 is not met. I have a vague feeling that some form of recursive function might be in order, but I can't quite get my brain to help me on this one! So to the collective brain! :)

    Read the article

  • Interpreting item click in ListView

    - by Matt Huggins
    I'm working on my first Android project, and I created a menu via the XML method. My activity is pretty basic, in that it loads the main layout (containing a ListView with my String array of options). Here's the code inside my Activity: public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.main); // allow stuff to happen when a list item is clicked ListView ls = (ListView)findViewById(R.id.menu); ls.setOnItemClickListener(new OnItemClickListener() { @Override public void onItemClick(AdapterView<?> parent, View view, int position, long id) { // @todo } }); } Within the onItemClick callback handler, I'd like to check which item was clicked, and load a new menu based upon that. Question 1: How do I go about figuring out which item was clicked? I can't find any straightforward examples on retrieving/testing the id value of the clicked item. Question 2: Once I have the id value, I assume I can just call the setContentView method again to change to another layout containing my new menu. Is that correct?

    Read the article

  • Parse SyndicationItem to c# class

    - by user285677
    What's the best way to parse the folowing rss Syndication Item into a c# class: <rss version="2.0" xmlns:fh="http://rss.flightstats.com/ns/rss/1.0"> <channel> <title>FlightStats - Lisboa Airport Departures</title> <language>en-us</language> <copyright>Copyright (c) 2007 Conducive Technology Inc. All rights reserved.</copyright> <description>FlightStats is your source for airport and flight information</description> <link>http://www.flightstats.com?utm_source=49e3481552e7c4c9:4e080df5:1281bf8969d:60e0&utm_medium=cpc&utm_campaign=rss</link> <pubDate>Sun, 25 Apr 2010 12:30:14 +0000</pubDate> <lastBuildDate>Sun, 25 Apr 2010 12:30:14 +0000</lastBuildDate> <ttl>15</ttl> <image> <url>http://dem5xqcn61lj8.cloudfront.net/Widgets/images/flightstats_logo_widget.gif</url> <title>FlightStats - Lisboa Airport Departures</title> <link>http://www.flightstats.com?utm_source=49e3481552e7c4c9:4e080df5:1281bf8969d:60e0&utm_medium=cpc&utm_campaign=rss</link> </image> <item> <fh:FlightHistory FlightHistoryId="190011545" DepartureDate="2010-04-25 12:00" ArrivalDate="2010-04-25 14:45" PublishedDepartureDate="2010-04-25 12:00" PublishedArrivalDate="2010-04-25 14:45" ScheduledGateDepartureDate="2010-04-25 12:00" ScheduledGateArrivalDate="2010-04-25 14:45" EstimatedGateArrivalDate="2010-04-25 14:40" ActualRunwayDepartureDate="2010-04-25 12:13" FlightNumber="8461" StatusCode="A" Status="Active" CreatorCode="O" ScheduledBlockTime="105" DepartureAirportTimeZoneOffset="1" ArrivalAirportTimeZoneOffset="2" ScheduledAircraftType="320" DepartureTerminal="T1" ArrivalTerminal="1" TrackingEnabled="False"> <fh:Airline AirlineCode="VY" Name="Vueling Airlines" /> <fh:Origin AirportCode="LIS" Name="Lisboa Airport" City="Lisbon" CountryCode="PT" /> <fh:Destination AirportCode="BCN" Name="Barcelona Airport" City="Barcelona" StateCode="SP" CountryCode="ES" /> </fh:FlightHistory> <guid isPermaLink="false">VY8461LISBCN</guid> <title>VY 8461 LIS-BCN Departed</title> <description> teste </description> <link>http://www.flightstats.com/go/FlightStatus/flightStatusByFlight.do? id=190011545&utm_source=49e3481552e7c4c9:4e080df5:1281bf8969d:60e0&utm_medium=cpc&utm_campaign=rss</link> </item> </channel> </rss>

    Read the article

  • Non-Dom Element Event Binding with jQuery

    - by Rick Strahl
    Yesterday I had a short discussion with Dave Reed on Twitter regarding setting up fake ‘events’ on objects that are hookable. jQuery makes it real easy to bind events on DOM elements and with a little bit of extra work (that I didn’t know about) you can also set up binding to non-DOM element ‘event’ bindings. Assume for a second that you have a simple JavaScript object like this: var item = { sku: "wwhelp" , foo: function() { alert('orginal foo function'); } }; and you want to be notified when the foo function is called. You can use jQuery to bind the handler like this: $(item).bind("foo", function () { alert('foo Hook called'); } ); Binding alone won’t actually cause the handler to be triggered so when you call: item.foo(); you only get the ‘original’ message. In order to fire both the original handler and the bound event hook you have to use the .trigger() function: $(item).trigger("foo"); Now if you do the following complete sequence: var item = { sku: "wwhelp" , foo: function() { alert('orginal foo function'); } }; $(item).bind("foo", function () { alert('foo hook called'); } ); $(item).trigger("foo"); You’ll see the ‘hook’ message first followed by the ‘original’ message fired in succession. In other words, using this mechanism you can hook standard object functions and chain events to them in a way similar to the way you can do with DOM elements. The main difference is that the ‘event’ has to be explicitly triggered in order for this to happen rather than just calling the method directly. .trigger() relies on some internal logic that checks for event bindings on the object (attached via an expando property) which .trigger() searches for in its bound event list. Once the ‘event’ is found it’s called prior to execution of the original function. This is pretty useful as it allows you to create standard JavaScript objects that can act as event handlers and are effectively hookable without having to explicitly override event definitions with JavaScript function handlers. You get all the benefits of jQuery’s event methods including the ability to hook up multiple events to the same handler function and the ability to uniquely identify each specific event instance with post fix string names (ie. .bind("MyEvent.MyName") and .unbind("MyEvent.MyName") to bind MyEvent). Watch out for an .unbind() Bug Note that there appears to be a bug with .unbind() in jQuery that doesn’t reliably unbind an event and results in a elem.removeEventListener is not a function error. The following code demonstrates: var item = { sku: "wwhelp", foo: function () { alert('orginal foo function'); } }; $(item).bind("foo.first", function () { alert('foo hook called'); }); $(item).bind("foo.second", function () { alert('foo hook2 called'); }); $(item).trigger("foo"); setTimeout(function () { $(item).unbind("foo"); // $(item).unbind("foo.first"); // $(item).unbind("foo.second"); $(item).trigger("foo"); }, 3000); The setTimeout call delays the unbinding and is supposed to remove the event binding on the foo function. It fails both with the foo only value (both if assigned only as “foo” or “foo.first/second” as well as when removing both of the postfixed event handlers explicitly. Oddly the following that removes only one of the two handlers works: setTimeout(function () { //$(item).unbind("foo"); $(item).unbind("foo.first"); // $(item).unbind("foo.second"); $(item).trigger("foo"); }, 3000); this actually works which is weird as the code in unbind tries to unbind using a DOM method that doesn’t exist. <shrug> A partial workaround for unbinding all ‘foo’ events is the following: setTimeout(function () { $.event.special.foo = { teardown: function () { alert('teardown'); return true; } }; $(item).unbind("foo"); $(item).trigger("foo"); }, 3000); which is a bit cryptic to say the least but it seems to work more reliably. I can’t take credit for any of this – thanks to Dave Reed and Damien Edwards who pointed out some of these behaviors. I didn’t find any good descriptions of the process so thought it’d be good to write it down here. Hope some of you find this helpful.© Rick Strahl, West Wind Technologies, 2005-2010Posted in jQuery  

    Read the article

  • Probability algorithm: Finding probable correct item in a list (e.g John, John, Jon)

    - by Andrew White
    Hi, Take for example the list (L): John, John, John, John, Jon We are to presume one item is to be correct (e.g. John in this case), and give a probability it is correct. First (and good!) attempt: MostFrequentItem(L).Count / L.Count (e.g. 4/5 or 80% likelihood) But consider the cases: John, John, Jon, Jonny John, John, Jon, Jon I want to consider the likelihood of the correct item being John to be higher in the first list! I know I have to count the SecondMostFrequent Item and compare them. Any ideas? This is really busting my brain! Thx, Andrew

    Read the article

  • Selecting an item in a ListView control ( winforms ) while not having the focus

    - by rahulchandran
    I am trying to mimic the functionality of the address book in Outlook So basically a user starts typing in some text in an edit control and a matching ListView Item is selected private void txtSearchText_TextChanged(object sender, EventArgs e) { ListViewItem lvi = this.listViewContacts.FindItemWithText(this.txtSearchText.Text,true, 0); if (lvi != null) { listViewContacts.Items[lvi.Index].Selected = true; listViewContacts.Select(); } } The problem with this is once the listview item gets selected the user cant keep typing into the text Box. Basically I want a way to highlight an item in the listview while still keeping the focus on the edit control This is WINFORMS 2.0

    Read the article

  • SharePoint Workflow: how to update the item without triggering the workflow again

    - by Philipp Schmid
    I have a SharePoint workflow which is running whenever the item changes. The workflow communicates with an external REST service. If the service returns a string, I want to update one of the field values with that string. Unfortunately, this update will trigger another instance of the workflow for this item once the current workflow terminates. I end up with an infinite loop! How I can prevent this from happening? SPListItem has Update(), UpdateOverwriteVersion(), and SystemUpdate() methods but none of them seem to prevent subsequent workflows from being triggered. I could inspect the last modified timestamp of the item and terminate the workflow if the last update happened within a certain timespan, but I am looking for a more robust solution.

    Read the article

  • VS2010 add-in custom menu item in files of Solution Explorer

    - by NewProgrammer
    Hey guys, I need to create a custom menu item for Visual Studio 2010 Add-in in C#, but I have had no luck in coming with a solution anytime soon. I am aware that there was a similar post: http://stackoverflow.com/questions/2486818/visual-studio-add-in-adding-a-context-menu-item-to-solution-explorer But it did not help, as the blog follows the process through the integration package, and the video is done through VB. I had attempted to convert the VB syntax to the C# syntax, but about half way through the video, the Add-in methods has significantly changed from 2005 to 2010, as some of the methods have removed or changed. Is there any good tutorials on making a custom menu item on the Solution Explorer in the lastest Visual Studio in C#, and is there a good website that could be used as a reference for looking over the VS add-in API? I've used Microsoft's main website, however it is confusing and wordy, which is difficult to understand and find the methods, properties, or commands that I am looking for. Any help would be appreicated, Thanks in advance.

    Read the article

  • Add a link to a JQueryUI autocomplete item

    - by Tordek
    When a user starts typing on the searchbox, the suggestion page returns the latest item from all collections matching that nama, plus other data. I'd like to show that item (along its image), and a link to "see all items from this collection". I can do (most of) that with the following code: $('#search').autocomplete({ source: function (request, response) { $.ajax({ url: suggesturl, dataType: 'json', data: request, success: function (data) { response(data.map(function (value) { return { 'label': '<img src="' + value.thumbsmall + '" />' + value.name + '<a href="/">More items from this collection...</a>', 'value': value.fullname }; })); } }); }, minLength: 3 }) The problem is that, although the link appears in the box, when it's clicked it gets ignored, and the default select action is executed (the item's value is put into the textbox).

    Read the article

  • Jquery UI Sortable - Get the item being sorted.

    - by Smickie
    Hi, When using Jquery UI Sortable (which is great by the way) how do you get the item that is currently being sorted. When you use $(this); it return the actual sortable list, not the current sorted item. I want to do fancy-pants things with the widget when the user is dragging it around. E.g. Animate it when dragging between two lists. So how do I get the current item being sorted? There a little code below just to explain a little more... $(function() { $("#sortable_1").sortable({ start : function(event, ui){ //get current element being sorted }, stop : function(event, ui){ //get current element being sorted } }).disableSelection(); });

    Read the article

  • How to make QCombobox painting item delegate for it's current Item? (Qt 4)

    - by r4nj33t
    QCombobox set Item delegate not painting for current Item.. I am trying to create a combo box showing different line types (Solid, Dotted, Dash etc). Currently i am setting item delegate for its content so as to draw/paint line type instead of displaying names. All line types are drawing currectly but as soon as i am selecting any line type from the combobox, the current index of combo box is displaying just the line name and not painting it. How can i make it paint the selected line type on the current combo box index?

    Read the article

  • Adding an item to an existent window

    - by farhad
    Hello! How can i add an item to an existent window? I tried win.add() but it does not seem to work. Why? This is my piece of code: function combo_service(winTitle,desc,input_param) { /* parametri */ param=input_param.split(","); /* della forma: param[0]="doc1:text", quindi da splittare di nuovo */ /* cosi' non la creo più volte */ win; if (!win) var win = new Ext.Window({ //title:Ext.get('page-title').dom.innerHTML renderTo:Ext.getBody() ,iconCls:'icon-bulb' ,width:420 ,height:240 ,title:winTitle ,border:false ,layout:'fit' ,items:[{ // form as the only item in window xtype:'form' ,labelWidth:60 ,html:desc ,frame:true ,items:[{ // textfield fieldLabel:desc ,xtype:'textfield' ,anchor:'-18' }] }] }); win.add({ // form as the only item in window xtype:'form' ,labelWidth:60 ,html:desc ,frame:true ,items:[{ // textfield fieldLabel:desc ,xtype:'textfield' ,anchor:'-18' }]}); win.show(); }; What's wrong with my code? Thank you very much.

    Read the article

  • Flex: Get an item from a AdvancedDataGrid given an index

    - by David Wolever
    I've got a subclass of AdvancedDataGrid showing a tree-like data structure. How can I, given the index returned by calculateDropIndex, get the item at that index? After reading through reams of code, it seems like the least terrible way is: var oldSelectedIndex:int = this.selectedIndex; var mouseOverIndex:int = this.calculateDropIndex(event); this.selectedItem = mouseOverIndex; var item:* = this.selectedItem; this.selectedIndex = oldSelectedIndex; The other option seems to be tinkering around with the iterator property... But, judging by the way I've seen it used, that will get pretty harry pretty quickly too. So, how can I get the item at a particular index in an advanced datagrid without going insane?

    Read the article

  • ExtJS: adding an item to an existent window

    - by farhad
    Hello! How can i add an item to an existent window? I tried win.add() but it does not seem to work. Why? This is my piece of code: function combo_service(winTitle,desc,input_param) { /* parametri */ param=input_param.split(","); /* della forma: param[0]="doc1:text", quindi da splittare di nuovo */ /* cosi' non la creo più volte */ win; if (!win) var win = new Ext.Window({ //title:Ext.get('page-title').dom.innerHTML renderTo:Ext.getBody() ,iconCls:'icon-bulb' ,width:420 ,height:240 ,title:winTitle ,border:false ,layout:'fit' ,items:[{ // form as the only item in window xtype:'form' ,labelWidth:60 ,html:desc ,frame:true ,items:[{ // textfield fieldLabel:desc ,xtype:'textfield' ,anchor:'-18' }] }] }); win.add({ // form as the only item in window xtype:'form' ,labelWidth:60 ,html:desc ,frame:true ,items:[{ // textfield fieldLabel:desc ,xtype:'textfield' ,anchor:'-18' }]}); win.show(); }; What's wrong with my code? Thank you very much.

    Read the article

  • check item in popupmenu

    - by alex-gu
    i call popumemu(list of checkboxes in another program) using code like: PostMessage(Wnd,WM_RBUTTONDOWN,0,0x0); PostMessage(Wnd,WM_RBUTTONUP,0,0x0); and i can get the HWND of popupmenu window how to check(uncheck) item at certain item? without sending code SendMessage( TMP,WM_KEYDOWN, VK_DOWN, 0); SendMessage( TMP,WM_KEYUP, VK_DOWN, 0); SendMessage( TMP,WM_KEYDOWN, VK_RETURN, 0); SendMessage( TMP,WM_KEYUP, VK_RETURN, 0); or there is another way to call popupmenu and check its item?

    Read the article

  • Clean Up Controller, Update Item Quantity within Cart

    - by Karl Entwistle
    Hi guys I was wondering if anyone could help me out, I need to clean up this controller as the resulting code to simply update an items quantity if it already exists seems way too complex. class LineItemsController < ApplicationController def create @product = Product.find(params[:product_id]) if LineItem.exists?(:cart_id => current_cart.id) item = LineItem.find(:first, :conditions => [ "cart_id = #{@current_cart.id}"]) LineItem.update(item.id, :quantity => item.quantity + 1) else @line_item = LineItem.create!(:cart => current_cart, :product => @product, :quantity => 1, :unit_price => @product.price) flash[:notice] = "Added #{@product.name} to cart." end redirect_to root_url end end ` As always any help is much appreciated, the code should be fairly self explanatory, thanks :) PS posted it here as well as it looks a bit funny on here http://pastie.org/994059

    Read the article

  • PowerShell copy fails without warning

    - by boink
    Howdy, am trying to copy a file from IE cache to somewhere else. This works on w7, but not Vista Ultimate. In short: copy-item $f -Destination "$targetDir" -force (I also tried $f.fullname) The full script: $targetDir = "C:\temp" $ieCache=(get-itemproperty "hkcu:\Software\Microsoft\Windows\CurrentVersion\Explorer\User Shell Folders").cache $minSize = 5mb Write-Host "minSize:" $minSize Add-Content -Encoding Unicode -Path $targetDir"\log.txt" -Value (get-Date) Set-Location $ieCache #\Low\Content.IE5 for protected mode #\content.ie5 for unprotected $a = Get-Location foreach ($f in (get-childitem -Recurse -Force -Exclude *.dat, *.tmp | where {$_.length -gt $minSize}) ) { Write-Host (get-Date) $f.Name $f.length Add-Content -Encoding Unicode -Path $targetDir"\log.txt" -Value $f.name, $f.length copy-item $f -Destination "$targetDir" -force } End of wisdom. Please help!

    Read the article

  • better way of handling nested list

    - by laspal
    Hi, I have list my_list = [ [1,2,3,4,5,6], [1,3,4],[34,56,56,56]] for item in my_list: var1,var2,var3,var4,var5,var6 = None if len(item) ==1: var1 = item[0] if len(item) == 2: var1 = item[0] var2 = item[1] if len(item) == 3: var1 = item[0] var2 = item[1] var3 = item[2] if len(item) == 4: var1 = item[0] var2 = item[1] var3 = item[2] var4 = item[3] fun(var1,var2,var3,var4,var5,var6) I have a function def fun(var1, var2 = None, var3 = None, var4 = None, var5=None, var6= None) Depending upon the values in my inner list. I am passing it to function. I hope I made it clear. Thanks

    Read the article

  • Selecting an item in an HTML SELECT list using keyboard doesnt trigger the CLICK event

    - by Jimbo
    I have an HTML select list which, when an item is selected, must show different information beneath it. The onclick or JQuery change events are triggered when a select list item is selected by being clicked on (mouse), but not when the user uses key presses (keyboard). Any idea what event to watch in order to determine when the selected list item has changed? Here is a BASIC test example: <select id="mylist" name="mylist"> <option value="">(none)</option> <option value="1">Test 1</option> <option value="2">Test 2</option> <option value="3">Test 3</option> </select> <span id="myspan"></span> <script type="text/javascript"> $("#mylist").change(function() { $("#myspan").html($("#mylist").attr("selectedIndex")); }); </script>

    Read the article

  • Do you allow check-ins associated with work items from another Team Project?

    - by muerte
    Team Foundation Server 2008 allows that every check-in is associated with a work item, but what do you do if you are developing some features which span several Team Projects? For example, you're developing a specific product for a client and that product has its own Team Project, but is also using some of your other components or tools which are maintained independently in another Team Project. Where do you create work items for requirements which involve a change in both projects? Separated, every work item in its own Team Projects All work items in clients Team Project, regardless of associated source code The latter seems easier to maintain and control, but it involves associating check-ins from one Team Project to work items in another.

    Read the article

  • jQuery - getting the id of the item selected

    - by John Leonard
    I have a basic jQuery selector question. Let's say I'm parsing JSON and generating a row of data for each item in my result set. On each item row, I want an action button. What is the best practice to script that button so its click action can reference the data specific to that row? Starting with the block below, how do I generate a 'Click Me' button that when clicked will alert with its json data? $.getJSON(url,params,function(json){ if(json.items){ $.each(json.items, function(i, n){ var item = json.items[i];

    Read the article

  • Combobox select item in dropdown list C#

    - by Willem T
    I have an combobox poppulated with items from a database table. When I change the text i repopulate the combobox with items from the database table. But when I enter text and the list with suggestions opens no item in de list is selected. And i want a item to be selected so when you press enter that it becomes the selected item. This is a winforms application. Thanks. cbxNaam.Items.Clear(); string query = "SELECT bedr_naam FROM tblbedrijf WHERE bedr_naam LIKE '%" + cbxNaam.Text + "%'"; string[] bedrijfsnamen = Functions.DataTableToArray(Global.db.Select(query)); cbxNaam.Items.AddRange(bedrijfsnamen); cbxNaam.Select(cbxNaam.Text.Length + 1, 0);

    Read the article

  • Create link to Sitecore Item

    - by Zooking
    I know I have done this before but I can't seem to remember where or how. I want to create a link to an Item in Sitecore. This code: Sitecore.Data.Items.Item itm = Sitecore.Context.Database.GetItem(someID); return itm.Paths.Path.ToString(); Produces the following string: http://localhost/sitecore/content/Home/Item1/Item11/thisItem I would like to have this string instead: http://localhost/Item1/Item11/thisItem.aspx What is the correct way to get the path to the item? In this case I can't use a normal Sitecore link: Sitecore.Web.UI.WebControls.Link

    Read the article

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