|
So I'm trying to come up with a way to display my data in a TreeView. The important part is that each entity has an ID (obviously) and a parent ID which has a foreign key on ID in the same table. More precisely:code:
Click here for the full 804x148 image. So there is indeed some sort of hierarchy going on. To read the data, what I currently have is: code:
Click here for the full 1099x615 image. Is there anything obvious I'm missing here? Perhaps an artifact of TreeView? Is there a better way to be fetching everything?
|
# ¿ Dec 22, 2009 02:23 |
|
|
# ¿ Apr 28, 2024 17:41 |
|
Triple Tech posted:What's a good name for a function that validates a string against a set of known values and returns null otherwise? I'm rather fond of the interrogative form - IsValidFruit might be a good choice.
|
# ¿ Jan 28, 2010 04:50 |
|
Crazak P posted:I'm not quite sure if this is the place to ask, but I'm trying to learn asp .net with mvc. If you're using LINQ-to-SQL, you can use functions directly (drag them from the server explorer to the design surface). Not sure about EF but I presume you can there as well. I personally do all the data filtering and processing in the controller but there's no rule or pattern dictating that.
|
# ¿ Mar 30, 2010 06:47 |
|
Crepthal posted:I'm trying to figure out how to connect to an active directory and simply check if one specific user's password is set to expire in Visual Basic .NET If you're using .NET 3.5, look at the System.DirectoryServices.AccountManagement namespace.
|
# ¿ Apr 3, 2010 12:32 |
|
Sweeper posted:I have a quick asp.net publish question. I have a class that tracks visits to pages, but I don't want it to do that on my local host, so I have a define that will make it so code is not used is I define the "define" (okay...). You can check if HttpContext.Current.Request.Url.AbsoluteUri.StartsWith("http://localhost:") is true. Quebec Bagnet fucked around with this message at 06:23 on Jul 29, 2010 |
# ¿ Jul 29, 2010 02:08 |
|
Kekekela posted:I've been sending a json request then returning a JsonResult and using jQuery to parse the result out into wherever it needs to go. I return a PartialViewResult from the server and use jquery's .html() function to replace the div that contains the original partial view. Same effect, works very cleanly.
|
# ¿ Sep 25, 2010 01:54 |
|
fletcher posted:Is there any issue with having two versions of System.Data.SQLite on the same machine? I want to have one project that uses an older version (1.0.48.0) and one that uses the latest version (1.0.66.0). Anything I need to know about doing something like that? Assemblies are uniquely named by version (and a couple of other things). As long as both exist and can be reached when the referencing assembly is loaded there won't be a problem. quote:What do you generally use for persistence? I've read about NHibernate and the Entity Framework, both of which sound heavy, and have played around with SubSonic, which seems nice but it's too early to tell. I'm rewriting my MVC apps to use NHibernate with the Fluent interface (coming from LINQ2SQL) and it seems pretty nice. A little heavy, yes, but easy enough to abstract away.
|
# ¿ Oct 19, 2010 23:55 |
|
So is it better to keep a service running (which both runs periodic tasks and needs to respond to user actions) or to run asynchronous WCF calls? I haven't seen much on how WCF deals with long-running processes. The longest periodic task I need to deal with in my app is a weekly video encoding (accomplished by spawning an ffmpeg process) which usually takes 20-25 minutes. The other scheduled tasks are around a minute or less (log rotation, database verification, etc). Right now I have a service running that uses NCrontab, but I wonder if WCF might be a cleaner solution. I'm also interested in building an API and the DataContract stuff looks pretty nice, and integrating them sounds good on paper, but I'm not sure if it will end up more trouble than it's worth (like blocking API clients while waiting on ffmpeg to finish), even with asynchronous calls to WCF and spawning threads on the server side. I'm using IIS6 as well.
|
# ¿ Oct 22, 2010 01:47 |
|
Make the variable in question private static?
|
# ¿ Nov 28, 2010 04:50 |
|
GrumpyDoctor posted:I have an F# assembly that has as one of its dependencies the F# core assembly (naturally). Another of its assemblies is a different library that also depends on the F# core assembly. However, when I try to create an installation project, the project detects two different F# core assemblies (one with a path in the GAC somewhere and one in the Visual F# program files directory) and tries to install them both. Since they have the same name, only one of them ends up on the target machine, and then the application doesn't work because it can't find the F# core assembly. I'll bet you're referencing two different versions of the assembly. Make sure both are targeting the same version of the .NET runtime, for starters.
|
# ¿ Dec 19, 2010 00:56 |
|
Is there really no way to do a DNS SRV record lookup with System.Net.Dns.GetHostEntry()? There's DnDns, which I don't mind using, but it would be nice if there's something already in the framework.
|
# ¿ Jan 13, 2011 06:23 |
|
epswing posted:If you had a .NET project in need of an installer, which would you use and why? WiX is nice.
|
# ¿ Apr 12, 2011 19:00 |
|
Sounds right, I've always just selected, changed the properties, and called Save().
|
# ¿ May 8, 2011 19:12 |
|
So I'm wondering how to redesign my database layer. Right now the majority of this project does direct LINQ-to-SQL queries, which I now realize is bad. I'm planning on first redoing the ORM (most likely with SubSonic), and I also want to build an API using WCF. Where should I separate updating/querying logic from database updating? Right now the application is a few ASP.NET projects and some supporting tools. Should I put all of the logic in the API and then call it directly from my app since they're standard .NET methods? I say call it directly because it would seem, for performance reasons, that it's inconvenient to set up a complete WCF connection to handle each page load. Or should I put the logic in the DB layer, call that directly from my own code, and make the API expose that?
|
# ¿ May 13, 2011 04:21 |
|
Nurbs posted:If you're on .net 4 scrap whatever you've written and embrace System.DirectoryServices.AccountManagement 3.5 Active Directory stores group members by DN (the full CN=... form). Once you get the DN you can query for that user specifically (I believe there's a method on DirectorySearcher to look up something by DN) and the fields you want to read are the sAMAccountName or userPrincipalName.
|
# ¿ Jun 7, 2011 04:18 |
|
Smugdog Millionaire posted:But I don't know how best to handle add/remove. What's the fastest way to go about building that? I solved this problem by using an AJAX delete button on each row that did a GET on "/ajax/deleteItem/{id}" and a global add item button that called "/ajax/createItem/{parentID}". The deleteItem and createItem methods returned a PartialView that was the entire new state of the table (this worked because there were only a few items in the table).
|
# ¿ Jul 20, 2011 22:06 |
|
Tapatio posted:Well I'm already using Mono and figured out that mcs.exe is the compiler. I've compiled executable files so far but I'm wondering if there is some way to compile to "object" files (.o) as you would with C/C++ (or their C# counter part). I'm still having trouble figuring out these assembly things. You compile the files for each assembly all in the same compiler invocation.
|
# ¿ Aug 12, 2011 03:44 |
|
Is GhostDoc Pro really worth it? I've been using the free edition and it's been working fine, is it worth shelling out?
|
# ¿ Dec 31, 2011 22:52 |
|
wwb posted:Totally speaking out of conjecture here, but will it be like the .NET 2.0 / .NET 3.5 thing we lived through for most of the past decade? Situation was .NET 3.5 compiled down to 2.0 MSIL and was really compiler stunts and syntactic sugar. All your app pools were set to 2.0.5070whatever even if your apps were all built in .NET 3.5 with linq and such. There was mscorlib 2.0, mscorlib 3.0, mscorlib 3.5 all targeting the 2.0 CLR...but there will be mscorlib 4.0 from the 4.0 framework and mscorlib 4.0 from the 4.5 framework both targeting the 4.0 CLR. I don't get the sudden reversal of practice which worked just fine last time around.
|
# ¿ Jan 6, 2012 06:14 |
|
No Safe Word posted:Generally speaking, MVC is The Way Forward and should be what you default to unless you have a good reason to use WebForms instead. My excuse for developing WebForms in 2012 is that I'm using Ext.Net and it fits into the WebForms model pretty well.
|
# ¿ Jan 7, 2012 00:22 |
|
Mono implements most of the .NET framework. Some of the newer stuff is missing or incomplete, and there's a nontrivial amount of classes in .NET that are specific to Windows, for which they sometimes provide equivalent operations in the Mono namespace. They have a tool that will scan your binaries and report on what is unlikely to work when run on Mono.
|
# ¿ Jan 11, 2012 00:07 |
|
boo_radley posted:These were good suggestions! The cacheing overhead has its own impact at around 7,000 users that seems to outweigh the time to do a raw query. However it seems like we're just doing too much in one monolithic process: 35,000+ users and 2 to 10 AD groups per user averaging 12s/1,000 group-users will take a bit over 8 hours to run. We're just doing too much with too many people all at once. Could you divide the workload (by, say, first character of last name) across multiple machines and domain controllers to cut down on run time?
|
# ¿ Apr 5, 2012 04:14 |
|
Orzo posted:Oh, that reminds me of a question I had. Can someone explain why ASP.NET MVC is such a big deal these days? Why should I use it? Note that I don't need an explanation of why MVC is a generally a good design construct, as I've been using the MVC pattern in fairly complex ASP.NET applications for years now. What does the MVC framework actually provide? Off the top of my head:
e: wither posted:ASP.NET MVC is absolutely what you want. Unless you're interacting with an existing Active Directory setup or something you just want to use forms authentication anyways.
|
# ¿ Jul 14, 2012 23:32 |
|
wwb posted:AD with forms auth is pretty easy. What you want to do is use the AD membership provider, an AD connection string and forms auth: Looks handy, thanks.
|
# ¿ Jul 15, 2012 04:06 |
|
So, WCF and MSMQ integration. I needed to have a service be asynchronous and fire-and-forget preferably with reliable delivery. (It's a video encoding service for our CMS, an encode job takes 5-10 minutes so we'd prefer to have people upload their video and then be returned to the web page ASAP.) MSMQ seemed to hit all of those points, so I chose to use that on the server and client and so far it's working fine. But now I'm reading that WCF backed by MSMQ is apparently the new hotness. I already talk to my background processes over WCF anyway, but only for synchronous operations. Is that what I should be doing?
|
# ¿ Sep 6, 2012 19:39 |
|
They're going to at least be on the same LAN, if not same machine. The biggest change that would happen is that I might have to multicast messages which is easy enough to get running.
|
# ¿ Sep 6, 2012 20:15 |
|
CapnAndy posted:I'm wading into fairly obscure territories here, so I understand if nobody has an answer for this one, but: Try turning on NHibernate logging.
|
# ¿ Sep 18, 2012 16:42 |
|
epalm posted:No seriously, is anyone using MSMQ? If so, do you love it? If so, do you have a favourite MSMQ book? I found it fairly straightforward to send and receive messages. What are you trying to do with it?
|
# ¿ Sep 25, 2012 22:08 |
|
See if your server or client machine is configured to disallow unencrypted or low-encryption connections or otherwise have trust (e.g. they are in the same domain or trusted forest). This states that MSMQ tries to use an encrypted RPC channel, which will fail if the allowed encryption methods don't line up or there is not sufficient trust. You can also look at the problem a different way and see if you can configure message routing on the remote machine to send messages that you're interested in to your local machine.
|
# ¿ Sep 25, 2012 23:49 |
|
Unless I'm reading wrong I'm not seeing how you need IIS on the client, you should only need it on the server.
|
# ¿ Sep 26, 2012 03:26 |
|
Prefect Six posted:I'm dumb and obviously didn't pay close attention to the beginning variables chapter but why does The result of dividing an integer by an integer is an integer.
|
# ¿ Oct 3, 2012 02:14 |
|
Prefect Six posted:So how do I make C# perform mathematical equations? Put everything in a variable? Correct. You can specify 1f or 1.0f or 1.0 to create a double, or 1M or 1.0M to create a decimal. With no decimal point and no suffix the compiler will assume you mean an integer. In certain cases it will trigger a compiler error.
|
# ¿ Oct 3, 2012 02:25 |
|
Is there a significant performance difference loading a workflow activity from XAML versus defining it entirely in code?
|
# ¿ Nov 22, 2012 09:43 |
|
PDP-1 posted:Is it possible to alias the name of a class sitting in one namespace so that it looks like it is a member of another namespace? Maybe I'm misunderstanding what you're asking, but couldn't you just subclass FourthParty.Bar in your namespace without any implementation?
|
# ¿ Jan 1, 2013 02:53 |
|
Uziel posted:Are there any examples of practical implementations for this? I've looked around at some examples but I don't fully understand the benefit of this vs using a database (it would likely be cross server and used across many applications as this would address a point of failure for all of our web apps). There's nothing really stopping you from writing messages to a database and having a process watch for new rows. One of the big benefits of using a message queue is asynchronous access, with multiple independent simultaneous readers and writers. The other is durability - you could just send an HTTP request and wait for a response, but if either you or the server crash in the middle, you've lost the message. But with durability guarantees, senders can basically just send a message and assume that it will be picked up. Some other benefits are correlation (allowing you to specify that a message is in response to another one), triggers, multicasting, Internet routing, WCF integration, and Active Directory integration to route messages to the recipient machine or queue. I had a really long MSMQ example written up but it was kinda spergy so I'll just say that in your case it would be really simple, just have a single process running on a server somewhere that receives messages from a queue and then grabs the email data out of them and sends. Clients could probably just fire-and-forget. There are a variety of ways to handle exceptions, and here's some ideas.
|
# ¿ Jan 14, 2013 06:54 |
|
Can you make an assembly you share between both projects which defines the common classes, and subclass in either as necessary?
|
# ¿ Jan 15, 2013 22:31 |
|
I had a slightly easier time implementing WCF when I decided to create my own client channel factory rather than letting VS autogenerate the client.
|
# ¿ Jan 23, 2013 02:18 |
|
What kind of trouble are you having? What do you need to do with the KML files?
|
# ¿ Feb 23, 2013 16:42 |
|
fadderman posted:Entity Framework don't work nativly on windows phone so if i should use EF i would need to program a server app, then a api and last i would have to program a way for the phone to use the api i created. That a lot of work, and i am not that familier with C# either so keeping everything locally is a lot easier Okay, so you need to manipulate an XML document with a known and documented format. What trouble are you running into?
|
# ¿ Feb 25, 2013 00:24 |
|
|
# ¿ Apr 28, 2024 17:41 |
|
PhonyMcRingRing posted:It's almost as bad as video coding examples. A friend of mine defended these by saying he was a "visual learner." I recognize that some people genuinely learn better by watching an example, but typing code into an editor?
|
# ¿ Mar 2, 2013 00:34 |