Search Results

Search found 1220 results on 49 pages for 'nathan pk'.

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

  • C# System.Data.SQLite Designer Code

    - by Nathan
    I've been messing around with the SQLite Designer in Visual Studio 2008 and I have noticed that when I use the generated Insert/Update statements they run extremely slow. Example: I have a data table with four columns and 5700 rows it took ~5 mins to insert the data into the database table However, I wrote my own database connection and insert methods using parameters and a single transaction and the same 5700 rows were inserted in under 1 second. Why is the generated code so slow and what is benefit to even using it? Thanks. Nathan

    Read the article

  • Horizontal Scrolling Flash Game/Large Horizontal Scene

    - by Nathan
    Hello, I'm currently learning Flash (CS4, AS3) and am creating a game. I have currently 1 flv file with 4 scenes, I then move from left to right and then to scene 2 and go from left to right. This is the game where items pop up that need to be clicked on and you get points. Is there any way I can combine these onto 1 scene? Flash only allows you to have a maximum of 2880px wide. The reason for this is the transition between the scenes is RUBBISH and that my AS is not working correctly in between scenes (it loses values). Any help would be greatly appreciated! Nathan

    Read the article

  • Can I check the validity of a single DataMapper property?

    - by Nathan Long
    In a custom DataMapper setter, I'd like to check whether the value I'm setting is valid or not. For instance: class ToastMitten include DataMapper::Resource property :id, Serial property :wearer, Enum['Chuck Norris', 'Jon Skeet'] property :first_worn_at, DateTime def wearer=(name) super if wearer.valid? # How can I do this? first_worn_at = Time.now end end end t = ToastMitten.new t.wearer = 'Nathan Long' # invalid value; do NOT set first_worn_at t.wearer = 'Jon Skeet' # valid value; set first_worn_at Can I check the validity of a single property like this without calling valid? on the object itself and looking through all the errors?

    Read the article

  • Populating Models from other Models in Django?

    - by JT
    This is somewhat related to the question posed in this question but I'm trying to do this with an abstract base class. For the purposes of this example lets use these models: class Comic(models.Model): name = models.CharField(max_length=20) desc = models.CharField(max_length=100) volume = models.IntegerField() ... <50 other things that make up a Comic> class Meta: abstract = True class InkedComic(Comic): lines = models.IntegerField() class ColoredComic(Comic): colored = models.BooleanField(default=False) In the view lets say we get a reference to an InkedComic id since the tracer, err I mean, inker is done drawing the lines and it's time to add color. Once the view has added all the color we want to save a ColoredComic to the db. Obviously we could do inked = InkedComic.object.get(pk=ink_id) colored = ColoredComic() colored.name = inked.name etc, etc. But really it'd be nice to do: colored = ColoredComic(inked_comic=inked) colored.colored = True colored.save() I tried to do class ColoredComic(Comic): colored = models.BooleanField(default=False) def __init__(self, inked_comic = False, *args, **kwargs): super(ColoredComic, self).__init__(*args, **kwargs) if inked_comic: self.__dict__.update(inked_comic.__dict__) self.__dict__.update({'id': None}) # Remove pk field value but it turns out the ColoredComic.objects.get(pk=1) call sticks the pk into the inked_comic keyword, which is obviously not intended. (and actually results in a int does not have a dict exception) My brain is fried at this point, am I missing something obvious, or is there a better way to do this?

    Read the article

  • Legit? Two foreign keys referencing the same primary key.

    - by Ryan
    Hi All, I'm a web developer and have recently started a project with a company. Currently, I'm working with their DBA on getting the schema laid out for the site, and we've come to a disagreement regarding the design on a couple tables, and I'd like some opinions on the matter. Basically, we are working on a site that will implement a "friends" network. All users of the site will be contained in a table tblUsers with (PersonID int identity PK, etc). What I am wanting to do is to create a second table, tblNetwork, that will hold all of the relationships between users, with (NetworkID int identity PK, Owners_PersonID int FK, Friends_PersonID int FK, etc). Or conversely, remove the NetworkID, and have both the Owners_PersonID and Friends_PersonID shared as the Primary key. This is where the DBA has his problem. Saying that "he would only implement this kind of architecture in a data warehousing schema, and not for a website, and this is just another example of web developers trying to take the easy way out." Now obviously, his remark was a bit inflammatory, and that have helped motivate me to find an suitable answer, but more so, I'd just like to know how to do it right. I've been developing databases and programming for over 10 years, have worked with some top-notch minds, and have never heard this kind of argument. What the DBA is wanting to do is instead of storing both the Owners_PersonId and Friends_PersonId in the same table, is to create a third table tblFriends to store the Friends_PersonId, and have the tblNetwork have (NetworkID int identity PK, Owner_PersonID int FK, FriendsID int FK(from TBLFriends)). All that tblFriends would house would be (FriendsID int identity PK, Friends_PersonID(related back to Persons)). To me, creating the third table is just excessive in nature, and does nothing but create an alias for the Friends_PersonID, and cause me to have to add (what I view as unneeded) joins to all my queries, not to mention the extra cycles that will be necessary to perform the join on every query. Thanks for reading, appreciate comments. Ryan

    Read the article

  • LINQ(2 SQL) Insert Multiple Tables Question

    - by Refracted Paladin
    I have 3 tables. A primary EmploymentPlan table with PK GUID EmploymentPlanID and 2 FK's GUID PrevocServicesID & GUID JobDevelopmentServicesID. There are of course other fields, almost exclusively varchar(). Then the 2 secondary tables with the corresponding PK to the primary's FK's. I am trying to write the LINQ INSERT Method and am struggling with the creation of the keys. Say I have a method like below. Is that correct? Will that even work? Should I have seperate methods for each? Also, when INSERTING I didn't think I needed to provide the PK for a table. It is auto-generated, no? Thanks, public static void InsertEmploymentPlan(int planID, Guid employmentQuestionnaireID, string user, bool communityJob, bool jobDevelopmentServices, bool prevocServices, bool transitionedPrevocIntegrated, bool empServiceMatchPref) { using (var context = MatrixDataContext.Create()) { var empPrevocID = Guid.NewGuid(); var prevocPlan = new tblEmploymentPrevocService { EmploymentPrevocID = empPrevocID }; context.tblEmploymentPrevocServices.InsertOnSubmit(prevocPlan); var empJobDevID = Guid.NewGuid(); var jobDevPlan = new tblEmploymentJobDevelopmetService() { JobDevelopmentServicesID = empJobDevID }; context.tblEmploymentJobDevelopmetServices.InsertOnSubmit(jobDevPlan); var empPlan = new tblEmploymentQuestionnaire { CommunityJob = communityJob, EmploymentQuestionnaireID = Guid.NewGuid(), InsertDate = DateTime.Now, InsertUser = user, JobDevelopmentServices = jobDevelopmentServices, JobDevelopmentServicesID =empJobDevID, PrevocServices = prevocServices, PrevocServicesID =empPrevocID, TransitionedPrevocToIntegrated =transitionedPrevocIntegrated, EmploymentServiceMatchPref = empServiceMatchPref }; context.tblEmploymentQuestionnaires.InsertOnSubmit(empPlan); context.SubmitChanges(); } } I understand I can use more then 1 InsertOnSubmit, See SO ? HERE, I just don't understand how that would apply to my situation and the PK/FK creation.

    Read the article

  • Fluent Nhibernate causes System.IndexOutOfRangeException on Commit()

    - by Moss
    Hey there. I have been trying to figure out how to configure the mapping with both NH and FluentNH for days, and I think I'm almost there, but not quite. I have the following problem. What I need to do is basically map these two entities, which are simplified versions of the actual ones. Airlines varchar2(3) airlineCode //PK varchar2(50) Aircraft varchar2(3) aircraftCode //composite PK varchar2(3) airlineCode //composite PK, FK referencing PK in Airlines varchar2(50) aircraftName My classes look like class Airline { string AirlineCode; string AirlineName; IList<Aircraft> Fleet; } class Aircraft { Airline Airline; string AircraftCode; string AircraftName; } Using FluentNH, I mapped it like so AirlineMap Table("Airlines"); Id(x => x.AirlineCode); Map(x => x.AirlineName); HasMany<Aircraft>(x => x.Fleet) .KeyColumn("Airline"); AircraftMap Table("Aircraft"); CompositeId() .KeyProperty(x => x.AircraftCode) .KeyReference(x => x.Airline); Map(x => x.AircraftName); References(x => x.Airline) .Column("Airline"); Using Nunit, I'm testing the addition of another aircraft, but upon calling transaction.Commit after session.Save(aircraft), I get an exception: "System.IndexOutOfRangeException : Invalid index 22 for this OracleParameterCollection with Count=22." The Aircraft class (and the table) has 22 properties. Anyone have any ideas?

    Read the article

  • Primary Key Identity Value Increments On Unique Key Constraint Violation

    - by Jed
    I have a SqlServer 2008 table which has a Primary Key (IsIdentity=Yes) and three other fields that make up a Unique Key constraint. In addition I have a store procedure that inserts a record into the table and I call the sproc via C# using a SqlConnection object. The C# sproc call works fine, however I have noticed interesting results when the C# sproc call violates the Unique Key constraint.... When the sproc call violates the Unique Key constraint, a SqlException is thrown - which is no surprise and cool. However, I notice that the next record that is successfully added to the table has a PK value that is not exactly one more than the previous record - For example: Say the table has five records where the PK values are 1,2,3,4, and 5. The sproc attempts to insert a sixth record, but the Unique Key constraint is violated and, so, the sixth record is not inserted. Then the sproc attempts to insert another record and this time it is successful. - This new record is given a PK value of 7 instead of 6. Is this normal behavior? If so, can you give me a reason why this is so? (If a record fails to insert, why is the PK index incremented?) If this is not normal behavior, can you give me any hints as to why I am seeing these symptoms?

    Read the article

  • NHibernate Legacy Database Mappings Impossible?

    - by Corey Coogan
    I'm hoping someone can help me with mapping a legacy database. The problem I'm describing here has plagued others, yet I was unable to find a real good solution around the web. DISCLAIMER: this is a legacy DB. I have no control over the composite keys. They suck and can't be changed no matter much you tell me they suck. I have 2 tables, both with composite keys. One of the keys from one table is used as part of the key to get a collection from the other table. In short, the keys don't fully match between the table. ClassB is used everywhere I would like to avoid adding properties for the sake of this mapping if possible. public class ClassA { //[PK] public string SsoUid; //[PK] public string PolicyNumber; public IList<ClassB> Others; //more properties.... } public class ClassB { //[PK] public string PolicyNumber; //[PK] public string PolicyDateTime; //more properties } I want to get an instance of ClassA and get all ClassB rows that match PolicyNumber. I am trying to get something going with a one-to-many, but I realize that this may technically be a many-to-many that I am just treating as one-to-many. I've tried using an association class but didn't get far enough to see if it works. I'm new to these more complex mappings and am looking for advice. I'm open to pretty much any ideas. Thanks, Corey

    Read the article

  • SQL Server 2005 database design - many-to-many relationships with hierarchy

    - by Remnant
    Note I have completely re-written my original post to better explain the issue I am trying to understand. I have tried to generalise the problem as much as possible. Also, my thanks to the original people who responded. Hopefully this post makes things a little clearer. Context In short, I am struggling to understand the best way to design a small scale database to handle (what I perceive to be) multiple many-to-many relationships. Imagine the following scenario for a company organisational structure: Textile Division Marketing Division | | ---------------------- ---------------------- | | | | HR Dept Finance Dept HR Dept Finance Dept | | | | ---------- ---------- ---------- --------- | | | | | | | | Payroll Hiring Audit Tax Payroll Hiring Audit Accounts | | | | | | | | Emps Emps Emps Emps Emps Emps Emps Emps NB: Emps denotes a list of employess that work in that area When I first started with this issue I made four separate tables: Divisions - Textile, Marketing (PK = DivisionID) Departments - HR, Finance (PK = DeptID) Functions - Payroll, Hiring, Audit, Tax, Accounts (PK = FunctionID) Employees - List of all Employees (PK = EmployeeID) The problem as I see it is that there are multiple many-to-many relationships i.e. many departments have many divisions and many functions have many departments. Question Giving the database structure above, suppose I wanted to do the following: Get all employees who work in the Payroll function of the Marketing Division To do this I need to be able to differentiate between the two Payroll departments but I am not sure how this can be done? I understand that I could build a 'Link / Junction' table between Departments and Functions so that I can retrieve which Functions are in which Departments. However, I would still need to differentiate the Division they belong to. Research Effort As you can see I am an abecedarian when it comes to database deisgn. I have spent the last two days resaerching this issue, traversing nested set models, adjacency models, reading that this issue is known not to be NP complete etc. I am sure there is a simple solution?

    Read the article

  • SQL Stored Queries - use result of query as boolean based on existence of records

    - by Christian Mann
    Just getting into SQL stored queries right now... anyway, here's my database schema (simplified for YOUR convenience): member ------ id INT PK board ------ id INT PK officer ------ id INT PK If you're into OOP, Officer Inherits Board Inherits Member. In other words, if someone is listed on the officer table, s/he is listed on the board table and the member table. I want to find out the highest privilege level someone has. So far my SP looks like this: DELIMITER // CREATE PROCEDURE GetAuthLevel(IN targetID MEDIUMINT) BEGIN IF SELECT `id` FROM `member` WHERE `id` = targetID; THEN IF SELECT `id` FROM `board` WHERE `id` = targetID; THEN IF SELECT `id` FROM `officer` WHERE `id` = targetID; THEN RETURN 3; /*officer*/ ELSE RETURN 2; /*board member*/ ELSE RETURN 1; /*general member*/ ELSE RETURN 0; /*not a member*/ END // DELIMITER ; The exact text of the error is #1064 - You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'SELECT id FROM member WHERE id = targetID; THEN IF SEL' at line 4 I suspect the issue is in the arguments for the IF blocks. What I want to do is return true if the result-set is at least one -- i.e. the id was found in the table. Do any of you guys see anything to do here, or should I reconsider my database design into this:? person ------ id INT PK level SMALLINT

    Read the article

  • Database design grouping contacts by lists and companies

    - by Serge
    Hi, I'm wondering what would be the best way to group contacts by their company. Right now a user can group their contacts by custom created lists but I'd like to be able to group contacts by their company as well as store the contact's position (i.e. Project Manager of XYZ company). Database wise this is what I have for grouping contacts into lists contact [id_contact] [int] PK NOT NULL, [lastName] [varchar] (128) NULL, [firstName] [varchar] (128) NULL, ...... contact_list [id_contact] [int] FK, [id_list] [int] FK, list [id_list] [int] PK [id_user] [int] FK [list_name] [varchar] (128) NOT NULL, [description] [TEXT] NULL Should I implement something similar for grouping contacts by company? If so how would I store the contact's position in that company and how can I prevent data corruption if a user modifies a contact's company name. For instance John Doe changed companies but the other co-workers are still in the old company. I doubt that will happen often (might not even happen at all) but better be safe than sorry. I'm also keeping an audit trail so in a way the contact would still need to be linked to the old company as well as the new one but without confusing what company he's actually working at the moment. I hope that made sense... Has anyone encountered such a problem? UPDATE Would something like this make sense contact_company [id_contact_company] [int] PK [id_contact] [int] FK [id_company] [int] FK [contact_title] [varchar] (128) company [id_company] [int] PK NOT NULL, [company_name] [varchar] (128) NULL, [company_description] [varchar] (300) NULL, [created_date] [datetime] NOT NULL This way a contact can work for more than one company and contacts can be grouped by companies

    Read the article

  • @OneToMany and composite primary keys?

    - by Kris Pruden
    Hi, I'm using Hibernate with annotations (in spring), and I have an object which has an ordered, many-to-one relationship which a child object which has a composite primary key, one component of which is a foreign key back to the id of the parent object. The structure looks something like this: +=============+ +================+ | ParentObj | | ObjectChild | +-------------+ 1 0..* +----------------+ | id (pk) |-----------------| parentId | | ... | | name | +=============+ | pos | | ... | +================+ I've tried a variety of combinations of annotations, none of which seem to work. This is the closest I've been able to come up with: @Entity public class ParentObject { @Column(nullable=false, updatable=false) private String id; @OneToMany(mappedBy="object", fetch=FetchType.EAGER) @IndexColumn(name = "pos", base=0) private List<ObjectChild> attrs; ... } @Entity public class ChildObject { @Embeddable public static class Pk implements Serializable { @Column(nullable=false, updatable=false) private String objectId; @Column(nullable=false, updatable=false) private String name; @Column(nullable=false, updatable=false) private int pos; ... } @EmbeddedId private Pk pk; @ManyToOne @JoinColumn(name="parentId") private ParentObject parent; ... } I arrived at this after a long bout of experimentation in which most of my other attempts yielded entities which hibernate couldn't even load for various reasons. The error I get when I try to read one of these objects (they seem to save OK), I get an error of this form: org.hibernate.exception.SQLGrammarException: could not initialize a collection: ... And the root cause is this: com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: Unknown column 'attrs0_.id' in 'field list' I'm sure I'm missing something simple, but the documentation is not clear on this matter, and I haven't been able to find any examples of this anywhere else. Thanks!

    Read the article

  • Extract primary key from MySQL in PHP

    - by Parth
    I have created a PHP script and I am lacking to extract the primary key, I have given flow below, please help me in how can i modify to get primary key I am using MySQL DB, working for Joomla, My requirement is tracking the activity like insert/update/delete on any table and store it in another audit table using triggers, i.e. I am doing Auditing. DB's table structure: Few tables dont have any PK nor auto increment key Flow of my script is : I fetch out all table from DB. I check whether the table have any trigger or not. If yes then it moves to check nfor next table and so on. If it does'nt find any trigger then it creates the triggers for the table, such that, -it first checks if the table has any primary key or not(for inserting in Tracking audit table for every change made) if it has the primary key then it uses it further in creation of trigger. if it doesnt find any PK then it proceeds further in creating the trigger without inserting any id in audit table Now here, My problem is I need the PK every time so that I can record the id of any particular table in which the insert/update/delete is performed, so that further i can use this audit track table to replicate in production DB.. Now as I haave mentioned earlier that I am not available with PK/auto-incremented in some table, then what should I do get the particular id in which change is done? please guide me...GEEKS!!!

    Read the article

  • django: control json serialization

    - by abolotnov
    Is there a way to control json serialization in django? Simple code below will return serialized object in json: co = Collection.objects.all() c = serializers.serialize('json',co) The json will look similar to this: [ { "pk": 1, "model": "picviewer.collection", "fields": { "urlName": "architecture", "name": "\u0413\u043e\u0440\u043e\u0434 \u0438 \u0430\u0440\u0445\u0438\u0442\u0435\u043a\u0442\u0443\u0440\u0430", "sortOrder": 0 } }, { "pk": 2, "model": "picviewer.collection", "fields": { "urlName": "nature", "name": "\u041f\u0440\u0438\u0440\u043e\u0434\u0430", "sortOrder": 1 } }, { "pk": 3, "model": "picviewer.collection", "fields": { "urlName": "objects", "name": "\u041e\u0431\u044a\u0435\u043a\u0442\u044b \u0438 \u043d\u0430\u0442\u044e\u0440\u043c\u043e\u0440\u0442", "sortOrder": 2 } } ] You can see it's serializing it in a way that you are able to re-create the whole model, shall you want to do this at some point - fair enough, but not very handy for simple JS ajax in my case: I want bring the traffic to minimum and make the whole thing little clearer. What I did is I created a view that passes the object to a .json template and the template will do something like this to generate "nicer" json output: [ {% if collections %} {% for c in collections %} {"id": {{c.id}},"sortOrder": {{c.sortOrder}},"name": "{{c.name}}","urlName": "{{c.urlName}}"}{% if not forloop.last %},{% endif %} {% endfor %} {% endif %} ] This does work and the output is much (?) nicer: [ { "id": 1, "sortOrder": 0, "name": "????? ? ???????????", "urlName": "architecture" }, { "id": 2, "sortOrder": 1, "name": "???????", "urlName": "nature" }, { "id": 3, "sortOrder": 2, "name": "??????? ? ?????????", "urlName": "objects" } ] However, I'm bothered by the fast that my solution uses templates (an extra step in processing and possible performance impact) and it will take manual work to maintain shall I update the model, for example. I'm thinking json generating should be part of the model (correct me if I'm wrong) and done with either native python-json and django implementation but can't figure how to make it strip the bits that I don't want. One more thing - even when I restrict it to a set of fields to serialize, it will keep the id always outside the element container and instead present it as "pk" outside of it.

    Read the article

  • Custom Django Field is deciding to work as ForiegnKey for no reason

    - by Joe Simpson
    Hi, i'm making a custom field in Django. There's a problem while trying to save it, it's supposed to save values like this 'user 5' and 'status 9' but instead in the database these fields show up as just the number. Here is the code for the field: def find_key(dic, val): return [k for k, v in dic.items() if v == val][0] class ConnectionField(models.TextField): __metaclass__ = models.SubfieldBase serialize = False description = 'Provides a connection for an object like User, Page, Group etc.' def to_python(self, value): if type(value) != unicode: return value value = value.split(" ") if value[0] == "user": return User.objects.get(pk=value[1]) else: from social.models import connections return get_object_or_404(connections[value[0]], pk=value[1]) def get_prep_value(self, value): from social.models import connections print value, "prep" if type(value) == User: return "user %s" % str(value.pk) elif type(value) in connections.values(): o= "%s %s" % (find_key(connections, type(value)), str(value.pk)) print o, "return" return o else: print "CONNECTION ERROR!" raise TypeError("Value is not connectable!") Connection is just a dictionary with the "status" text linked up to the model for a StatusUpdate. I'm saving a model like this which is causing the issue: Relationship.objects.get_or_create(type="feedback",from_user=request.user,to_user=item) Please can someone help, Many Thanks Joe *_*

    Read the article

  • I have created a PHP script and I am lacking to extract the primary key, I have given flow below, pl

    - by Parth
    I am using MySQL DB, working for Joomla, My requirement is tracking the activity like insert/update/delete on any table and store it in another audit table using triggers, i.e. I am doing Auditing. DB's table structure: Few tables dont have any PK nor auto increment key Flow of my script is : I fetch out all table from DB. I check whether the table have any trigger or not. If yes then it moves to check nfor next table and so on. If it does'nt find any trigger then it creates the triggers for the table, such that, -it first checks if the table has any primary key or not(for inserting in Tracking audit table for every change made) if it has the primary key then it uses it further in creation of trigger. if it doesnt find any PK then it proceeds further in creating the trigger without inserting any id in audit table Now here, My problem is I need the PK every time so that I can record the id of any particular table in which the insert/update/delete is performed, so that further i can use this audit track table to replicate in production DB.. Now as I haave mentioned earlier that I am not available with PK/auto-incremented in some table, then what should I do get the particular id in which change is done? please guide me...GEEKS!!!

    Read the article

  • How can I map to a field that is joined in via one of three possible tables

    - by Mongus Pong
    I have this object : public class Ledger { public virtual Person Client { get; set; } // .... } The Ledger table joins to the Person table via one of three possible tables : Bill, Receipt or Payment. So we have the following tables : Ledger LedgerID PK Bill BillID PK, LedgerID, ClientID Receipt ReceiptID PK, LedgerID, ClientID Payment PaymentID PK, LedgerID, ClientID If it was just the one table, I could map this as : Join ( "Bill", x => { x.ManyToOne ( ledger => ledger.Client, mapping => mapping.Column ( "ClientID" ) ); x.Key ( l => l.Column ( "LedgerID" ) ); } ); This won't work for three tables. For a start the Join performs an inner join. Since there will only ever be one of Bill, Receipt or Payment - an inner join on these tables will always return zero rows. Then it would need to know to do a Coalesce on the ClientID of each of these tables to know the ClientID to grab the data from. Is there a way to do this? Or am I asking too much of the mappings here?

    Read the article

  • EF 4.0 Guid or Int as A primary Key

    - by bigb
    I am Implementing custom ASPNetMembership using EF 4.0 Is there any reason why i should use Guid as a primary key in User tables? As far as i know Int as a PK on SQL Server more performanced than strings. And Int is easier to iterate. Also, for security purpose if i need to pass this it id somewhere in url i may encrypt it somehow and pass it like a strings with no probs. But if i want to use auto generated Guid on SQL Server side using EF 4.0 i need to do this trick http://leedumond.com/blog/using-a-guid-as-an-entitykey-in-entity-framework-4/ I can't see any cases why i should use Guid as PK, may be only one if system going to have millions ans millions users, but also, theoretically, Guid could be duplicated sometime isn't so? Anyway Int32 size is 2,147.483.647 it is pretty much even for very-very big system, but if this number is still not enough I may go with Int64, in that cases I may have 9,223.372.036.854.775.807 rows. Pretty much huh? From another hand, M$ using Guids as PK in their ASPNetMembership implementation. [aspnetdb].[aspnet_Users] - PK UserId Type uniqueidentifier, should be some reasons/explanation why the did it?! May be some one has any ideas/experience about that?

    Read the article

  • Wix Custom Action problems

    - by Grandpappy
    I'm trying to create a custom action for my Wix install, and it's just not working, and I'm unsure why. Here's the bit in the appropriate Wix File: <Binary Id="INSTALLERHELPER" SourceFile=".\Lib\InstallerHelper.dll" /> <CustomAction Id="SQLHelperAction" BinaryKey="INSTALLERHELPER" DllEntry="CustomAction1" Execute="immediate" /> Here's the full class file for my custom action: using Microsoft.Deployment.WindowsInstaller; namespace InstallerHelper { public class CustomActions { [CustomAction] public static ActionResult CustomAction1(Session session) { session.Log("Begin CustomAction1"); return ActionResult.Success; } } } When I run the MSI, I get this error in the log: MSI (c) (08:5C) [10:08:36:978]: Connected to service for CA interface. MSI (c) (08:4C) [10:08:37:030]: Note: 1: 1723 2: SQLHelperAction 3: CustomAction1 4: C:\Users\NATHAN~1.TYL\AppData\Local\Temp\MSI684F.tmp Error 1723. There is a problem with this Windows Installer package. A DLL required for this install to complete could not be run. Contact your support personnel or package vendor. Action SQLHelperAction, entry: CustomAction1, library: C:\Users\NATHAN~1.TYL\AppData\Local\Temp\MSI684F.tmp MSI (c) (08:4C) [10:08:38:501]: Product: SessionWorks :: Judge Edition -- Error 1723. There is a problem with this Windows Installer package. A DLL required for this install to complete could not be run. Contact your support personnel or package vendor. Action SQLHelperAction, entry: CustomAction1, library: C:\Users\NATHAN~1.TYL\AppData\Local\Temp\MSI684F.tmp Action ended 10:08:38: SQLHelperAction. Return value 3. DEBUG: Error 2896: Executing action SQLHelperAction failed. The installer has encountered an unexpected error installing this package. This may indicate a problem with this package. The error code is 2896. The arguments are: SQLHelperAction, , Neither of the two error codes or messages it gives me is enough to tell me what's wrong. Or perhaps I'm just not understanding what they're saying is wrong. Any ideas on what I'm doing wrong?

    Read the article

  • How do I get the IP Adress of my vpn server

    - by kashif
    I Connect to internet using PPTP connection type from my computer using following setting internet address: blue.connect.net.pk user id: myusername password: mypassword my problem: my dwr-112 router doesn't support internet address name, it rather supports only ip address of the server i.e I'm not able to type blue.connect.net.pk as it only supports server's ip adress. my question: How can I know the ip address of vpn server so that I can configure my dwr-112 router to connect to internet using pptp connection type

    Read the article

  • Magento: Getting Product Url's for Products within a Grouped Product

    - by Nathan
    For a grouped product, I would like to display a link to the simple products it is composed of. For example, if I have a grouped product called Dining Set composed of plates, knives, forks, etc. I'd like each of the subproducts to have a link to that subproduct (click plates goes to the Simple Product for plates) <?php foreach ($_associatedProducts as $_item): ?> <tr> <td><?php echo $this->htmlEscape($_item->getName()) ?></td> <td class="a-right"> <?php echo $this->getPriceHtml($_item, true) ?> </td> <?php if ($_product->isSaleable()): ?> <td class="a-center"> <?php if ($_item->isSaleable()) : ?> <a href="<?php $_item->getProductUrl() ?>">View</a> <?php else: ?> <p class="availability"><span class="out-of-stock"><?php echo $this->__('Out of stock.') ?></span></p> <?php endif; ?> </td> <?php endif; ?> </tr> <?php endforeach; ?> This is a code snippet from the grouped.phtml file in app/design/frontend/blank/default/template/catalog/product/view/type/grouped.phtml In particular the line that has $_item-getProductUrl() This does not work, and I don't know the code needed to get the url for this associated product item. If anyone could help here it would be much appreciated. Also, where on earth can I find the method's available (and how they're used) for Products or Categories or $_item and the like? Thanks, Nathan

    Read the article

  • Rails test db doesn't persist record changes

    - by nathan.f77
    I've been trying to solve a problem for a few weeks now. I am running rspec tests for my Rails app, and they are working fine except for one error that I can't seem get my head around. I am using MySQL with the InnoDB engine. I have set config.use_transactional_fixtures = true in spec_helper.rb I load my test fixtures manually with the command rake spec:db:fixtures:load. The rspec test is being written for a BackgrounDRb worker, and it is testing that a record can have its state updated (through the state_machine gem). Here is my problem: I have a model called Listings. The rspec test calls the update_sold_items method within a file called listing_worker.rb. This method calls listing.sell for a particular record, which sets the listing record's 'state' column to 'sold'. So far, this is all working fine, but when the update_sold_items method finishes, my rspec test fails here: listing = Listing.find_by_listing_id(listing_id) listing.state.should == "sold" expected: "sold", got: "current" (using ==) I've been trying to track down why the state change is not persisting, but am pretty much lost. Here is the result of some debugging code that I placed in the update_sold_items method during the test: pp listing.state # => "current" listing.sell! listing.save! pp listing.state # => "sold" listing.reload pp listing.state # => "current" I cannot understand why it saves perfectly fine, but then reverts back to the original record whenever I call reload, or Listing.find etc. Thanks for reading this, and please ask any questions if I haven't given enough information. Thanks for your help, Nathan B P.S. I don't have a problem creating new records for other classes, and testing those records. It only seems to be a problem when I am updating records that already exist in the database.

    Read the article

  • Auto increment column i JDO, GAE

    - by Viktor
    Hi, I have a data class with some fields, one is a URL that I consider the PK, if I add a new item (do a new sync) and save it it should overwrite the item in the database if it's the same URL. But I also need a "normal" Long id that is incremented for every object in the database and for this one I always get null unless I tags it as a PK, how can a get this incrementation but not have the column as my PK? @Persistent(valueStrategy=IdGeneratorStrategy.IDENTITY) private Long _id; @Persistent private String _title; @PrimaryKey @Persistent private String _url; /Viktor

    Read the article

  • Why must we "change temporary credentials for token credentials" in OAuth?

    - by PK
    Can't the server just "upgrade" the temporary credentials to token credentials and retain the same key and secret? The client can then start doing authenticated calls right away after the recieving the callback from the server stating that the temporary credentials has been "upgraded". Of cause if the temporary credentials have not be upgrade (i.e. client doesn't wait for callback) the authenticated call fails. So the question is why make an extra call to the server after the callback to "exchange" temporary credentials for token credentials?

    Read the article

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