335 Posted Topics

Member Avatar for Darth Vader
Member Avatar for G_S

This can be quite a subjective topic sometimes. Have a look at Active Record versus Repository Pattern eg: http://stackoverflow.com/questions/6522009/active-records-vs-repository-pros-and-cons I think Active Record is not so good anymore so go for the more decoupled design.

Member Avatar for JamesCherrill
0
285
Member Avatar for CaffeineCoder
Member Avatar for DaveAmour
0
191
Member Avatar for tobyITguy
Member Avatar for Treglanu
Member Avatar for JerrimePatient

1. Get the current item from the database 2. Update just the properties you want to change 3. Use the Repository Pattern to execute code simillar to that below public void Update(Contact contact) { using (var context = new EfContext()) { Contact existingContact = context.Contacts.Single(c => c.Id == contact.Id); context.Entry(existingContact).CurrentValues.SetValues(contact); …

Member Avatar for JerrimePatient
0
329
Member Avatar for vegaseat
Member Avatar for vegaseat
0
323
Member Avatar for JerrimePatient
Member Avatar for redleak
Member Avatar for hefaz
0
6K
Member Avatar for Saboor880

Add System.Windows.Forms as a Reference https://msdn.microsoft.com/en-us/library/wkze6zky.aspx?f=255&MSPPError=-2147217396

Member Avatar for DaveAmour
0
2K
Member Avatar for janicemurby
Member Avatar for junzz31
Member Avatar for DaveAmour
0
298
Member Avatar for nimz143
Member Avatar for nimz143
0
350
Member Avatar for chrisschristou

Try this: <script> $(document).ready(function() { $('p').css("font-style", "italic"); }); </script>

Member Avatar for chrisschristou
0
252
Member Avatar for DaveAmour

Do we have any TDD experts here? I have some questions but need an expert.

Member Avatar for DaveAmour
0
141
Member Avatar for Navee30

What is the code doing? If it is on the main thread and it is doing a lot it can freeze the UI. Consider running the code on another thread.

Member Avatar for DaveAmour
0
196
Member Avatar for Lonestar Jack

In your code above is line 2 being run multiple times? Are you wiring the even handler up again and again somehow? Difficult to say without seein the whole thing in context but that's what it sounds like to me.

Member Avatar for Lonestar Jack
0
244
Member Avatar for AmrMohammed
Member Avatar for DaveAmour
1
217
Member Avatar for coder91

Try if (conn.State != ConnectionState.Open) { conn.Open(); } sql.ExecuteNonQuery();

Member Avatar for coder91
0
156
Member Avatar for diafol

I noticed this too on my 27" monitor! It looks fine, I'm just so used to seeing it how it was before that it just takes some getting used to.

Member Avatar for pritaeas
0
187
Member Avatar for killingmonk

It means it could be unassigned. What if someone entered 4? Try: switch (classChoice) { case 1: classChosen = "Fighter"; break; case 2: classChosen = "Priest"; break; case 3: classChosen = "Wizard"; break; default: classChosen = "Unknown"; break; }

Member Avatar for Leslie_1
0
245
Member Avatar for vegaseat
Member Avatar for lithium112
Member Avatar for webdev2
Member Avatar for Blouet
Member Avatar for JerrimePatient

You can set this in your web.config eg: <system.web> <customErrors mode="Off" ></customErrors> <compilation debug="true" targetFramework="4.5" ></compilation> <httpRuntime targetFramework="4.5" ></httpRuntime> <authentication mode="Forms"> <forms loginUrl="~/Account/Login" timeout="2880" ></forms> </authentication> <pages> <namespaces> <add namespace="System.Web.Helpers" ></add> <add namespace="System.Web.Mvc" ></add> <add namespace="System.Web.Mvc.Ajax" ></add> <add namespace="System.Web.Mvc.Html" ></add> <add namespace="System.Web.Optimization" ></add> <add namespace="System.Web.Routing" ></add> <add namespace="System.Web.WebPages" ></add> </namespaces> …

Member Avatar for JerrimePatient
0
175
Member Avatar for phoenix254
Member Avatar for dawbin
Member Avatar for Michael_37
Member Avatar for DaveAmour

# Performing Selective Includes in Entity Framework with the Fluent API # When we are using Entity Framework as our data access choice to work with SQL Server then there are some potential pitfalls. One of these pitfalls is doing selective includes. What do I mean by selective includes? To …

1
4K
Member Avatar for DaveAmour

I finally saw a paypal button on my $Rewards. Perhaps rather optimistically I clicked on it. The page then changed to show the following: "Last Cash Out: Pending for $5.58" Any ideas anyone.

Member Avatar for DaveAmour
0
155
Member Avatar for DaveAmour

I am tinkering with prototypal inheritance in JavaScript. I have the code below and I am trying to find out if there is a way of getting the code which makes Cat inherit Animal actually inside the Cat function - so that it is all niceley encapsulated as one unit …

Member Avatar for Troy III
0
404
Member Avatar for Erica_2

Actualy just noticed in your first bit of code you have this: double food [monkeytot][Wdays]; But then in your second bit you have this: double food[monkeys][Wdays]; Try changing that.

Member Avatar for Erica_2
0
589
Member Avatar for Quazy

I think to do this you need to do a cartesian join with the table on itself and implement the where condition.

Member Avatar for Quazy
0
226
Member Avatar for Gl753
Member Avatar for JerrimePatient
Member Avatar for ramsiva

Here's my go: <script> function CustomDate() { this.date = new Date(); this.dayPart = this.date.getHours() < 12 ? "AM" : "PM"; this.toString = function() { return this.date.getMonth() + "/" + this.date.getDate() + "/" + this.date.getFullYear() + " - " + this.date.getHours( ) + ":" + this.date.getMinutes() + ":" + this.date.getSeconds() + …

Member Avatar for ramsiva
0
246
Member Avatar for moe11223

Hi I'm not a Java Programmer so can't comment on the specifics of your code. However, you should not have any UI code in such a class as it is then tightly coupled to that particular UI. UI operations should be done outside of this class and you should interact …

Member Avatar for stultuske
0
4K
Member Avatar for JerrimePatient

Can you be a little more specific. For example have you already a) Created a MVC project? b) Created a Controller? c) Created a Controller Action? d) Created a View And so on...

Member Avatar for JerrimePatient
0
253
Member Avatar for rosario1990

You will hate it at first, then find it tolerable then you will love it! Do try putting this on though as it will give you an easier transition: http://classicshell.net/

Member Avatar for jim3472
-2
405
Member Avatar for suavedesign

Not sure if this is what you mean or not but try setting the following on topwrapper div: position: fixed; top: 1px; background-color: #414141 Does that help?

Member Avatar for DaveAmour
0
69
Member Avatar for jkon

Always code as if the person who will maintain your code is a violent psychopath who knows where you live.

Member Avatar for Warrens80
0
322
Member Avatar for jd3189

How about this: using System; using System.Linq; namespace Palindrome { public class Program { static void Main(string[] args) { Console.WriteLine("racecar: " + "racecar".IsPalindrome()); Console.WriteLine("dad: " + "dad".IsPalindrome()); Console.WriteLine("mum: " + "mum".IsPalindrome()); Console.WriteLine("dog: " + "dog".IsPalindrome()); Console.WriteLine("floor: " + "floor".IsPalindrome()); Console.WriteLine("Racecar: " + "Racecar".IsPalindrome()); Console.WriteLine("Rac ecar: " + "Rac ecar".IsPalindrome()); Console.WriteLine("Racecar': …

Member Avatar for DaveAmour
0
391
Member Avatar for JerrimePatient

If you are iterating over a collection which has enumerable properties then you can use foreach. For example: foreach (var customer in customers) { Console.WriteLine(customer.FirstName + " " + customer.LastName); } You could also achieve the same with a for loop: for (var i = 0; i < customers.Count; i …

Member Avatar for deceptikon
0
374
Member Avatar for AleMonteiro

I haven't done this for a long time but used to use something called Index Server. This indexed certain folders which you specified and you queried index server much like you query a database - this was mainly for searching file contents I think. You can certainly see what kind …

Member Avatar for AleMonteiro
0
229
Member Avatar for Nguyen_4

Can you debug this and show what the SQL statement parses out to please?

Member Avatar for JerrimePatient
0
130
Member Avatar for no123

Do you have to encrypt BEFORE serializing? Serializing and then encrypting makes far more sense to me. See this for how to serialize: http://www.paxium.co.uk/PublicArticle/Article/493 Then just encrypt the xml. This way you can write one piece of code which will work for anything.

Member Avatar for JerrimePatient
0
465
Member Avatar for overwraith

Don't know if this is any help but this works for me. Connection string is: <add name="OracleConnection" connectionString="User Id=MyUserId; password=MyPassword; Data Source=MyServer:1521/orcl.MyUrl.co.uk; Pooling=false;"/> And code is: private static IEnumerable<Document> GetDocuments(string selectText) { var documents = new List<Document>(); using (var oracleConnection = new Oracle.ManagedDataAccess.Client.OracleConnection(ApplicationConfiguration.ConnectionString)) { using (var oracleCommand = new Oracle.ManagedDataAccess.Client.OracleCommand(selectText)) …

Member Avatar for DaveAmour
0
231
Member Avatar for Ant695

Delete Line 30, 31 and 33 Move Line 32 to after your loop Change "else if ( Number <0)" to "else" - no need to check as it must be less than 0

Member Avatar for DaveAmour
0
255
Member Avatar for AleMonteiro

The End.