Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
R

Red_Wizard_Shot_The_Food

@Red_Wizard_Shot_The_Food
About
Posts
115
Topics
77
Shares
0
Groups
0
Followers
0
Following
0

Posts

Recent Best Controversial

  • Mixing Dynamic code with non-dynamic code.
    R Red_Wizard_Shot_The_Food

    Hi all, I'm writing some code that I want to be part user generated part auto generated. The code will be C# but used as a script through embedding Mono in a c++ application. Ideally I want my users to use a graphical editor that will auto-generate the class and the constructor using info from the editor(I've done this using the AssemblyBuilder and Reflection.Emit) But then I want the user to be able to use a text editor to write an override for the Update() method then any number of public or private methods they wish to define. I want to be able to compile this hand-writen code (I'm doing this with the CSharpCodeProvider) but I want to inject it into the autogenerated code some how. So the class and constructor is auto-generated and the Update method and any number of other methods are handwritten in C# 2.0 and the results combined into a single dll. I hope this explanation makes sense.... can any one help? Thanks.

    C# csharp c++ tools help question

  • LINQ & Views
    R Red_Wizard_Shot_The_Food

    Hi all I was looking for some input on this architectural experiment.. Currently we have a .NET application backended in SQL and using LINQ and a 3-tier architecture. All changes to the DB need to be audited, all deletes don't actually delete but flag a "Deleted" field. There is also the issue of the messiness around disconnected LINQ objects, rather than mapping to and from non-LINQ business objects. When it needs to move objects around it just does a copy of the objects properties, via reflection, to an object relevant to the current data context and then submits that. Looking at this today i had a quick play around using views and triggers and LINQ.... In our current system; One of our objects, a "billable item", had two related "charges". So in our DBML this was represented as a billableItem object with a relationship to charge1 & charge2. This required a mapper in our data layer to handle deletes and via a Delete() method which would do the required "flagging" then updating rather than a standard deletion, it would then have to do the same to the two charge items. Then the business layer would audit this change, with several lines in the audit table saying that the billableItem changed and the 2 charges had changed. In doing all this the code seemed to have made several database hits and used reflection(incurring a minor performance hit along the way).... So I created a view, that showed the billableItem and the two charges (current and pending) in one table (sans the charge's ID's and the items FK for them). Straight off this struck me as a good way to cut the amount of auditing data we needed to log, now we just needed to log that this line in this view changed. not that line X in billableItems and line Y & Z in charges had changed. Now the support guys can look at a single audit entry and tie it to a single line in a single table. Secondly now our DBML is easier to look at and objects reflect actual business objects not DB tables. BUT it was a view of multiple tables and as such LINQ did not like inserting and deleting :doh: So I created some "instead of" triggers. Now on insert it creates a 2 charges and then an item, puts the charge ID's in the items FK's, pulls the rest of the data from the "inserted" that was intercepted and then puts a single audit in the audit table. On Delete it flags the item and 2 charges as deleted and puts a single audit in the audit table. On Update it adds a line in the audit table for each changed field. One thing I have seemingly lost is the

    LINQ database csharp linq business json

  • SSIS: How can you read data from hidden Excel worksheets using SSIS?
    R Red_Wizard_Shot_The_Food

    Thank you, that looks like it may be halfway to working.... now I'm getting a message about the source being read-only when I try to do anything with my Excel Source object now :( There is no password protection, currently on the workbook or the sheets.

    Database sql-server question

  • SSIS: How can you read data from hidden Excel worksheets using SSIS?
    R Red_Wizard_Shot_The_Food

    I'm trying to write an SSIS package that will read data from 3 hidden sheets in a workbook. The idea is that other departments can input data into 3 non-hidden sheets, that have a user friendly layout along with instructions and examples, etc. And the 3 hidden sheets then take this data and hold it in a basic table format with a single header row. To simplify importing we want to just read the data from these hidden sheets... but a SSIS's standard Excel connection / Excel Source can't seem to see these hidden sheets. Is there a way to get SSIS to see these hidden sheets without making them visible in the workbook itself? Thanks.

    Database sql-server question

  • Is there a way to do a 'select all' inside a select that returns an anon' object?
    R Red_Wizard_Shot_The_Food

    Lets say "Things" is a table with 100+ columns and I want to pull back an anonymous object that is a combination of an entire "Thing" plus 3 or 4 related entries from Thing.Stuff.Blah e.g

    database.Thing.Select(thing=> new {Name = thing.Stuff.Blah.Name, Age = thing.Stuff.Blah.Age, Car = thing.Stuff.Blah.Car, thing});

    To produce an object like so: Name, Age, Car, ... plus another 100 properties from the Things table Or do i have to type out all those columns names eg: thing.x, thing .y and so on?? Thanks :)

    LINQ database question

  • Images and Video in same MediaElement??
    R Red_Wizard_Shot_The_Food

    Thank you! I sorted it with the help of your answer to my other post :) I made a StoryBoard and MediaTimeline for the MediaElement. Then i used a switch case when reading the List<>... if the current element was an image I set the MediaElement's duration to 1 second and called begin on the StoryBoard and if it was a video I set the duration to the MediaElement's "natural" duration then called begin on the StoryBoard. When you use a MediaTimeline you need to change the source via the MediaTimeline rather then the MediaElement and this seems to solve the problem of the flickering when loading new media :-D

    WCF and WF question

  • Executing an animation from within code?
    R Red_Wizard_Shot_The_Food

    I've been looking through animation tutorials for WPF and they all seem to use the "RoutedEvent" inside an event trigger that is hooked up to the form loading or a button being pressed.... But how would I, say, launch an animation when my SQL query has finished or when a file has finished loading, etc, etc. Is there just some simple "Do this animation now" command I can call on a story board?? Thanks.

    WPF database csharp wpf question

  • Images and Video in same MediaElement??
    R Red_Wizard_Shot_The_Food

    Thanks, But that really seems to complicate the control of the process... now I have to monitor the media element playing the video, when it's done check to see if the next item is an image, then set the visability on an image to visible and stop the MediaElement playing the video, somehow set the image to display for 1 second before dissappearing, load the next video, start the play process of the MediaElement again repeat. I was really hoping there was a sollution where I can just play any combination of video and image without any flickering between loads and set the play duration depending on what was loaded so basicly do somthing like this: DurationHit()//Called When MediaElement's current duration is up. { Stop() CurrentItem ++; if(MediaItems[CurrentItem] == "image") Duration = 1 else Duration = NaturalDuration Play(MediaItems[CurrentItem]) } Is this not possible ?? (somehow?)

    WCF and WF question

  • Images and Video in same MediaElement??
    R Red_Wizard_Shot_The_Food

    Hi, I have a List<> of URI's that point to either images or videos... What I'm after (in simplified tearms) is getting a MediaElement to show the media in the list one after the other, with video playing to it's full duration (or a pre-determined length) and images being shown for 1 second. Currently I have a MediaElement with it's "MediaEnded" event hooked up to a method that switches the MediaElement source to the next URI in the List. But as default this shows images for ~3 seconds (which I found odd... do images actually "End" like a video does?? and why ~3 seconds??) and then blinks the media element black between each source change. Could anyone suggest a sollution? Thanks.

    WCF and WF question

  • Disable all textbox & window.open problem
    R Red_Wizard_Shot_The_Food

    Just don't place the button on the panel... OR: Name all your text boxes so they start with "textbox" "txtb" or "tb" etc etc (its a good idea to name controls like this anyway). foreach (Control c in myPanel) { if(c.ID.StartsWith("textbox")) { ((TextBox)c).ReadOnly = true; } }

    ASP.NET sysadmin help question

  • Disable all textbox & window.open problem
    R Red_Wizard_Shot_The_Food

    1: Place the controls you want disabling inside a panel and disable the panel. Cheers,

    ASP.NET sysadmin help question

  • Best way to generate and wire-up events for dynamic controls?
    R Red_Wizard_Shot_The_Food

    I've had a quick search of the forums but no posts seem to cover my question. Unlike the other posts on dynamic controls: my controls render fine, they respond to events that I've wired them up to.... It's just I'm looking for a technique that is more dynamic and elegant for wiring the events up. For example: I have one page that dynamically changes it's contents depending on the url used to navigate to it (An HttpHandlerFactory helps do this for me) So the content generator on PageContent.aspx could be pointed at, say, 20 different XML sources and thus render 20 totally different pages... the problem with my current method is that it requires all the events for those 2 pages to be defined and wired up in one place.... Which makes the page code behind very cluttered with all the possible events. Is there any way to do this in a more elegant fashion? say, for example: * Store all the events for one possible page layout in another file?? * Access a class containing all the possible events via dynamic Javascript on the page that makes calls that are handled by an HttpHandler?? * Or any other way? Cheers,

    ASP.NET question javascript xml help tutorial

  • How can i return the names of a stored procedures input parameters?
    R Red_Wizard_Shot_The_Food

    Thanks guys I managed to do it in with .NET by using SqlCommandBuilder.DeriveParameters(MySqlCommand) It was used to create a generic method to loop through values from a DTO and place them into input parameters for a given Stored procedure on the mapper layer of our code. If I cache the results (for speed) it saves us lots of time rewriting very similar stuff inside each mapper to take the dto and asign its values to known paramaters in different procedures. So what i have is DataAdapter myMethod(string SProcName, DTOType inputParamsDTO) { DataAdapter da = new DataAdapter. [psudo] open connection to sql SqlCommandBuilder.DeriveParameters(SProcName) [psudo] loop [psudo] if SProcName.Param.Direction == input OR input/Output [psudo] if inputParamsDTO.Tables[0].Rows[0][i].Contains(SProcName.Param[i].ParamaterName) [psudo] SProcName.Param[i] = inputParamsDTO.Tables[0].Rows[0]["SProcName.Param[i].ParamaterName"] [psudo] end loop [psudo] close connection to sql [psudo] return da } So we pass it a SProc and a DTO (or dataset) and it gives us back a data adapter we can just calla Fill() on. But it needs to cache some where to stop excessive round trips

    Database csharp database question

  • How can i return the names of a stored procedures input parameters?
    R Red_Wizard_Shot_The_Food

    Either using SQL or C#/ADO.NET is there a way for me to "probe" a stored procedure to return the names of its input parameters to my code? Thanks.

    Database csharp database question

  • Can I generate a .txt or .csv dynamicly and provide a link for it to be downloaded/streamed?
    R Red_Wizard_Shot_The_Food

    is it possible to have a link/button/etc that when clicked creates a CVS from a dataset (that bit i can do) then presents it as a download without having to write the file to the server? So basicly when they click the link/button it streams the data from the dataset into a text file that is being downloaded. Thanks

    ASP.NET sysadmin question

  • Any good Loop related training, quizes, problems, etc, links?
    R Red_Wizard_Shot_The_Food

    Excelent :) really liked that one .. Even down to the EvaluateX and Evaluate being so closley named then calling Evaluate(x)to trick my hasty reading of it to cause me to think it was EvaluateX being called... Even worse.. the first time I read it I missed the second break and assumed it would loop through all of 0-10. That is exaclty the stuff I'm after :D "I'am odd" "Y is 36" ?? Cheers.

    IT & Infrastructure question career algorithms json tutorial

  • Any good Loop related training, quizes, problems, etc, links?
    R Red_Wizard_Shot_The_Food

    Cheers mate, Thats a bit rudimentry for what am after ;) I was looking more for loop and flow control based conundrums; as I have faced a few tricky ones over a number of interviews (some even to the point that they are "trick" questions) and my ability to apply logic under interview conditions is always hampered by nerves... So I was hoping to cram a load of real traicky-SoB loop based problems before some up-comming interviews. I've got my do-while's, while-do's, if's, else if's, switch cases(even that evil "C# requires break's" quesiton they throw into confuse C/C++ coders), try-catch-finaly's down pat.. but I'm after some exposure-therapy on them so I can hold my logical-nerve when faced with loop/flow/sort based exam questions made the throw a spanner in the works.

    IT & Infrastructure question career algorithms json tutorial

  • Any good Loop related training, quizes, problems, etc, links?
    R Red_Wizard_Shot_The_Food

    I'm after some good links of questions, quizes and problems relating to loops, flow control, sorting and good practice in such matters, just so I can buff up on them. I had a job interview last year and I aced all the questions on the exam in about 5 mins flat... and then I came to one question with a simple loop in it and after I compiled the code once and it didn't work I choked, got tunnel vision and practicly forgot how to code for the rest of the exam... I nailed it in the end, but having a time on all other questions that shoked the interviewer then having a 45 mins time on a horribly simple question just blew the whole thing for me. Admitedly the fault was 99% nerves and 1% my knowledge of flow control.. but I feel if I buff up on them then it will serve to boost my confidence for upcomming interviews after the freezing disaster of last year. Cheers :)

    IT & Infrastructure question career algorithms json tutorial

  • Is there a simple way to show an int as a string in its byte form? e.g 10 as &quot;1010&quot;
    R Red_Wizard_Shot_The_Food

    Is it possible to just simply output a byte reprisentation of an int as a string.. for example out put 10 as "1010". Or do I have to loop through the number and do all the division manualy? Thanks.

    C# tutorial question

  • a loop that increments a value in the selection clause?
    R Red_Wizard_Shot_The_Food

    I’m trying to make a loop that will select a count of all entries that have a "TimeIn" value on the date defined by an input parameter with an hour value between x & y. So the first pass through the loop would select a count of all rows with a TimeIn between 00:00:00 and 01:00:00 on the selected day ... The second pass will select a count of all rows with a TimeIn between 01:00:00 and 02:00:00. finally it will return counts for each hour in the day. This is my first attempt at loops in SQL so any push in the right direction would be much appreciated. Thanks.

    Database
  • Login

  • Don't have an account? Register

  • Login or register to search.
  • First post
    Last post
0
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups