Search Results

Search found 45031 results on 1802 pages for 'same name'.

Page 86/1802 | < Previous Page | 82 83 84 85 86 87 88 89 90 91 92 93  | Next Page >

  • What to name 2 methods with same signatures

    - by coffeeaddict
    Initially I had a method in our DL that would take in the object it's updating like so: internal void UpdateCash(Cash Cash) { using (OurCustomDbConnection conn = CreateConnection("UpdateCash")) { conn.CommandText = @"update Cash set captureID = @captureID, ac_code = @acCode, captureDate = @captureDate, errmsg = @errorMessage, isDebit = @isDebit, SourceInfoID = @sourceInfoID, PayPalTransactionInfoID = @payPalTransactionInfoID, CreditCardTransactionInfoID = @CreditCardTransactionInfoID where id = @cashID"; conn.AddParam("@captureID", cash.CaptureID); conn.AddParam("@acCode", cash.ActionCode); conn.AddParam("@captureDate", cash.CaptureDate); conn.AddParam("@errorMessage", cash.ErrorMessage); conn.AddParam("@isDebit", cyberCash.IsDebit); conn.AddParam("@PayPalTransactionInfoID", cash.PayPalTransactionInfoID); conn.AddParam("@CreditCardTransactionInfoID", cash.CreditCardTransactionInfoID); conn.AddParam("@sourceInfoID", cash.SourceInfoID); conn.AddParam("@cashID", cash.Id); conn.ExecuteNonQuery(); } } My boss felt that creating an object every time just to update one or two fields is overkill. But I had a couple places in code using this. He recommended using just UpdateCash and sending in the ID for CAsh and field I want to update. Well the problem is I have 2 places in code using my original method. And those 2 places are updating 2 completely different fields in the Cash table. Before I was just able to get the existing Cash record and shove it into a Cash object, then update the properties I wanted to be updated in the DB, then send back the cash object to my method above. I need some advice on what to do here. I have 2 methods and they have the same signature. I'm not quite sure what to rename these because both are updating 2 completely different fields in the Cash table: internal void UpdateCash(int cashID, int paypalCaptureID) { using (OurCustomDbConnection conn = CreateConnection("UpdateCash")) { conn.CommandText = @"update Cash set CaptureID = @paypalCaptureID where id = @cashID"; conn.AddParam("@captureID", paypalCaptureID); conn.ExecuteNonQuery(); } } internal void UpdateCash(int cashID, int PayPalTransactionInfoID) { using (OurCustomDbConnection conn = CreateConnection("UpdateCash")) { conn.CommandText = @"update Cash set PaymentSourceID = @PayPalTransactionInfoID where id = @cashID"; conn.AddParam("@PayPalTransactionInfoID", PayPalTransactionInfoID); conn.ExecuteNonQuery(); } } So I thought hmm, maybe change the names to these so that they are now unique and somewhat explain what field its updating: UpdateCashOrderID UpdateCashTransactionInfoID ok but that's not really very good names. And I can't go too generic, for example: UpdateCashTransaction(int cashID, paypalTransactionID) What if we have different types of transactionIDs that the cash record holds besides just the paypalTransactionInfoID? such as the creditCardInfoID? Then what? Transaction doesn't tell me what kind. And furthermore what if you're updating 2 fields so you have 2 params next to the cashID param: UpdateCashTransaction(int cashID, paypalTransactionID, someOtherFieldIWantToUpdate) see my frustration? what's the best way to handle this is my boss doesn't like my first route?

    Read the article

  • RIA Services - Two entity models share an entity name

    - by Alex
    I have two entity models hooked up to two different databases. However, the two databases both have a table named 'brand', for example. As such, there is a naming conflict in my models. Now, I've been able to add a namespace to each model, via Custom Tool Namespace in the model's properties, but the generated code in my Silverlight project will try to use both namespaces, and come up with this, Imports MyProject.ModelA Imports MyProject.ModelB Public ReadOnly Property brands() As EntitySet(Of brand) Get Return MyBase.EntityContainer.GetEntitySet(Of brand) End Get End Property giving me this exception: 'Error 1 'brand' is ambiguous, imported from the namespaces or types 'MyProject.ModelA,MyProject.ModelB'. Has anyone had experience with naming conflicts like this using RIA services? How did you solve it?

    Read the article

  • MySQL Trigger with dynamic table name

    - by Thomas
    I've look around a bit and can't quite find an answer to my problem: I want a trigger to execute after an insert on a table and to take that data that is being inserted and do two things Create a new table from the client id and partner id Insert the 'data' that just was inserted into the new table I am fairly new to the Stored procedures and triggers so I came up with this but am having difficulty debugging it: delimiter $$ CREATE TRIGGER trg_creas_insert BEFORE INSERT ON tracking.creas for each row BEGIN DECLARE @tableName varchar(40); DECLARE @createStmnt mediumtext; SET @tableName = concat('crea_','_', NEW.idClient_crea,'_',NEW.idPartenaire_crea); SET @createStmnt = concat('CREATE TABLE IF NOT EXISTS', @tableName, '( `data_crea` mediumtext NOT NULL ) ENGINE=MyISAM AUTO_INCREMENT=29483330 DEFAULT CHARSET=utf8 PACK_KEYS=0'); PREPARE stmt FROM @createStmnt; EXECUTE stmt; INSERT INTO @tableName (data_crea) values (NEW.data_crea); END$$ delimiter ; Thoughts?

    Read the article

  • facebook open graph meta property og:type of 'website'. The property 'object-name' requires an object of og:type 'object-name'

    - by chinmayahd
    in cake php 1.3 in view ctp i have follow code: $url = 'http://example.com/exmp/explus/books/view/'.$book['Book']['id']; echo $this->Html->meta(array('property' => 'fb:app_id', 'content' => '*******'),'',array('inline'=>false)); echo $this->Html->meta(array('property' => 'og:type', 'content' => 'book'),'',array('inline'=>false)); echo $this->Html->meta(array('property' => 'og:url', 'content' => $url ),'',array('inline'=>false)); echo $this->Html->meta(array('property' => 'og:title', 'content' => $book['Book']['title']),'',array('inline'=>false)); echo $this->Html->meta(array('property' => 'og:description', 'content' => $book['Book']['title']),'',array('inline'=>false)); $imgurl = '../image/'.$book['Book']['id']; echo $this->Html->meta(array('property' => 'og:image', 'content' => $imgurl ),'',array('inline'=>false)); ?> and it gives the following error when i am posting it' { "error": { "message": "(#3502) Object at URL http://example.com/exmp/explus/books/view/234' has og:type of 'website'. The property 'book' requires an object of og:type 'book'. ", "type": "OAuthException", "code": 3502 } } is any one know how to solve it?

    Read the article

  • Can anyone tell me what's wrong in this part of code

    - by Mobin
    string name = ((DateTimePicker)sender).Name.ToString(); name = name.Substring(0, name.Length - 1); name = name + "4"; TimeSpan duration = new TimeSpan(); duration = ((DateTimePicker)sender).Value - ((DateTimePicker)panel2.Controls[name]).Value; name = name.Substring(0, name.Length - 1); name = name + "6"; ((MaskedTextBox)panel2.Controls[name]).Text = duration.ToString(); On execution it gives me Object reference not set to instance of an object similar functionality is used on other places but I can't find out what I have to reinitialize here :$ The casting for datetimepicker is fine I have to get a name for the datetiempicker to identify the row it's on in my form and the picker before that to calculate their differences and then print that difference in a maskedtext box from the control whose name I make using names of two datetimepickers but when I access controls in the error line I get this message.

    Read the article

  • change last key name from array in php

    - by robertdd
    i want to be able to change the last key from array i try with this function i made: function getlastimage($newkey){ $arr = $_SESSION['files']; $oldkey = array_pop(array_keys($arr)); $arr[$newkey] = $arr[$oldkey]; unset($arr[$oldkey]); $results = end($arr); //echo json_encode($results); print_r($arr); } if i call the function getlastimage('newkey') it change the key!but after if i print the $_SESSION the key is not changed? why this?

    Read the article

  • Generated queries contain schema and catalog name

    - by stacker
    I've the same problem as described here In the generated SQL Informix expects catalog:schema.table but what's actually generated is catalog.schema.table which leads to a syntax error. Setting: hibernate.default_catalog= hibernate.default_schema= had no effect. I even removed schema and catalog from the table annotation, this caused a different issues : the query looked like that ..table same for setting catalog and schema to an empty string. Versions seam 2.1.2 Hibernate Annotations 3.3.1.GA.CP01 Hibernate 3.2.4.sp1.cp08 Hibernate EntityManager 3.3.2.GAhibernate Jboss 4.3 (similar to 4.2.3)

    Read the article

  • Check for column name in a SqlDataReader object

    - by Michael Kniskern
    How do I check to see if a column exists in a SqlDataReader object? In my data access layer, I have create a method that builds the same object for multiple stored procedures calls. One of the stored procedures has an additional column that is not used by the other stored procedures. I want to modified the method to accommodate for every scenario. My application is written in C#.

    Read the article

  • t-sql pivot filter based on input column name

    - by stackoverflowuser
    Based on following AreaState table Area State ------------------- A1 Active A1 Active A1 Active A1 Proposed A1 Proposed A2 Active A2 Proposed I want to write a stored proc that returns count of state for each of the areas. Input to the stored proc is any valid State (in this case @state is the input parameter). I was hoping that below would work but it does not. declare @state varchar(10) set @state = 'Active' select Area, QUOTENAME(@state) from ( select Area, State from AreaState ) as src pivot ( count(State) for State in (QUOTENAME(@state)) ) as pvt Pls. suggest.

    Read the article

  • Getting the Assembly Qualified Name of a class in Visual Studio

    - by Alex Marshall
    Hello, I'm writing a customized reflective library for some specialized custom domain logic, and that library is going to use XML configuration files that will dynamically resolve System.Type objects at runtime. However, when writing the XML configuration files, it's a bit of a pain to write the types because they need to be fully qualified assembly names for Type.GetType() to resolve them. Is there a way to find out the AssemblyQualifiedName of an object in Visual Studio without resorting to writing a program to print them out to a file or standard out or anything like that ?

    Read the article

  • Recommendtations for a simple name registrar

    - by ripper234
    I'm currently registering my domains through GoDaddy. Does the registrar matter? Any recommendations for registrars you're especially happy with? (See this very similar question, that requires API support. I need no such support, hence this question is more generic).

    Read the article

  • Multiple constructors definitions with same name but different signatures (C++)

    - by PuRe_ChAoS12
    With the following code, I keep getting error C2535 when I compile. It's complaining that a member function already defined or declared. Rationnel.h ... class Rationnel { public: Rationnel(int); //Constructor Rationnel(int,int); //Constructor void add(const Rationnel); ... Rationnel.cpp ... //Constructor Rationnel::Rationnel(int n = 1) { numerateur = n; denominateur = 1; } //Constructor Rationnel::Rationnel(int n = 1, int d = 1) { numerateur = n; denominateur = d; } ... Any idea what could be causing the error? Thanks for your time.

    Read the article

  • How to write data by dynamic parameter name

    - by Maxim Welikobratov
    I need to be able to write data to datastore of google-app-engine for some known entity. But I don't want write assignment code for each parameter of the entity. I meen, I don't want do like this val_1 = self.request.get('prop_1') val_2 = self.request.get('prop_2') ... val_N = self.request.get('prop_N') item.prop_1 = val_1 item.prop_2 = val_2 ... item.prop_N = val_N item.put() instead, I want to do something like this args = self.request.arguments() for prop_name in args: item.set(prop_name, self.request.get(prop_name)) item.put() dose anybody know how to do this trick?

    Read the article

  • C# class in a directory without having the directory name in its namespace

    - by PaN1C_Showt1Me
    Hi ! If you add a directory in your Visual Studio project and you add a class inside it, the namespace will respect the whole path the directory inclusive. But sometimes, I prefer having the class in the main project namespace, although it lies in a directory structure, just because I don't want to have mess in my code. So often happens that I rewrite the Myproject.MyDirectory namespace to be Myproject only. Is it OK in your opinion? Or does any convention say that every class inside the directory must have it included in the namespace ? Thanks

    Read the article

  • Regex, replace path to resource, modify resource name

    - by jerome
    Hi all, I'd like to use a JS regex to take a string such as the following: 'http://www.somedomain.com/some_directory/some_other_directory/some_image.jpg' And turn it into this: 'http://www.some_other_domain.com/another_directory/yet_another_directory/size1_some_image.jpg' Any hints? Additionally, any pointers for books or other resources that give a gentle introduction to mastering regexes in JS and other languages?

    Read the article

  • t-sql get variable value from string with variable name

    - by Markus
    Hi. Is there a way to convert '@my_variable' string into a value of @my_variable? I have a table which stores names of variables. I need to get the value of this variable. Something like this: DECLARE @second_variable AS NVARCHAR(20); DECLARE @first_variable AS NVARCHAR(20); SET @first_variable = '20'; SET @second_variable = SELECT '@first_variable'; --here I want that @second variable be assigned a value of "20".

    Read the article

  • Preg_match class name from PHP file

    - by talentedmrjones
    I have a script that recursively scans a directory pulling out class names from php files, and storing those classes names in an array. This is working nicely even through the rather large Zend Framework library folders. The issue is that classes that extend other classes are not being included in the array. Here is my current preg_match: if (preg_match("/class\s*(\w*)\s*\{/i",strip_comments(file_get_contents($file)),$matches)) $classes[] = $matches[1]; I know that the last \s* is not right; there should be something there that can catch "{" or " extends Some_Other_Class {" .

    Read the article

  • JQuery use variable by name of divID

    - by Russell Parrott
    Just a quick question, that I cannot fathom out, hope you guys and girls can help. I have a div (with ID) that when clicked opens a new div - great works well, what I really want is to "populate" the new div with predefined text based on the clicked div's ID. example: <div class="infobox" id="help_msg1">Click me</div> I may have say 3 (actually more but...) of these div's This opens: <div id="helpbox">text in here</div> In/on my .js page I have doc ready etc then: var help_msg1 ='text that is a help message'; var help_msg2 ='text that is another help message'; var help_msg3 ='text that is yet another help message'; Then $('.infobox').live('click',function() { $('#helpbox').remove(); $('label').css({'font-weight': '400'}); $(this).next('label').css({'font-weight': '900'}); var offset = $(this).next().next().offset(); var offsetby = $(this).next().next().width(); var leftitby = offset.left+offsetby+10; $('body').append('text in here'); $('#helpbox').css( { 'left': leftitby, 'top': offset.top } ); }); Note I remove each #helpbox before appending the new one and the .next().next() identifies the appropriate text input that lot all works. What I need is how do I put var help_msg1 into the append when id="help_msg1" is clicked or var help_msg2 when id="help_msg2" is clicked etc. I have tried

    Read the article

< Previous Page | 82 83 84 85 86 87 88 89 90 91 92 93  | Next Page >