Search Results

Search found 9087 results on 364 pages for 'strong parameters'.

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

  • Oracle: show parameters on error

    - by llappall
    When Oracle logs a parameterized SQL query failing, it shows "?" in place of the parameters, i.e. the query before replacing parameters. For example, "SELECT * FROM table where col like '?'" SQL state [99999]; error code [29902]; ORA-29902: error in executing ODCIIndexStart() routine ORA-20000: Oracle Text error: DRG-50901: text query parser syntax error on line 1, column 48 Is there a way to change logging so it shows the parameter values? The information above is absolutely useless unless I can see what the actual parsing problem was. In general, is there a way to set logs in Oracle to show parameters in parameterized query errors?

    Read the article

  • How to use prepared statements (named parameters) on a php Class

    - by Mohamed Adib Errifai
    This is my first post here. I've searched in the site, but inforutunaly no matchs. Anyway, i want to know how to use named parameters on a class. so the pdo basic form is something like. $query = $bdd->prepare('SELECT * FROM table WHERE login = :login AND pww = :pww'); $query->execute(array('login' => $login, 'pww' => $pww)); and i want to integrate this on a class regardless of the number of parameters. Currently, i have this code http://pastebin.com/kKgSkaKt and for parameters, i use somethings like ( which is wrong and vulnerable to injection ) require_once 'classes/Mysql.class.php'; $mysql = new Mysql(); $sql = 'SELECT * FROM articles WHERE id = '.$_GET['id'].' LIMIT 1'; $data = $mysql->select($sql); And Thanks.

    Read the article

  • Default Parameters vs Method Overloading

    - by João Angelo
    With default parameters introduced in C# 4.0 one might be tempted to abandon the old approach of providing method overloads to simulate default parameters. However, you must take in consideration that both techniques are not interchangeable since they show different behaviors in certain scenarios. For me the most relevant difference is that default parameters are a compile time feature while method overloading is a runtime feature. To illustrate these concepts let’s take a look at a complete, although a bit long, example. What you need to retain from the example is that static method Foo uses method overloading while static method Bar uses C# 4.0 default parameters. static void CreateCallerAssembly(string name) { // Caller class - Invokes Example.Foo() and Example.Bar() string callerCode = String.Concat( "using System;", "public class Caller", "{", " public void Print()", " {", " Console.WriteLine(Example.Foo());", " Console.WriteLine(Example.Bar());", " }", "}"); var parameters = new CompilerParameters(new[] { "system.dll", "Common.dll" }, name); new CSharpCodeProvider().CompileAssemblyFromSource(parameters, callerCode); } static void Main() { // Example class - Foo uses overloading while Bar uses C# 4.0 default parameters string exampleCode = String.Concat( "using System;", "public class Example", "{{", " public static string Foo() {{ return Foo(\"{0}\"); }}", " public static string Foo(string key) {{ return \"FOO-\" + key; }}", " public static string Bar(string key = \"{0}\") {{ return \"BAR-\" + key; }}", "}}"); var compiler = new CSharpCodeProvider(); var parameters = new CompilerParameters(new[] { "system.dll" }, "Common.dll"); // Build Common.dll with default value of "V1" compiler.CompileAssemblyFromSource(parameters, String.Format(exampleCode, "V1")); // Caller1 built against Common.dll that uses a default of "V1" CreateCallerAssembly("Caller1.dll"); // Rebuild Common.dll with default value of "V2" compiler.CompileAssemblyFromSource(parameters, String.Format(exampleCode, "V2")); // Caller2 built against Common.dll that uses a default of "V2" CreateCallerAssembly("Caller2.dll"); dynamic caller1 = Assembly.LoadFrom("Caller1.dll").CreateInstance("Caller"); dynamic caller2 = Assembly.LoadFrom("Caller2.dll").CreateInstance("Caller"); Console.WriteLine("Caller1.dll:"); caller1.Print(); Console.WriteLine("Caller2.dll:"); caller2.Print(); } And if you run this code you will get the following output: // Caller1.dll: // FOO-V2 // BAR-V1 // Caller2.dll: // FOO-V2 // BAR-V2 You see that even though Caller1.dll runs against the current Common.dll assembly where method Bar defines a default value of “V2″ the output show us the default value defined at the time Caller1.dll compiled against the first version of Common.dll. This happens because the compiler will copy the current default value to each method call, much in the same way a constant value (const keyword) is copied to a calling assembly and changes to it’s value will only be reflected if you rebuild the calling assembly again. The use of default parameters is also discouraged by Microsoft in public API’s as stated in (CA1026: Default parameters should not be used) code analysis rule.

    Read the article

  • Conventions for order of parameters in a function

    - by Andy
    In writing functions my brain always spends a few milliseconds to check which order of parameters would be best for a given function. should I write: public Comment AddComment(long userID, string title, string text) Or probably: public Comment AddComment(string title, string text, long userID) Why not: public Comment AddComment(string title, long userID, string text) Do you follow any rules when ordering the parameters for your functions? Which parameter would you place first and which would follow?

    Read the article

  • Ruby on Rails POST parameters on redirect_to

    - by Splashlin
    I have to make a call to a different url in one of my controllers on my site. The problem is that with all the parameters the other site requires I'm overflowing the url. Is there anyway to call another url from the controller and send all of the parameters using a POST? I'm not expecting a response from the other site. Also, I think there's a way to do this using the Net::HTTP library thought I'm not sure how. Thanks

    Read the article

  • Send parameters to a web service.

    - by Alejandra Meraz
    Before I start: I'm programming for Iphone, using objective C. I have already implemented a call to a web service function using NSURLRequest and NSURLConnection. The function then returns a XML with the info I need. The code is as follows: NSURL *url = [NSURL URLWithString:@"http://myWebService/function"]; NSMutableURLRequest theRequest = [[NSMutableURLRequest alloc] initWithURL:url]; NSURLConnection theConnection = [[NSURLConnection alloc] initWithRequest:theRequest delegate:self]; i also implemented the methods didRecieveResponse didRecieveAuthenticationChallenge didRecievedData didFailWithError connectionDidFinishLoading. And it works perfectly. Now I need to send 2 parameters to the function: "location" and "module". I tried using the following modification: NSMutableURLRequest theRequest = [[NSMutableURLRequest alloc] initWithURL:url]; [theRequest setValue:@"USA" forHTTPHeaderField:@"location"]; [theRequest setValue:@"DEVELOPMENT" forHTTPHeaderField:@"module"]; NSURLConnection theConnection = [[NSURLConnection alloc] initWithRequest:theRequest delegate:self]; But it doesn't seem to work. I'm doing something wrong? is there a way to know if I'm using the wrong names for the parameters (as maybe it is "Location" or "LOCATION" or it doesn't matter?)? or a way to know which parameters is the function waiting for... Extra info: I don't have access to the source of the web service so I can't modify it. But I can access the WSDL. The person who made the function say is all there... but I can't make any sense of it .< Any help would be appreciated. :)

    Read the article

  • Reporting Services 2005 - Parameter reliant on cascading parameters

    - by sHr0oMaN
    Good day I have the following: In a SSRS 2005 report I have three report parameters: FinancialPeriodType ("Month" or "Week" in a DropDownList), FinancialPeriod (cascading DropDownList populated depending on first selection) and another parameter, OpeningBalance, of type float. The first two parameters are cascading i.e. the first parameter is used by the query populating the second's available values. This works fine. What I'm attemping to do is default the value of OpeningBalance to a value from a dataset populated by a stored procedure which takes in the first two parameters. However as soon as I select a value for the first parameter, I get the following error: An error occurred during report processing. The value for the report parameter 'OpeningBalance' is not valid for its type.' I've tried setting the default of the second parameter to be a meaningful default (something like 200901) as well as defaulting the second parameter in the SQL store procedure with no affect. Using SQL Profiler I've noticed that selecting a value for the first parameter doesn't even execute the SQL used to obtain available values for the second parameter.

    Read the article

  • What's wrong with output parameters?

    - by Chris McCall
    Both in SQL and C#, I've never really liked output parameters. I never passed parameters ByRef in VB6, either. Something about counting on side effects to get something done just bothers me. I know they're a way around not being able to return multiple results from a function, but a rowset in SQL or a complex datatype in C# and VB work just as well, and seem more self-documenting to me. Is there something wrong with my thinking, or are there resources from authoritative sources that back me up? What's your personal take on this and why? What can I say to colleagues that want to design with output parameters that might convince them to use different structures? EDIT: interesting turn- the output parameter I was asking this question about was used in place of a return value. When the return value is "ERROR", the caller is supposed to handle it as an exception. I was doing that but not pleased with the idea. A coworker wasn't informed of the need to handle this condition and as a result, a great deal of money was lost as the procedure failed silently!

    Read the article

  • Passing multiple parameters in an MVC Ajax.ActionLink

    - by mwright
    I am using an Ajax.ActionLink to call an Action in a Controller, nothing special there. I want to pass two parameters to the Action. Is this possible using an Ajax.ActionLink? I thought that it would just be a matter of including multiple values in the AjaxOptions: <%= Ajax.ActionLink("Link Text", "ActionName", "ControllerName", new { firstParameter = firstValueToPass, secondParameter = secondValueToPass }, new AjaxOptions{ UpdateTargetId = "updateTargetId"} )%> Is it possible to pass multiple parameters? Where is a good place to learn more about the AjaxOptions?

    Read the article

  • How to pass Multivalued parameters through URL in SSRS 2005

    - by Kali Charan Tripathi
    Hi All, I have main matrix report and I want to navigate my sub report from main report by Jump To URL:(Using below JavaScript function) method. ="javascript:void(window.open('http://localhost/ReportServer/Pages/ReportViewer.aspx?%2fKonsolidata_Data_Exporting_Project%2fEXPORT_REPORT_TEST&rs:Command=Render&RP_cntry="+Fields!STD_CTRY_NM.Value+"&RP_cll_typ_l1="+Join(Parameters!RP_cll_typ_l1.Value,",")+"'))" It is ok for the Single valued but giving exception for the multivalued Like An error has occurred during report processing. (rsProcessingAborted) Cannot read the next data row for the data set DS_GRID_DATA. (rsErrorReadingNextDataRow) Conversion failed when converting the nvarchar value '1,2,3,4' to data type int. Basically I have defined Parameters!RP_cll_typ_l1 as multivalued into my subreport as per ssrs multivalued parameter passing method. The value is going on sub report as '1,2,3,4' (not understandable by data set) It should be like as '1’,’2’,’3’,’4' or 1,2,3,4 How can I resolve this please help if any have solution? Thanks Kali Charan Tripathi(India) [email protected] [email protected]

    Read the article

  • Compare date from database using parameters

    - by Simon
    string queryString = "SELECT SUM(skupaj_kalorij)as Skupaj_Kalorij " + "FROM (obroki_save LEFT JOIN users ON obroki_save.ID_uporabnika=users.ID)" + "WHERE (users.ID= " + a.ToString() + ") AND (obroki_save.datum= @datum)"; using (OleDbCommand cmd = new OleDbCommand(queryString,database)) { DateTime datum = DateTime.Today; cmd.Parameters.AddWithValue("@datum", datum); } loadDataGrid2(queryString); I tried now with parameters. But i don't really know how to do it correctly. I tried like this, but the parameter datum doesn't get any value(according to c#).

    Read the article

  • Parameters with default value not in PsBoundParameters?

    - by stej
    General code Consider this code: PS> function Test { param($p='default value') $PsBoundParameters } PS> Test 'some value' Key Value --- ----- p some value PS> Test # nothing I would expect that $PsBoundParameters would contain record for $p variable on both cases. Is that correct behaviour? Question I'd like to use splatting for a lot of functions that would work like this: function SomeFuncWithManyRequiredParams { param( [Parameter(Mandatory=$true)][string]$p1, [Parameter(Mandatory=$true)][string]$p2, [Parameter(Mandatory=$true)][string]$p3, ...other parameters ) ... } function SimplifiedFuncWithDefaultValues { param( [Parameter(Mandatory=$false)][string]$p1='default for p1', [Parameter(Mandatory=$false)][string]$p2='default for p2', [Parameter(Mandatory=$false)][string]$p3='default for p3', ...other parameters ) SomeFuncWithManyRequiredParams @PsBoundParameters } I have more functions like this and I don't want to call SomeFuncWithManyRequiredParams with all the params enumerated: SomeFuncWithManyRequiredParams -p1 $p1 -p2 $p2 -p3 $p3 ... Is it possible?

    Read the article

  • Start thread with two parameters

    - by Matt
    I've got a method that gets called on an event, which presents me with two variables varA, varB (both strings). This method gets called with new information quite frequently, thus I have created a separate method that takes in the two parameters. I want to run this method in a thread, however have struck the issue that Thread.Start will not accept parameters. I've tried a few supposed methods, but have so far had no luck.. I think my best bet is to create a separate class, and handle it there.. However I have a List which I am inserting data into, and hit a dead end when the separate class tried to access that list, since it was in a different class. Can someone help me out here please?

    Read the article

  • Mixed Table Type with other types as parameters to Stored Procedured c#

    - by amemak
    Hi, I am asking about how could i pass multi parameters to a stored procedure, one of these parameters is user defined table. When I tried to do it it shows this error: INSERT INTO BD (ID, VALUE, BID) values( (SELECT t1.ID, t1.Value FROM @Table AS t1),someintvalue) here @Table is the user defined table parameter. Msg 116, Level 16, State 1, Procedure UpdateBD, Line 12 Only one expression can be specified in the select list when the subquery is not introduced with EXISTS. Msg 109, Level 15, State 1, Procedure UpdateBD, Line 11 There are more columns in the INSERT statement than values specified in the VALUES clause. The number of values in the VALUES clause must match the number of columns specified in the INSERT statement. Thank you

    Read the article

  • Passing parameters to a JQuery function.

    - by jmpena
    Hello, ive a problem using JQuery.. Im creating a HTML with a loop and it has a column for Action, that column is a HyperLink that when the user click the link call a JavaScript function and pass the parameters... example: <a href="#" OnClick="DoAction(1,'Jose');" > Click </a> <a href="#" OnClick="DoAction(2,'Juan');" > Click </a> <a href="#" OnClick="DoAction(3,'Pedro');" > Click </a> ... <a href="#" OnClick="DoAction(n,'xxx');" > Click </a> i want that function to Call an Ajax JQuery function with the correct parameters. any help ??

    Read the article

  • Cake PHP redirect with parameters in url

    - by megaboss98
    I have a page that I want to redirect to that requires parameters in the URL: http://www.mysite.com/myController/myAction/param1:val1/param2:val2 I know that there is a Cake PHP redirect function for redirecting that works as follows: $this->redirect(array("controller" => "myController", "action" => "myAction", $data_can_be_passed_here), $status, $exit); How do I add the parameters that I want as part of the url using the above function? I would think that there might be another element that I could add to array so that I can pass along "param1:val1" and "param2:val2". Any help would be greatly appreciated!

    Read the article

  • Getting a ReturnValue from cmd.Parameters in c#?

    - by mark smith
    Hi, I have just finished converted a vb.net app to c# and one of the lines is to get @ReturnValue from the parameter. I ended up having to CAST a lot of things.. Is there not a easier way here is what i have int rc = ((System.Data.SqlTypes.SqlInt32)(((System.Data.SqlClient.SqlParameter)(cmd.Parameters["@ReturnValue"])).SqlValue)).Value; In vb.net it was as simple as doing this Dim rc As Integer = Convert.ToInt32(cmd.Parameters("@ReturnValue").Value) Alot easier :-) But the problem with C# is the property Value isn't available unless I Cast to SqlParameter and i also need to cast to Sqltypes.SqlInt32 - i can't just do a standard Convert.ToInt32

    Read the article

  • Problem with passing parameters to SQL procedure using VBA

    - by Stefan Åstrand
    Hi, I am trying to pass @intDocumentNo and @intCustomerNo to a stored procedure using VBA but only @intCustomerNo is updated in dbo.tblOrderHead. I don't think the problem is with the procedure because if I enter the values manually it runs properly. What am I doing wrong? VBA Code: Private Sub intCustomerNo_Click() Dim cmdCommand As New ADODB.Command With cmdCommand .ActiveConnection = CurrentProject.Connection .CommandType = adCmdStoredProc .CommandText = "uspSelectCustomer" '@intDocumentNo .Parameters("@intDocumentNo").Value = Forms![frmSalesOrder].[IntOrderNo] '@intCustomerNo .Parameters("@intCustomerNo").Value = Me![intCustomerNo] .Execute End With DoCmd.Close Forms![frmSalesOrder].Requery End Sub Procedure: UPDATE dbo.tblOrderHead SET dbo.tblOrderHead.intCustomerNo = @intCustomerNo , dbo.tblOrderHead.intPaymentCode = dbo.tblCustomer.intPaymentCode, dbo.tblOrderHead.txtDeliveryCode = dbo.tblCustomer.txtDeliveryCode, dbo.tblOrderHead.txtRegionCode = dbo.tblCustomer.txtRegionCode, dbo.tblOrderHead.txtCurrencyCode = dbo.tblCustomer.txtCurrencyCode, dbo.tblOrderHead.txtLanguageCode = dbo.tblCustomer.txtLanguageCode FROM dbo.tblOrderHead INNER JOIN dbo.tblCustomer ON dbo.tblOrderHead.intCustomerNo = dbo.tblCustomer.intCustomerNo AND dbo.tblOrderHead.intOrderNo = @intDocumentNo

    Read the article

  • Javascript/jQuery: Varying parameters on a custom function

    - by dclowd9901
    I'm writing a plugin that will allow parameters to 'set it up.' But I predict the user won't always want to set up every aspect of the function. function This_Function(a,b,c,d); For instance, maybe they'll only want to set up a and c, but not b and d (they'll just prefer to leave those as defaults). How do I write the function (or the parameters for that matter) so that the user can customize which functions they would prefer to pass? I have a feeling it involves parsing input, but I've seen many other functions with this capability. Thanks in advance for the help.

    Read the article

  • .NET MVC custom routing with empty parameters

    - by user135498
    Hi All, I have a .net mvc with the following routes: routes.Add(new Route( "Lookups/{searchtype}/{inputtype}/{firstname}/{middlename}/{lastname}/{city}/{state}/{address}", new RouteValueDictionary( new { controller = "Lookups", action = "Search", firstname = (string)null, middlename = (string)null, lastname = (string)null, city = (string)null, state = (string)null, address = (string)null, SearchType = SearchType.PeopleSearch, InputType = InputType.Name }), new MvcRouteHandler()) ); routes.Add(new Route( "Lookups/{searchtype}/{inputtype}", new RouteValueDictionary( new { controller = "Lookups", action = "Search", firstname = "", middlename = "", lastname = "", city = "", state = "", address = "" }), new MvcRouteHandler()) ); routes.Add(new Route( "Lookups/{searchtype}/{inputtype}", new RouteValueDictionary( new { controller = "Lookups", action = "Search", firstname = "", middlename = "", lastname = "", city = "", state = "", address = "", SearchType = SearchType.PeopleSearch, InputType = InputType.Name }), new MvcRouteHandler()) ); routes.MapRoute( "Default", // Route name "{controller}/{action}/{id}", // URL with parameters new { controller = "Account", action = "LogOn", id = "" } // Parameter defaults ); The following request works fine: http://localhost:2608/Lookups/PeopleSearch/Name/john/w/smith/seattle/wa/123 main This request does not work: http://localhost:2608/Lookups/PeopleSearch/Name/john//smith//wa/ Not all requests will have all paramters and I would like empty parameters to be passed to the method as empty string or null. Where am I going wrong? The method: public ActionResult Search(string firstname, string middlename, string lastname, string city, string state, string address, SearchType searchtype, InputType inputtype) { SearchRequest r = new SearchRequest { Firstname = firstname, Middlename = middlename, Lastname = lastname, City = city, State = state, Address = address, SearchType = searchtype, InputType = inputtype }; return View(r); }

    Read the article

  • Stored Procedure Parameters Not Available After Declared

    - by SidC
    Hi All, Pasted below is a stored procedure written in SQL Server 2005. My intent is to call this sproc from my ASP.NEt web application through the use of a wizard control. I am new to SQL Server and especially to stored procedures. I'm unsure why my parameters are not available to the web application and not visible in SSMS treeview as a parameter under my sproc name. Can you help me correct the sproc below so that the parameters are correctly instantiated and available for use in my web application? Thanks, Sid Stored Procedure syntax: USE [Diel_inventory] GO /****** Object: StoredProcedure [dbo].[AddQuote] Script Date: 05/09/2010 00:31:10 ******/ SET ANSI_NULLS ON GO SET QUOTED_IDENTIFIER ON GO ALTER procedure [dbo].[AddQuote] as Declare @CustID int, @CompanyName nvarchar(50), @Address nvarchar(50), @City nvarchar(50), @State nvarchar(2), @ZipCode nvarchar(5), @Phone nvarchar(12), @FAX nvarchar(12), @Email nvarchar(50), @ContactName nvarchar(50), @QuoteID int, @QuoteDate datetime, @NeedbyDate datetime, @QuoteAmt decimal, @ID int, @QuoteDetailPartID int, @PartNumber float, @Quantity int begin Insert into dbo.Customers (CompanyName, Address, City, State, ZipCode, OfficePhone, OfficeFAX, Email, PrimaryContactName) Values (@CompanyName, @Address, @City, @State, @ZipCode, @Phone, @FAX, @Email, @ContactName) set @CustID = scope_identity() Insert into dbo.Quotes (fkCustomerID,NeedbyDate,QuoteAmt) Values(@CustID,@NeedbyDate,@QuoteAmt) set @QuoteID = scope_identity() Insert into dbo.QuoteDetail (ID) values(@ID) set @ID=scope_identity() Insert into dbo.QuoteDetailParts (QuoteDetailPartID, QuoteDetailID, PartNumber, Quantity) values (@ID, @QuoteDetailPartID, @PartNumber, @Quantity) END

    Read the article

  • WiX - Passing parameters to a CustomAction (DLL)

    - by glenneroo
    I've got a DLL from an old WiSE installer that i'm trying to get working in WiX, so i'm pretty sure the DLL works with MSI-based installers. Here is my definition: <Binary Id="SetupDLL" SourceFile="../Tools/Setup.dll" /> <CustomAction Id="ReadConfigFiles" BinaryKey="SetupDLL" DllEntry="readConfigFiles" /> and usage: <Publish Dialog="InstallDirDlg" Control="Next" Event="DoAction" Value="ReadConfigFiles" Order="3">1</Publish> Where exactly can I pass in parameters?

    Read the article

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