Search Results

Search found 2479 results on 100 pages for 'alex curtis'.

Page 9/100 | < Previous Page | 5 6 7 8 9 10 11 12 13 14 15 16  | Next Page >

  • Get the count of items in a GroupBy Linq-to-sql Query?

    - by Curtis White
    I have a groupby that I groups all elements. I can see the items are there in LinqPad but can't find a way to get the count. Here is what I have so far: SurveyResponses.Where( q = q.QuestionId == 4).GroupBy(q = q.AnswerNumeric).Where( g = g.Key == 1) In Linq Pad I can see there are 4 items in this query. If I do Count it returns 1. I've tried, ToList().Count, Select(x = x).Count, etc.

    Read the article

  • Storing datetime in database?

    - by Curtis White
    I'm working on a blog and want to show my posts in eastern time zone. i figured that storing everything UTC would be the proper way. This creates a few challenges though: I have to convert all times from UTC to Eastern. This is not a biggie but adds a lot of code. And the "biggie" is that I use a short-date time to reference the posts by passing in a query, ala blogger. The problem is that there is no way to convert the short date time to the proper UTC date because I'm lacking the posted time info. Hmm, any problem to just storing all dates in eastern time? This would certainly make it easier for the rest of the application but if I needed to change time zones everything would be stored wrong.

    Read the article

  • concatenating results from SQL query and NULL columns

    - by Curtis
    I need to concatenate several columns of a table into a single value, then show that value in an asp dropdownlist. The SQL code I'm issuing is as follows: SELECT UserID, CustomerNum, UserName + ' - ' + UserAddress + ',' + UserCity + ' ' + UserState AS UserInfo FROM Users WHERE (CustomerNum = @CustomerNum) ORDER BY UserName I then set 'UserInfo' as the text field in the dropdownlist. This generally works, except occasionally one of the columns in the database is null (for example, UserState). When that happens, the entire concatenation is null, and I get an empty entry in the dropdownlist. Is there something in SQLServer that will allow me to ignore those NULL results, or will I have to code something up in the DataBind event? Thanks

    Read the article

  • event listener says NetStream.Play.Start but I see no video

    - by Curtis
    I'm trying to test out the Adobe Media Server, and I'm following some tutorials in order to stream a video. I have a NetConnection which successfully connects to the application on the server, then I have the code below. It looks like it's supposed to play a video, but it doesn't. It creates the video object as a black square in the top left corner, and the event.info.code says NetStream.Play.Start, but I don't see the video playing. case "NetConnection.Connect.Success": var v:Video = new Video(); v.width=200; v.height=200; v.x=0; v.y=0; v.visible=true; v.opaqueBackground=false; stage.addChild(v); var ns:NetStream = new NetStream(nc); ns.addEventListener(NetStatusEvent.NET_STATUS,netStatusHandler); v.attachNetStream(ns); ns.play("mp4:polymorphics.f4v"); I can also try ns.play("rtmp://localhost/vod/mp4:tests/polymorphics.f4v"); but that gives me a Stream Not Found error The lines that begin with "ns" means that they're generated by my NetStream listener, as opposed to my NetConnection listener. Connecting... connected is: true event.info.level: status event.info.code: NetConnection.Connect.Success onReply recieved value: Hello, World! ns connected is: true ns event.info.level: status ns event.info.code: NetStream.Play.Reset ns connected is: true ns event.info.level: status ns event.info.code: NetStream.Play.Start

    Read the article

  • What are the correct steps to capture data with uploadify?

    - by Curtis
    Does anyone have a demo of using uploadify with additional fields and saving to database? The site's examples don't explain the process in depth and I am not familiar with jquery. I don't know why but I can't get my head around how too integrate the two. I have the demo working and I have my app which uses traditional php/html forms working. I need to conduct basic form collection with uploadify in the mix. Collect data and check data with feedback and then process into database and post back a confirmation. How do I feed information back to the uploadify form if there is a problem from the upload.php file? How do I access my data in the upload.php file? how do I redirect the upload page to a confirmation page after a succeeful upload?

    Read the article

  • Dynamic query to immediate execute?

    - by Curtis White
    I am using the MSDN Dynamic linq to sql package. It allows using strings for queries. But, the returned type is an IQueryable and not an IQueryable<T>. I do not have the ToList() method. How can I this immediate execute without manually enumerating over the IQueryable? My goal is to databind to the Selecting event on a linqtosql datasource and that throws a datacontext disposed exception. I can set the query as the Datasource on a gridview though. Any help greatly appreciated! Thanks. The dynamic linq to sql is the one from the samples that comes with visual studio.

    Read the article

  • MSDN firefox examples?

    - by Curtis White
    When I go to these examples using Firefox 3.6.3 and click the code examples it doesn't work: http://msdn.microsoft.com/en-us/library/1whwt1k7.aspx I want confirmation that this is a Firefox compatibility problem, suspect my firewall.f

    Read the article

  • LINQ to SQl updating primary key field?

    - by Curtis White
    I have a linq to sql table/class that uses a GUID as both a primary key and as foreign key. This problem came up when factoring some code that previously worked. The exception generated is "Operation is not valid due to the current state of the object." The process I use is as such: aspnet_User user() = new aspnet_User(); aspnet_user.childTable = new childTable(); .. set some properties user.Insert() -> my custom method ... @ my custom method using (mycontext dc = new context() ) { user.childTable.ID = (Guid)myNewlyCreatedGuid; } The exception occurs on the assignment childTable.set_UserId().

    Read the article

  • What prevents a user from adding controls to an ASP.NET page client side?

    - by Curtis White
    This goes back to my other question which I thought was sufficiently answers but upon reflect am not sure that it was (sorry). Backgrounder: I am generating a form dynamically. I am pulling from the database the controls. I must associate each control with a database ID which is not the user's session id. I do this currently by storing my ID in the ID for the web control with some other stuff to make it unique/clear what I am doing. On the post back, I iterate through all the controls on my web page checking for my special identifier, ie, MyGeneratedTextBox_ID_Unique. This process enables for 2 important steps, identifying the control was one I generated and also getting the ID for this input field. And, all of this works but I'm still concerned about the security of it. I do not see a security issue with showing the actual database ID's in this case, although agree it is not desirable. However, I am concerned of the following possibilities: If a user could add a nefarious control to my collection and use that for a SQL injection attack. More academic, but if a user could somehow store data for fields they do not have access too by changing the id's. I agree this is a "hack" of a way to do it. But my question is, is it a security risk and is there an 'easy' way to do it in a less hack way? I assume that only the controls that are created/instantiated on the page are added to the controls list.. thus all controls must be created server side and thus the security issue is address but just wanted to validate. Thanks again. PS: I could see adding a property for each control and encrypting the viewstate would be a little more secure.

    Read the article

  • Template engine recommendations

    - by alex
    I'm looking for a template engine. Requirements: Runs on a JVM. Java is good; Jython, JRuby and the like, too... Can be used outside of servlets (unlike JSP) Is flexible wrt. to where the templates are stored (JSP and a lot of people require the templates to be stored in the FS). It should provide a template loading interface which one can implement or something like that Easy inclusion of parameterized templates- I really like JSP's tag fragments Good docs, nice code, etc., the usual suspects I've looked at JSP- it's nearly perfect except for the servlet and filesystem coupling, Stringtemplate- I love the template syntax, but it fails on the filesystem coupling, the documentation is lacking and template groups and stuff are confusing, GXP, TAL, etc. Ideas, thoughts? Alex

    Read the article

  • Secure to store an ID in an ASP.NET control ID?

    - by Curtis White
    I'm auto-generating a form in my ASP.NET page. This is already tested and working. I want to know if: If there are any security problems with storing the database ID as part of my controls ID? I can see think of 2 issues: the id will be visible in page source (not really important in this case), and the possibility someone could change the name of the control somehow? This second possibility is more serious. Is this a potential problem and how to void it? If there would be a better preferred way to associate a unique data with any type of control? Is it possible to store a custom item in the viewstate for the control?

    Read the article

  • ASP.NET dropdown selected value?

    - by Curtis White
    I've an ASP.NET dropdown list and getting selected value by using the .SelectedValue. I also set this value in some cases by assigning to it. I seem to be randomly not getting this value set even when I choose the item from the drop down. Sometimes it works and sometimes it doesn't. Ideas?

    Read the article

  • Linq-to-sql join/where?

    - by Curtis White
    I've the following table structures Users id Types id isBool UsersTypes userid types I want to select all the UserTypes based on id and isBool. I tried this query var q = from usertype in usertypes from type in types where type.isBool == false where userstypes.user == id select usertype; But this did not work as expected. My questions are: Why? Is there any difference in using the join on syntax vs where, where vs where cond1 && cond2? My understanding is query optimizer will optimize. Is there any difference in using where cond1 == var1 && cond2 == var2 with and without the parenthesis? This seems peculiar that it is possible to build this without parenthesis What type of query do I need in this case? I can see that I could do a subquery or use a group but not 100% sure if it is required. An example might be helpful. I'm thinking a subquery may be required in this case.

    Read the article

  • How to run a javascript function before postback of asp.net button?

    - by Curtis White
    I'm using Javascript to create a DIV element and open up a new page by using onclientclick. This works great. Now, I need to write to it from the server side and this element must be created before it is posted back. How do I get the javascript to execute before the postback? Currently, I have to press the button twice because the element doesn't exist to write too on the first click. To be clear, I need this to execute before the "OnClick" of the button. Update: It looks like the Javascript function is called before the postback but the element is not updated until I run the second postback. Hmm Update: Unfortunately it is a bit more complicated then this. I'm creating a div tag in javascript to open a new window. Inside the div tag, I'm using a databinding syntax <%=Preview% so that I can get access to this element on the server side. From the server side, I'm injecting the code. I'm thinking this may be a chicken-egg problem but not sure. UPDATE! It is not the Javascript not running first. It is the databinding mechanism which is reading the blank variable before I'm able to set it. Hmm

    Read the article

  • User control event or method override where custom properties are valid?

    - by Curtis White
    I have an ASP.NET user control that is used in another use control. The parent user control uses data-binding to bind to a custom property of the child user control. What method can I override or page event where I am ensured that the property state is set? I think in a page it is PageLoaded versus the Page_Load override? I am looking for this in the user control because my property is always null even though it is set. Thanks.

    Read the article

< Previous Page | 5 6 7 8 9 10 11 12 13 14 15 16  | Next Page >