Search Results

Search found 2030 results on 82 pages for 'params'.

Page 4/82 | < Previous Page | 1 2 3 4 5 6 7 8 9 10 11 12  | Next Page >

  • Is the order of params important in NHibernate?

    - by Blake Blackwell
    If I have an int parameter followed by a string parameter in a sproc I get the following error: Input string was not in the correct format However, if I switch those parameters in the sproc than I get the result set I expect. Are params sorted by data type, or do I have to do anything special in my config file? I've included my code for reference: Config File <?xml version="1.0" encoding="utf-8" ?> <hibernate-mapping xmlns="urn:nhibernate-mapping-2.2" assembly="NHibernateDemo" namespace="NHibernateDemo.Domain"> <class name="Blake_Test" table="Blake_Test"> <id name="TestId" column="TESTID"></id> <property name="TestName" column="TESTNAME" /> <loader query-ref="GetBlakeTest"/> </class> <sql-query name="GetBlakeTest" callable="true"> <return class="Blake_Test" /> call procedure AREA51.NHIBERNATE_TEST.GetBlakeTest(:int_TestId, :vch_TestName) </sql-query> </hibernate-mapping> Sproc Code: PROCEDURE GetBlakeTest ( ret_cursor OUT SYS_REFCURSOR, int_testid integer, vch_testname varchar2 ) AS BEGIN OPEN ret_cursor FOR SELECT TestId, TestName FROM blake_test WHERE testid = int_testid ORDER BY TestName DESC; END GetBlakeTest; END NHIBERNATE_TEST; Executing Code: IQuery query1 = session.GetNamedQuery( "GetBlakeTest" ); query1.SetParameter( "int_TestId", 1 ); query1.SetParameter( "vch_TestName", "TEST" ); IList<Blake_Test> mystuff = query1.List<Blake_Test>();

    Read the article

  • How Do I Prevent Rails From Treating Updated Nested Attributes Differently From New Nested Attribute

    - by James
    I am using rails3 beta3 and couchdb via couchrest. I am not using active record. I want to add multiple "Sections" to a "Guide" and add and remove sections dynamically via a little javascript. I have looked at all the screencasts by Ryan Bates and they have helped immensely. The only difference is that I want to save all the sections as an array of sections instead of individual sections. Basically like this: "sections" => [{"title" => "Foo1", "content" => "Bar1"}, {"title" => "Foo2", "content" => "Bar2"}] So, basically I need the params hash to look like that when the form is submitted. When I create my form I am doing the following: <%= form_for @guide, :url => { :action => "create" } do |f| %> <%= render :partial => 'section', :collection => @guide.sections %> <%= f.submit "Save" %> <% end %> And my section partial looks like this: <%= fields_for "sections[]", section do |guide_section_form| %> <%= guide_section_form.text_field :section_title %> <%= guide_section_form.text_area :content, :rows => 3 %> <% end %> Ok, so when I create the guide with sections, it is working perfectly as I would like. The params hash is giving me a sections array just like I would want. The problem comes when I want edit guide/sections and save them again because rails is inserting the id of the guide in the id and name of each form field, which is screwing up the params hash on form submission. Just to be clear, here is the raw form output for a new resource: <input type="text" size="30" name="sections[][section_title]" id="sections__section_title"> <textarea rows="3" name="sections[][content]" id="sections__content" cols="40"></textarea> And here is what it looks like when editing an existing resource: <input type="text" value="Foo1" size="30" name="sections[cd2f2759895b5ae6cb7946def0b321f1][section_title]" id="sections_cd2f2759895b5ae6cb7946def0b321f1_section_title"> <textarea rows="3" name="sections[cd2f2759895b5ae6cb7946def0b321f1][content]" id="sections_cd2f2759895b5ae6cb7946def0b321f1_content" cols="40">Bar1</textarea> How do I force rails to always use the new resource behavior and not automatically add the id to the name and value. Do I have to create a custom form builder? Is there some other trick I can do to prevent rails from putting the id of the guide in there? I have tried a bunch of stuff and nothing is working. Thanks in advance!

    Read the article

  • How Do I Prevent Rails From Treating Edit Fields_For Differently From New Fields_For

    - by James
    I am using rails3 beta3 and couchdb via couchrest. I am not using active record. I want to add multiple "Sections" to a "Guide" and add and remove sections dynamically via a little javascript. I have looked at all the screencasts by Ryan Bates and they have helped immensely. The only difference is that I want to save all the sections as an array of sections instead of individual sections. Basically like this: "sections" => [{"title" => "Foo1", "content" => "Bar1"}, {"title" => "Foo2", "content" => "Bar2"}] So, basically I need the params hash to look like that when the form is submitted. When I create my form I am doing the following: <%= form_for @guide, :url => { :action => "create" } do |f| %> <%= render :partial => 'section', :collection => @guide.sections %> <%= f.submit "Save" %> <% end %> And my section partial looks like this: <%= fields_for "sections[]", section do |guide_section_form| %> <%= guide_section_form.text_field :section_title %> <%= guide_section_form.text_area :content, :rows => 3 %> <% end %> Ok, so when I create the guide with sections, it is working perfectly as I would like. The params hash is giving me a sections array just like I would want. The problem comes when I want edit guide/sections and save them again because rails is inserting the id of the guide in the id and name of each form field, which is screwing up the params hash on form submission. Just to be clear, here is the raw form output for a new resource: <input type="text" size="30" name="sections[][section_title]" id="sections__section_title"> <textarea rows="3" name="sections[][content]" id="sections__content" cols="40"></textarea> And here is what it looks like when editing an existing resource: <input type="text" value="Foo1" size="30" name="sections[cd2f2759895b5ae6cb7946def0b321f1][section_title]" id="sections_cd2f2759895b5ae6cb7946def0b321f1_section_title"> <textarea rows="3" name="sections[cd2f2759895b5ae6cb7946def0b321f1][content]" id="sections_cd2f2759895b5ae6cb7946def0b321f1_content" cols="40">Bar1</textarea> How do I force rails to always use the new resource behavior and not automatically add the id to the name and value. Do I have to create a custom form builder? Is there some other trick I can do to prevent rails from putting the id of the guide in there? I have tried a bunch of stuff and nothing is working. Thanks in advance!

    Read the article

  • ASP.NET MVC Pass mutiple params from getJson to controller

    - by andyJ
    Hi, I am making a call to a controller action in javascript using the getJson method. I need to pass two parameters to my action method on the controller, but I am struggling to do so. I do not fully understand the routing tables and not sure if this is what I need to use to get this working. Please see example below of what I am trying to do. var action = "<%=Url.Content('~/Postcode/GetAddressResults/')%>" + $get("Premise").value + "/" + $get("SearchPostcode").value $.getJSON(action, null, function(data) { $("#AddressDropDown").fillSelect(data); }); This is my route which I don't understand how to make use of... routes.MapRoute( "postcode", "Postcode/GetAddressResults/{premise}/{postcode}", new { controller = "Motor", action = "GetAddressResults", premise = "", postcode = "" });

    Read the article

  • java Filter URL pattern specific to request params

    - by Rohit Desai
    Hi All, We have a situation where we want to use filter for URL's containing some specific request parameters. e.g htt://mydomain.com/?id=78&formtype=simple_form&....... htt://mydomain.com/?id=788&formtype=special_form&....... and so on , id are fetched at run time, I want configure filter in web.xml only if formtype=special_form. How should achieve the solution . Can filter be configure with regex patterns? Really appreciate your help on this. Thanks, Rohit

    Read the article

  • Add params to given URL in Python

    - by z4y4ts
    Suppose I was given by some URL. Is might already have GET parameters (e.g. http://stackoverflow.com/search?q=question) or not (e.g. http://stackoverflow.com/). And now I need to add some parameters to it like {'lang':'en','tag':'python'} so in first case I'll have http://stackoverflow.com/search?q=question&lang=en&tag=python and in second — http://stackoverflow.com/search?lang=en&tag=python. Is there any standard way to do this?

    Read the article

  • jQuery Flow Control (if then from URL params)

    - by Ryan Max
    Strangely enough I am more familiar with jQuery than I am with javascript. I need to be able to add a class to the body tag of a document depending on what specific forum page i'm on in a phpbb forum. Due to the nature of phpbb I can't actually do this flow control in php, so I am using jquery. Here's my code (the first part is an extend that gets the url parameters like so http://www.mysite.com/viewforum.php?f=3 var forum = $.getUrlVar('f'); will make forum == 3 because of the nature of phpbb i can't really do any flow control with php. So I am using jquery. This is my code: $(document).ready(function(){ $.extend({ getUrlVars: function(){ var vars = [], hash; var hashes = window.location.href.slice(window.location.href.indexOf('?') + 1).split('&'); for(var i = 0; i < hashes.length; i++) { hash = hashes[i].split('='); vars.push(hash[0]); vars[hash[0]] = hash[1]; } return vars; }, getUrlVar: function(name){ return $.getUrlVars()[name]; } }); }); $(document).ready(function(){ var forum = $.getUrlVar('f'); if (forum == 3){ $('body').toggleClass('black'); } }); Yet this isn't working. Any idea why not?

    Read the article

  • Parse params from an sql query using delphi

    - by Salvador
    How i can parse and extract the parameters from an SQL Query using delphi? example : from this query SELECT * FROM MyTable WHERE Field1=:Param1 AND Field2=:Param2 AND (Field3=:Param3 OR Field4=:Param4) i want to obtain Param1 Param2 Param3 Param4 Thanks in advance.

    Read the article

  • Search by price interval in currency and other params using Searchlogic

    - by alexandr
    Hi I need to reaqlize search in product model with prices in different currencies (price and currecny_id field). Every currency have own rate. When user search for product in price range [x, y] USD, range must be converted to all currencies and return values like (price > from_eur AND price < to_eur AND currecny_id = 1) OR (price > from_aud AND price < to_aud AND currecny_id = 2) How to realize search like this using searchlogic?

    Read the article

  • problems with build params for accepts_nested_attributes_for

    - by holden
    I'm trying to add the user_id to a nested attribute that gets built by a parent controller but it doesn't seem to have the desired effect? Ie. I have a model called Place.rb which accepts_nested_attributes_for :reviews The nested attribute works fine and I build it inside the Places controller like so... @review = @place.reviews.build(:user_id => current_user.id) I was previously adding the user thru the form, but would like to do it thru the controller so that it only adds the user_id on creation, as it might get updated by someone else and i don't want the update changing the user_id... old way which works: <%= e.label :content, "Review" %><br /> <%= e.text_area :content, :rows => 20, :class => 'jquery_ckeditor' %><br /> <%= e.hidden_field :user_id, :value => current_user.id %> but thru the controller the build method with options has no effect? Any ideas? Can I not do this thru the build?

    Read the article

  • Doctrine DQL execute passing params

    - by Karim web Developer
    I used this DQL in Doctrine $q->update('product') ->set('quantity','?') ->where('id=?'); $q->execute(array(20,5)); I check the server for the query and this the generated sql UPDATE product SET quantity = '20', updated_at = '5' WHERE (id = '2010-04-26 14:34); So I need to know why the arguments aren't in the correct places?

    Read the article

  • Rails: link_to with block and GET params?

    - by bobthabuilda
    How can I achieve query string and URL parameters in a link_to block declaration? Right now, I have this, which works: <%= link_to 'Edit', :edit, :type => 'book', :id => book %> The above works, and outputs: http://localhost:3000/books/edit/1?type=book What I want to do is something like this: <% link_to :edit, :type => 'book', :id => book do %> ... <% end %> But the above format outputs: http://localhost:3000/books/edit/ Which isn't what I'm looking for... I want it to output a URL like the previous example. How can I achieve this?

    Read the article

  • executing named_scoped only when there are present params

    - by Luca Romagnoli
    Hi have a model like this: class EventDate < ActiveRecord::Base belongs_to :event named_scope :named, lambda { | name | { :joins => { :event => :core}, :conditions => ["name like ?", "%#{ name }%"] }} named_scope :date_range, lambda { | start, length | { :conditions => ["day >= ? AND day <= ?", start, date + (length || 30) ] }} it works correctly if i launch name = "ba" start = Date.today EventDate.named(name).date_range(start , start + 2) But if the name or the start is nil i don't want execute the named_scope like name = nil EventDate.named(name).date_range(start , start + 2) Is possible to set a condition inner the named_scope ? thanks

    Read the article

  • passing request params from jQuery to jersey service using json

    - by ccduga
    hi, im trying to POST (cross domain) some data to a jersey web service and retrieve a response (a GenericEntity object). The post successfully gets mapped to my jersey endpoint however when i pull the parameters from the request they are empty.. $ .ajax({ type: "POST", dataType: "application/json; charset=utf-8", url: jerseyNewUserUrl+'?jsoncallback=?', data:{'id':id, 'firstname':firstname,'lastname':lastname}, success: function(data, textStatus) { $('#jsonResult').html("some data: " + data.responseMsg); }, error: function ( XMLHttpRequest, textStatus, errorThrown){ alert('error'); } }); this is my jersey endpoint.. @POST @Produces( { "application/x-javascript", MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML }) @Path("/new") public JSONWithPadding addNewUser(@QueryParam("jsoncallback") @DefaultValue("empty") final String argJsonCallback, @QueryParam("id") final String argID, @QueryParam("firstname") final String argFirstName, @QueryParam("lastname") final String argLastName) is there something missing from my $.ajax call?

    Read the article

  • Perl Hash Slice, Replication x Operator, and sub params

    - by user210757
    Ok, I understand perl hash slices, and the "x" operator in Perl, but can someone explain the following code example from here (slightly simplified)? sub test{ my %hash; @hash{@_} = (undef) x @_; } Example Call to sub: test('one', 'two', 'three'); This line is what throws me: @hash{@_} = (undef) x @_; It is creating a hash where the keys are the parameters to the sub and initializing to undef, so: %hash: 'one' = undef, 'two' = undef, 'three' = undef The rvalue of the x operator should be a number; how is it that @_ is interpreted as the length of the sub's parameter array? I would expect you'd at least have to do this: @hash{@_} = (undef) x length(@_);

    Read the article

  • Can't get a SQL command to recognise the params added

    - by littlechris
    Hi, I've not used basic SQL commands for a while and I'm trying to pass a param to a sproc and the run it. However when I run the code I get a "Not Supplied" error. Code: SqlConnection conn1 = new SqlConnection(DAL.getConnectionStr()); SqlCommand cmd1 = new SqlCommand("SProc_Item_GetByID", conn1); cmd1.Parameters.Add(new SqlParameter("@ID", itemId)); conn1.Open(); cmd1.ExecuteNonQuery(); I'm not really sure why this would fail. Apologies for the basic question, but I'm lost! Thanks in advance.

    Read the article

  • Sending changing params through periodically_call_remote

    - by seaneshbaugh
    I'm using periodically_call_remote to update a portion of a page that contains a list of objects. I send along with the url a param containing the created_at date for the most recent object in the database. The action that is called then get all the objects that have been created since then and renders a partial which displays them at the top of the list. The problem is that I can't seem to figure out how to make it so that the next time periodically_call_remote triggers it sends along the created_at date for the new most recent object (if there is one). I tried putting the periodically_call_remote inside the partial that is being rendered but that caused all sorts of problems (http://www.ruby-forum.com/topic/101614 explains why you shouldn't do that). Is there some way I can make periodically_call_remote send along a new param each time it's called? As it stands right now it just sends the same one over and over which means that new objects get rendered more than once.

    Read the article

  • Sending url params and POST body to a MVC 2 Controller

    - by Luiggi
    Hi, I'm having some issues trying to make a HTTP PUT (or POST) using WebClient against a MVC 2 controller. The exception is: The parameters dictionary contains a null entry for parameter 'total' of non-nullable type 'System.Int32' for method 'System.Web.Mvc.ActionResult Company(System.Guid, Int32, Int32, System.String)' The controller action is: [HttpPut] public ActionResult Company(Guid uid, int id, int total, string url) The route is: routes.MapRoute( "CompanySet", "job/active/{uid}/company/{id}", new { controller = "Job", action = "Company" } ); As you may see, what I want is to send the 'uid' and 'id' parameters via url, but the 'total' and 'url' parameters as part of the PUT or POST body. I've also tried to merge the latter parameters into a class (i.e., CompanySetMessage), doing it no longer raises an exception but I dont receive the values on the server side. Any ideas? Thank you!

    Read the article

  • SQL IF ELSE with output params stored proc help

    - by Kettenbach
    Hi All, I have a stored proc (SS2008) that takes a couple int ids and needs to look up if they exist in a table before adding a record. I have an int output param I would like to return and set its value based on what occrured. I have this so far, but it always returns 1. Can someone point me in the right direction? BEGIN TRY IF EXISTS ( SELECT * FROM tbMap WHERE (cId= @CId) ) SET @result = -1; -- This C User is already mapped ELSE IF EXISTS ( SELECT * FROM tbMap WHERE (dId = @DId) ) SET @result = -2; -- This D User is already mapped ELSE INSERT INTO tbMap ( Login , Email , UserName , CId , DId) SELECT @UserName , usr.EmailAddress , usr.UserName , @CId , @DId FROM tbUser usr WHERE usr.iUserID = @DId SET @result = 1; RETURN END TRY What am I missing? Thanks for any tips. Cheers, ~ck in San Diego

    Read the article

  • Startup params for Silverlight 4 app

    - by Number8
    Hello -- We are moving our SL3 app to SL4. First step was to open it in VS2010; it converted w/o problem. However, parameters specified for the start page are not passed along. That is, if we specify ourStartPage.aspx?Slam=Dunk&Glass=Sun in app.xaml.cs, Application_Startup(), e.InitParams is empty. How do we fix this? Thanks for any advice.... (Note that the very same startup string worked in VS2008.)

    Read the article

  • Ruby and jQuery -- $(document).ajaxSend() not modifying the params as expected

    - by Jason
    I cannot get jquery's ajaxSend (http://api.jquery.com/ajaxSend/) to properly modify the parameters. I have: $(document).ajaxSend(function(event, request, settings) { settings.data = $.deparam(settings.data); settings.data['random'] = new Date().getTime(); settings.data['_method'] = 'get'; settings.data = $.param(settings.data) $.log(settings); }); $(document).ready(function() { //...snip... $.ajaxSetup({ data : { remote : 1, authenticity_token : encodeURIComponent(AUTH_TOKEN) } }); }); The idea here is that we always want 4 param sent across: remote and auth_token always get set properly. However, random and _method (both needed for IE issues) do not get set. Logging settings inside ajaxSend shows me that they are set to settings.data: "remote=1&authenticity_token=6GA9R_snip_253D&random=1270584905846&_method=get" but when it gets sent across the wire, I only have the following: authenticity_token 6GA9R_snip_253D remote 1 Why in the world is this not working?

    Read the article

  • Can't get a SQlcommand to recognise the params added

    - by littlechris
    Hi, I've not used basic SQLCommands for a while and I'm trying to pass a param to a sproc and the run it. However when I run the code I get a "Not Supplied" error. Code: SqlConnection conn1 = new SqlConnection(DAL.getConnectionStr()); SqlCommand cmd1 = new SqlCommand("SProc_Item_GetByID", conn1); cmd1.Parameters.Add(new SqlParameter("@ID", itemId)); conn1.Open(); cmd1.ExecuteNonQuery(); I'm not really sure why this would fail. Apologies for the basic question, but I'm lost! Thanks in advance.

    Read the article

< Previous Page | 1 2 3 4 5 6 7 8 9 10 11 12  | Next Page >