|
Ugg boots posted:Edit: Nevermind, figured it out! Thanks! Please say how for the next person! And I figured this is the best place to ask, interest check in Silverlight Megathread?
|
# ? May 30, 2008 18:02 |
|
|
# ? Jun 10, 2024 09:46 |
|
Fastbreak posted:And I figured this is the best place to ask, interest check in Silverlight Megathread? Well it wouldn't be any worse than the REMEMBER IF THIS HELPS PLEASE MARK AS ANSWERED AND DONT FORGET TO GO TO MY BLOG ALSO I'M A MS MVP drivel all over the official forums.
|
# ? May 30, 2008 18:41 |
|
Not really a .Net question but what's the best practice for chaining .msi installers? I have a Visual Studio 2008 Deployment Project Installer from which I need to install Apple Bonjour. Since Apple only has a .msi avaiable I need to launch their .msi from mine. I've found something called Bootstrapper Manifest Generator that looks like it should work but I'm wondering if there's a better way to go about this.
|
# ? May 30, 2008 22:53 |
|
Edit: So I woke up this morning and I was a lot less stupid somehow. This is how I have it written now. Is there anything I could do better?code:
I can do it by catching all of the responses in a List and sorting etc, but that would to be missing the point of the exercise. I'm still getting a hang of the different ways to select data, so different examples are welcome. Dr. Poz fucked around with this message at 16:51 on May 31, 2008 |
# ? May 31, 2008 04:05 |
|
Is there a way to generate a treeview node collection from a flat list of directories?code:
|
# ? May 31, 2008 22:36 |
|
Intel Penguin posted:Is there a way to generate a treeview node collection from a flat list of directories? Not very pretty, and assumes that filename == last part of path and filename.contains("."). code:
code:
|
# ? Jun 2, 2008 09:56 |
|
esp posted:
|
# ? Jun 2, 2008 11:37 |
|
gibbed posted:Is there something wrong with Path.GetDirectoryName()? What do you mean? How would that solve the "requirement"?
|
# ? Jun 2, 2008 11:46 |
|
esp posted:What do you mean? How would that solve the "requirement"? Something like this, code:
|
# ? Jun 2, 2008 12:08 |
|
gibbed posted:Something like this ... Ah, okay. That really does the same thing(but accepts duplicates and skips paths with no filename) in this case, but yes; letting the framework handle file/dir-paths is a good idea.
|
# ? Jun 2, 2008 13:35 |
|
esp posted:Ah, okay. That really does the same thing(but accepts duplicates and skips paths with no filename) in this case, but yes; letting the framework handle file/dir-paths is a good idea.
|
# ? Jun 2, 2008 13:44 |
|
OK, ASP.NET question for the folks here. I've got a GridView, which I'm using to display data, and have a footer row which allows for a quick insert of new data. It's part of a Master/Detail page, with the detail section also allowing for long-form inserts. Because of this, I have my validators in the two sections broken into two distinct Validation Groups. The long-form validators are fine, and work just as they should. The short form validators, though, have a slight problem in working. They do run, and they do properly validate my data, which is good. However, when the validator fails, the ErrorMessage on the validator does not appear in the Validation Summary which is part of the validation group, and the validator itself is not made visible. It does cause Page.IsValid to be set properly, so my insert operation is stopped and I display a message at the top of the screen that there was an error in processing, but the validation summary isn't populated with the error messages, and the validators which were tripped are not made visible to indicate the fields that are problematic. It's driving me nuts, because the validators are stopping the database insert when accurate, and allowing it to proceed when validation is successful, but there's no indication of which field failed validation and why.
|
# ? Jun 2, 2008 22:04 |
|
thefncrow posted:OK, ASP.NET question for the folks here. I've got a GridView, which I'm using to display data, and have a footer row which allows for a quick insert of new data. It's part of a Master/Detail page, with the detail section also allowing for long-form inserts. Because of this, I have my validators in the two sections broken into two distinct Validation Groups. The long-form validators are fine, and work just as they should. Did you ensure that the "Display" (not "Visible") properties of the validators that aren't showing in the summary are set to "None"? It's required to be for the validation summary to work correctly.
|
# ? Jun 2, 2008 22:34 |
|
Okay, I am trying to make a custom server control. I get the concept and making public properties blah blah. One thing I am trying to do, though, is database access of some kind, and I don't seem able to do this from within the class library. What is the best way to do this, or simulate this? Specifically, I am just doing this as an excercise but I'm trying to recreate something I saw at work, which was a CMS. Obviously the add/delete/edit for content is dead simple, the tricky part comes in the display, and one technique I've seen is using a server control where you simply assign it a querystring var to watch for (or it defaults to "id") and it uses that variable to grab the right piece of content from the DB and write it out to the page. It seemed simple in theory but I don't get how the DB access works there.
|
# ? Jun 3, 2008 00:10 |
|
Girl With Huge Tits posted:Edit: So I woke up this morning and I was a lot less stupid somehow. This is how I have it written now. Is there anything I could do better? http://msdn.microsoft.com/en-us/library/bb386972.aspx Has an example of using a lambda in Max to select the field out inside the query. code:
code:
|
# ? Jun 3, 2008 19:16 |
|
Any libraries to suggest for voice recognition with mobile devices?
|
# ? Jun 3, 2008 20:02 |
|
Man, I'm trying to speed up one tremendously slow part of our web application and it's putting me on a hellride. I'm using the BeginInvoke() method in order to spawn a new thread in order to take care of some database work. The problem is calls a few things from HttpContext.Current because we have a couple of small things (Like say the Username) stored in session. The problem is that the thread doesnt seem to have an instance of the HttpContext object on there, so it's stating that it's null or not an object at several points. Is there any simple way to handle this, or am I going to have to retool a lot of these methods to take whatever we're grabbing from the HttpContext object before the thread spawns?
|
# ? Jun 3, 2008 22:15 |
|
Fastbreak posted:Please say how for the next person! You just do something like: code:
|
# ? Jun 4, 2008 06:55 |
|
Can someone explain the yield statement in terms an idjit (me) can understand?
|
# ? Jun 4, 2008 11:35 |
|
It's as if every time it hits yield return, it adds the returned object to an enumerable and then at the end returns the whole thing. This could be thought of as returning an enumerable that will give you 1 then 2. [code] yield return 1; yield return 2; [code] Behind the scenes what actually happens is that each time you ask for the next element it runs the method until it hits a yield return, returns an object, and saves the state of the method. Next time you ask for the next element, it starts where it left off and eventually returns the second element.
|
# ? Jun 4, 2008 12:59 |
|
Is there a program or plugin somewhere I can use to clean up/reformat/prettify .ASPX files? I have ReSharper, and its Code Clean-Up does a nice job with my .CS files but it ignores all the front-end ASP.NET stuff.
|
# ? Jun 4, 2008 15:27 |
|
poopiehead posted:It's as if every time it hits yield return, it adds the returned object to an enumerable and then at the end returns the whole thing. Except that one of the neat things about yield is that it doesn't create intermediary, temporary lists. If you call something that uses yield, and you only iterate through the X first items, only those X items will be created in the yielding function. It does not create the entire list first and then return it, it just creates the ones you need, one item at a time, when you need that item. So, saying that it's like making an enumerable first and then returning it may look like a good way of explaining it, but unfortunately it's wrong.
|
# ? Jun 4, 2008 16:11 |
I'm looking for an open source .net charting suite. Any recommendations?
|
|
# ? Jun 4, 2008 19:48 |
|
fletcher posted:I'm looking for an open source .net charting suite. Any recommendations? I think somebody asked for the same thing (and got an answer) a couple of pages ago.
|
# ? Jun 4, 2008 21:05 |
|
uXs posted:So, saying that it's like making an enumerable first and then returning it may look like a good way of explaining it, but unfortunately it's wrong. That's why I wrote the second paragraph......
|
# ? Jun 5, 2008 00:31 |
|
FinkieMcGee posted:Man, I'm trying to speed up one tremendously slow part of our web application and it's putting me on a hellride. This article seems to talk about exactly your issue (and links an MSDN article that might help too): http://www.odetocode.com/Articles/112.aspx
|
# ? Jun 5, 2008 01:07 |
|
Myrddin Emrys posted:Okay, I am trying to make a custom server control. I get the concept and making public properties blah blah. One thing I am trying to do, though, is database access of some kind, and I don't seem able to do this from within the class library.
|
# ? Jun 6, 2008 18:58 |
|
I'm creating an application to automate the updating of data in a DB by uploading an Excel spreadsheet via web form. Here's my method:code:
|
# ? Jun 6, 2008 20:21 |
|
Myrddin Emrys posted:Anyone have any ideas? Going to need more detail here. If you give a limited concrete example of what you want to do, it would be easier to help. I'm not sure what you mean by not being able to do this from within the class library. It's definitely possible to access the database, but you need to be careful of some things, for example, if you have 5 identical or nearly identical controls, you're probably hitting the database 5 times when you could have done it once.
|
# ? Jun 7, 2008 00:49 |
|
uh zip zoom posted:Anyone know how to do this? just thought I'd bump this thread to see if anyone had any ideas for me.
|
# ? Jun 9, 2008 15:11 |
|
You have to use the bulkmapping thingy to map the fields from the source to the destination. This includes an example: http://msdn.microsoft.com/en-us/library/system.data.sqlclient.sqlbulkcopycolumnmapping.aspx
|
# ? Jun 10, 2008 13:31 |
|
Begby posted:You have to use the bulkmapping thingy to map the fields from the source to the destination. This includes an example: yes, I realize that. My problem is that I don't know how to refer to the columns in the Excel spreadsheet.
|
# ? Jun 10, 2008 16:02 |
|
uh zip zoom posted:yes, I realize that. My problem is that I don't know how to refer to the columns in the Excel spreadsheet. Did you try using an integer to refer to the column number? You can pass integer values into the SqlBulkCopyColumnMapping constructor.
|
# ? Jun 10, 2008 21:49 |
|
I'm looking to get into C# development. I'm in an odd place of having familiarity with a lot of programming concepts and syntax but not all of them. I can't stand the idea of sitting through another tutorial that teaches me hello world and for loops. I know MSDN has a great library for syntax references, so that takes care of that. What I'm looking for, specifically, is a good source of commented C# code in varying levels of complexity. Enough so I can glance over some code and start to get an idea of how it works and see the thought processes behind it. Does something like this exist? I don't know if it's in huge demand, but it seems to me like the best way for me to learn about a language, especially without a specific goal in mind.
|
# ? Jun 11, 2008 01:19 |
|
Currently our legacy Delphi-app uses a reporting tool called ReportBuilder which had a nice linkable designer and possibilities to hook into the diffirent parts which basically means we can integrate it fully in our app. With the move from Delphi to C# this is one of the major components that we still don't have a competent replacement for. Are there any nice solutions out there that allow for a seamless integration of the report-designer into your app and nice extensibility.
|
# ? Jun 11, 2008 07:44 |
|
Visual Studio ships with Crystal Reports, and supports SQL Server Reporting Services natively as well. Either one supports Windows Forms controls that can be embedded in your application rather seamlessly. I think Reporting Services is a better platform, but Crystal is more mature. Depending on your needs, one or the other should give you what you want. edit: Sorry, I misread your question. I'm not sure of the report *designer* embedding options those solutions provide. I vaguely recall doing that with Crystal Reports one a throwaway project back in the .NET 1.0 days, so it might be possible.
|
# ? Jun 11, 2008 16:30 |
|
I must be doing something stupid here-- using SQL Compact. I insert a row into a table and it says it's ok (even though I can't see it using the Server Explorer), but then if I try to get a value back it fails.code:
Edit: Another stupid mistake. the ID actually WAS null. Dromio fucked around with this message at 16:25 on Jun 12, 2008 |
# ? Jun 12, 2008 14:33 |
|
This is more of a quiz than a real question, but its interesting nonetheless. Lets say that you are inserting a row in the DB, but the DB connection is declared in the instantiation of the SqlCommand, not as its own variable. Lets say a freak accident happens, and the webconfig or whatever is messed up and the GetSetting function below returns null instead of a real string for the connection. It will go to the catch block naturally and return false so the parent function knows the insert failed and we should return a nice friendly error message to the user. But you see, since we never opened a connection, the finally block where we close the connection will fail and throw an ugly server errror message. We also never created a valid connection object associated with the command I think, so checking to see if its open will fail too. So what should you put in the finally block in this case ONLY changing the finally block? Well I guess small changes elsewhere would be okay to, like changing a property, but no new variables. code:
|
# ? Jun 13, 2008 17:28 |
|
I'm not sure the exact point of the quiz, because I would write that like this: (I made up ConnStr and CommandText because I couldn't remember what they were) code:
|
# ? Jun 13, 2008 17:50 |
|
|
# ? Jun 10, 2024 09:46 |
|
Fastbreak posted:This is more of a quiz than a real question, but its interesting nonetheless. In your finally block, just test the state of the connection before you try to close it. It will probably be null, or the state property will show it as being not open, step it through a debugger to see.
|
# ? Jun 13, 2008 18:36 |