|
What does the XML document look like when you retrieve it from the database?
|
# ? Dec 16, 2010 17:27 |
|
|
# ? Apr 25, 2024 16:18 |
|
I figured it out, it was an issue with my classes and the serialization, not the retrieving of the XML. I had to make a blank public constructor in the classes when serializing and neglected to have some of the necessary properties have both get and set. :|
Uziel fucked around with this message at 18:47 on Dec 16, 2010 |
# ? Dec 16, 2010 17:58 |
|
Ugh, dysgraphia strikes again -- missed the distinction between ThisDLBuilder and ThisBLBuilder. You can disregard that comment, but the error you are getting indicates there is something null or you've got a deserialization issue of some sort. Anyhow, a few things to look at: a) Is the Bulder object XML serializable and XML deserializable? Most unit testing frameworks have some good bits to verify this. b) Have we confirmed that you are passing a string into the XmlDeserialize method? b) I'd strongly consider not storing the XML in the same table -- 14k lines is an ugly, ugly load. And it could get loaded anytime you touch the builderDL object depending on ORM and settings.
|
# ? Dec 16, 2010 18:42 |
PhonyMcRingRing posted:1. You can do the quick way and pass the same XAML string to XamlReader. http://msdn.microsoft.com/en-us/library/system.windows.markup.xamlreader.aspx Thanks for the response (and you ljw1004). I won't fight the WPF way and I'll do it in XAML. What's up with the lag in Visual Studio 2010 when you switch from a .xaml file to a .cs file? Is there anything I can do to reduce that? edit: Moving the pane splitter so the Design tab is not visible seems to have eliminated the lag. fletcher fucked around with this message at 20:48 on Dec 16, 2010 |
|
# ? Dec 16, 2010 20:25 |
|
I've got this simple little context menu:code:
How do I fix it?
|
# ? Dec 16, 2010 21:25 |
|
I'm trying to tackle WPF while I'm still in the c#\.net 101 phase. I feel like this is a good idea, as from what I read, wpf is THE way a user interface should be done in windows, and is only slow taking off because too many people are entrenched in the old ways and not willing to take on the learning curve. Anyway, it is a big learning curve, especially for me. I grabbed wpf 4.0 unleashed but it moved pretty drat fast. I feel like I need a copy of baby's first wpf book. Any recommendations on learning wpf?
|
# ? Dec 16, 2010 21:35 |
|
IcedPee posted:How do I fix it? code:
|
# ? Dec 16, 2010 22:05 |
|
That has the proper look to it. It's made my MenuItem_Click pretty much worthless, but after some digging through e.OriginalSource in the event handler, I was able to find the data item I needed. Thanks!
|
# ? Dec 16, 2010 22:39 |
|
Just a quick question i had while I'm going though my Visual Basic book here for studying before my final exam tomorrow. I'm a bit confused on something I'm hoping that can be cleared up here. I know it's simple, but it has just gone over my head. Why in some casses are two variables used in parathenses in an equasion just seperated by a comma? Does a comma have any reasonable use in an equasion? Here's a simple example to show what I mean because I'm sure the explaination by itself doesn't really clarify what I mean. code:
Any help at all would be greatly appreciated! Thanks ButterChugger fucked around with this message at 00:26 on Dec 17, 2010 |
# ? Dec 17, 2010 00:17 |
|
Uziel posted:Any ideas or advice? Are you *actually* going to store this whole serialized object in the ViewState on a live site? If it's not an intranet-only site, you're gonna shoot yourself in the foot when the ViewState gets larger and larger. You also open up the ability for someone to edit the ViewState clientside and do god-knows-what relating to your object. You can use ViewState encryption, but I still wouldn't trust it. fletcher posted:edit: Moving the pane splitter so the Design tab is not visible seems to have eliminated the lag. Yeah, making sure it only shows the xaml without the designer is usually the recommended way to go.
|
# ? Dec 17, 2010 00:48 |
|
Aqua Hamster posted:Just a quick question i had while I'm going though my Visual Basic book here for studying before my final exam tomorrow. That looks like your using a function/method not an equation so i'm not sure what you mean.
|
# ? Dec 17, 2010 01:08 |
|
Sprawl posted:That looks like your using a function/method not an equation so i'm not sure what you mean. Oh poo poo, my bad, that was. Either way, I'm actually still unsure what it even means with multiple variables in paranthesis. I know it's probably something incredibly simple, but it's just not registering with me.
|
# ? Dec 17, 2010 01:10 |
|
Aqua Hamster posted:Any help at all would be greatly appreciated! Thanks A quick google of IPmt gets me this: http://www.techonthenet.com/excel/formulas/ipmt.php So I'm assuming that tutorial is using an Excel function.
|
# ? Dec 17, 2010 01:11 |
|
Aqua Hamster posted:Oh poo poo, my bad, that was. Either way, I'm actually still unsure what it even means with multiple variables in paranthesis. I know it's probably something incredibly simple, but it's just not registering with me. When your doing math like (1+2) * 3 = 9 1 + 2 * 3 = 7 it has to do with order of operations. If the bracket wasn't there it would go 6 + 1 because of BEDMAS ( Brackets, Exponents, Division/Multiplication, Addition/Subraction) If that isn't what your talking about i dont know really.
|
# ? Dec 17, 2010 01:45 |
|
Begby posted:This is just totally shooting from the hip, but when I had permission problems logging into a report server as admin, it was because I had to log in with the local machine specific administrator account. A user with domain admin privileges would not work nor did the AD root administrator account. Thanks for the guess, but that didn't work. The only way it does is if you're actually logged into the server and use http://localhost/reports (doesn't seem to matter who you are logged in as). This is bothersome because I'm pretty sure I know where the problem is (permissions within MSSQL Reporting Services) but I can't seem to edit anything that applies to it, or rather I do, and the interface says account x has access, but then it doesn't let anything in. The weird thing is, I can hit that database through MSSQL Management Studio with every account I've enabled. I can even look at the Roles and Users tables inside of the ReportServer table and see all the lovely changes I've made but nothing is allowed in.
|
# ? Dec 17, 2010 01:52 |
|
Aqua Hamster posted:Oh poo poo, my bad, that was. Either way, I'm actually still unsure what it even means with multiple variables in paranthesis. I know it's probably something incredibly simple, but it's just not registering with me. It looks like the functions IPmt() and PPmt() take 4 arguments...
|
# ? Dec 17, 2010 03:27 |
|
So I've got this nice little block of code to run the contents of an sql against the db (SQL Server 2008 R2 Express):code:
Except my sql file contains naughty words like SET and IF and GO. Here's an excerpt. code:
Anyways things choke on command.ExecuteNonQuery(); saying there's incorrect syntax near "GO" and "IF" and whatnot. So. I have an sql file, and a connection to a database, and I want to run the sql against the database in a transaction. This should be simple, right? So before I go on some codehunt for Microsoft.SqlServer.Management.Smo (I don't think I even have this dll, somehow...), do you have any suggestions/advice on how to run such a script? Do I really need to have my clients install an SMO redistributable to get this working? Alternatively do I really need to tokenize the script on "GO" (which sounds really messy)? Update: Snagged a few dlls from the Microsoft SQL Server directory in Program Files, trying to run something like this code. Couldn't, because "Mixed mode assembly is built against version 'v2.0.50727' of the runtime and cannot be loaded in the 4.0 runtime without additional configuration information". So I "fixed" that by adding useLegacyV2RuntimeActivationPolicy="true" to the startup element of my app.config, now the code runs but gives me "An exception occurred while executing a Transact-SQL statement or batch." which is funny because the same sql file runs fine if I paste it into SSMS. epswing fucked around with this message at 17:56 on Dec 17, 2010 |
# ? Dec 17, 2010 16:56 |
|
AFAIK, the only really naughty word is "GO". Or, splitting SQL on "GO" has worked very well and probably powers 65% of our automated SQL deployment stuff. Another option, if you just need this to be command line scriptable, is a wonderful little utility called SSEutil.exe. Its a very useful little "Execute this sql script from the command line with no dependencies" little tool that also has some management features such as the ability to create and drop databases. Don't let the name fool you, the functions that work on a full blown sql server work great there too.
|
# ? Dec 17, 2010 17:56 |
|
I've got an application set up as a single instance, using WindowsFormsApplicationBase.IsSingleInstance, so that if other programs try to launch it with command line arguments, the instance that is already running can receive those arguments. I'm running into two problems with this; it takes nearly 200ms to for a new instance to start, send its parameters to the main instance, and close, so if a program runs it 20 or 30 times in a row, it takes a while to finish (even though my app doesn't need to do more than half a second of actual work). Worse, if a program does those same 20 or 30 runs in parallel instead of sequentially, some of the new instances can starve and crash ("This single-instance application could not connect to the original instance"). Is there a better way to do this?
|
# ? Dec 17, 2010 20:16 |
|
Zhentar posted:I've got an application set up as a single instance, using WindowsFormsApplicationBase.IsSingleInstance, so that if other programs try to launch it with command line arguments, the instance that is already running can receive those arguments. I'm running into two problems with this; it takes nearly 200ms to for a new instance to start, send its parameters to the main instance, and close, so if a program runs it 20 or 30 times in a row, it takes a while to finish (even though my app doesn't need to do more than half a second of actual work). Worse, if a program does those same 20 or 30 runs in parallel instead of sequentially, some of the new instances can starve and crash ("This single-instance application could not connect to the original instance"). I don't know about passing command line arguments over from the new instance to an old one, but to just enforce single instance you can create a Mutex with the name like "MyApplication" and check its out parameter to check if you were the first one to create it. If you were, you're the first instance and you need to flag that object with GC.KeepAlive so it stays around until your application closes. If you open the mutex and you weren't the first to create it, you know there's another process floating around out there already.
|
# ? Dec 18, 2010 00:28 |
|
I'm trying to get and set the position of a scroll bar in C#. GetScrollInfo works fine, but I'm having some trouble with SetScrollInfo, which is throwing an AccessViolationException when I call it. Here's my method signature and hows it's being called.code:
|
# ? Dec 18, 2010 00:31 |
|
SCROLLINFO probably isn't marshalling properly, you probably need to add a ref there.
|
# ? Dec 18, 2010 01:11 |
|
I have now found I have an excessive amount of spare time on my hands- forced into switching to part time for school, hours getting cut at work, distance relationship with the girlfriend. So I have copious amounts of time, and I want to try and do something constructive. I have my associate's in IT / Software, but I really don't know gently caress all. I was hardly even taught how to work with classes. Either way, I want to brush up on my C# so I can actually do stuff, but I have no idea where to start. I can't come up with a program I'd like to make, anyone have any tips on how to motivate myself? Any websites out there that have 'homework assignments' so I can try and do something? Learning how to do stuff with graphics would be awesome, but I guess one step at a time.
|
# ? Dec 18, 2010 03:24 |
|
Ugg boots posted:I don't know about passing command line arguments over from the new instance to an old one, but to just enforce single instance you can create a Mutex with the name like "MyApplication" and check its out parameter to check if you were the first one to create it. If you were, you're the first instance and you need to flag that object with GC.KeepAlive so it stays around until your application closes. If you open the mutex and you weren't the first to create it, you know there's another process floating around out there already. Seemed like too much trouble to go through all that, so I just made it a No-Instance app (e.g. Main doesn't do anything) and it still takes a bit over 100ms per instance. I'm going to assume that means no .NET program will start up fast enough to satisfy me here, so I'll do something lightweight in C++ to handle this instead.
|
# ? Dec 18, 2010 04:03 |
|
Sab669 posted:I have now found I have an excessive amount of spare time on my hands- forced into switching to part time for school, hours getting cut at work, distance relationship with the girlfriend. So I have copious amounts of time, and I want to try and do something constructive.
|
# ? Dec 18, 2010 19:31 |
|
Sab669 posted:I have now found I have an excessive amount of spare time on my hands- forced into switching to part time for school, hours getting cut at work, distance relationship with the girlfriend. So I have copious amounts of time, and I want to try and do something constructive.
|
# ? Dec 18, 2010 22:22 |
|
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 know I don't understand enough about the way assemblies and the GAC and all that stuff works, and now it's coming around to bite me in the rear end. How do I fix this problem?
|
# ? Dec 18, 2010 23:59 |
|
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 |
|
Derpes Simplex posted: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. Oh good lord why didn't I think of that e: ok, how do I fix this? I'm not relying on any 4.0-specific code (that I know of), but I can't figure out how to get the project to "indirectly reference" 3.5 versions of assemblies instead of 4.0 versions (even when I change the targeted profile in the application tab of the project settings and remove all the references) raminasi fucked around with this message at 03:04 on Dec 19, 2010 |
# ? Dec 19, 2010 02:45 |
|
gibbed posted:SCROLLINFO probably isn't marshalling properly, you probably need to add a ref there. This worked, thanks! I found out that while this scrolls the scrollbar to a position it doesn't actually scroll the listview I'm working with. The solution was alot easier than all of the calls to unmanaged code, just set TopItem of the listview.
|
# ? Dec 19, 2010 14:03 |
|
I just loaded VS2010 ultimate on a clean install of win7 and the development server is extremely slow whenever I try and run an aspx application. Every page starts off as 'Page Cannot Be Found', but if I refresh it after a minute I get the page. Any settins I need to tweak?
|
# ? Dec 19, 2010 18:28 |
|
Nurbs posted:I just loaded VS2010 ultimate on a clean install of win7 and the development server is extremely slow whenever I try and run an aspx application. Every page starts off as 'Page Cannot Be Found', but if I refresh it after a minute I get the page. I saw that with IE9. When I reverted to IE8 it worked properly.
|
# ? Dec 19, 2010 18:52 |
|
Nurbs posted:I just loaded VS2010 ultimate on a clean install of win7 and the development server is extremely slow whenever I try and run an aspx application. Every page starts off as 'Page Cannot Be Found', but if I refresh it after a minute I get the page. This information might be helpful: http://stackoverflow.com/questions/2382741/slow-performance-asp-net-aspnet-wp-exe-and-csc-exe-running-after-clicking-red
|
# ? Dec 19, 2010 20:48 |
|
Sab669 posted:I have now found I have an excessive amount of spare time on my hands- forced into switching to part time for school, hours getting cut at work, distance relationship with the girlfriend. So I have copious amounts of time, and I want to try and do something constructive. I'm still just starting out too, and this is my opinion as a beginner. Keep in mind though that I am tackling this as a pure hobby. I have no plans to ever make money programming. Do nothing with forms(gui) at first. Keep it all console, or you'll be spinning your wheels for hours on things that will be no big deal later. I started by going through this http://www.csharp-station.com/Tutorial.aspx for the basics. Don't get caught up if something gives you trouble(delegates were murder on me). Anything that is rough on you will all make sense as soon as you NEED them to get whatever you are wanting to get done, done. From there I worked through the first 10 project euler problems, after that they got to be more about the math tricks than the programming to me. To get more in depth, I grabbed this book http://www.darelease.com/ebooks/484267-c-for-programmers-2nd-edition.html and I have been very happy with it. I also got c# in depth, but it's pretty far over my head and I would not recommend it for a beginner.
|
# ? Dec 19, 2010 22:44 |
|
Crosspost, but there is some interested in a functional programming thread. Which, to a large extent means a F# thread. If anyone here feels qualified to start it up please do.
|
# ? Dec 20, 2010 15:56 |
|
Another epswing wall-of-code table-breaking post. I'm having a hard time putting into words what my problem is, so I'm going to paste some code and hope the point makes it across the chasm. Here's my dbml auto-generated code: code:
code:
code:
When I do code:
code:
Halp! Note 1: this guy explains the problem similarly, and fixes it with a cast, but that doesn't really work in my inheritance scenario. Note 2: The above code is very stripped down and simplified just to get the point across, let me know if you need to see more, if I've left out anything essential. epswing fucked around with this message at 19:52 on Dec 20, 2010 |
# ? Dec 20, 2010 19:39 |
|
^^^Any reason you can't use interfaces here instead? That would dodge 95% of the issues you are having. That and in general LINQ2SQL generated classes + extension of said class has more landmines than mozambique.
|
# ? Dec 20, 2010 20:27 |
|
wwb posted:^^^Any reason you can't use interfaces here instead? That would dodge 95% of the issues you are having. I was going to ask how that would help me, until I realized that C# lets me specify properties in an interface. Awesome. (The reason is I'm still infected with Java)
|
# ? Dec 20, 2010 22:03 |
|
Linq to Sql's attribute mapping doesn't work with inherited properties. You'd have to override the property and reimplement the ColumnAttribute on each one.
|
# ? Dec 20, 2010 23:46 |
|
|
# ? Apr 25, 2024 16:18 |
|
PhonyMcRingRing posted:Linq to Sql's attribute mapping doesn't work with inherited properties. You'd have to override the property and reimplement the ColumnAttribute on each one. Uhm, no you don't It (probably) won't work on an interface, but on a abstract/virtual property it will work just fine.
|
# ? Dec 21, 2010 09:55 |