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
D

DaveRRR

@DaveRRR
About
Posts
4
Topics
1
Shares
0
Groups
0
Followers
0
Following
0

Posts

Recent Best Controversial

  • adding to access database
    D DaveRRR

    I might have the answer you seek, but I haven't looked in any depth at this problem.

    It may be something to do with the insert statement and/or the customer table. Does the table only have 3 columns: an id, a surname and a forename? Is the id column auto-generated (or whatever the term is in MS Access)? Try naming the columns in your insert statement. I don't know what columns your customer table has but it might be something like this:

    insert into customer (id, surname, forename) values (99, 'Rogers', 'Dave')

    Dave

    Visual Basic

  • What is the point of using .NET data sources?
    D DaveRRR

    What is the point of using data sources such as SqlDataSource or ObjectDataSource?

    Consider a simple example of a web page with a dropdown list used to filter the content of a pageable, sortable GridView. Each control needs a data source and that results in two calls to SQL Server. We are also told to keep the number of "round trips" to SQL Server to a minimum, for best performance. These scenarios are incompatible (although the difference in my example is trivial).

    The only solution I have spotted is to make a single call to a compound SQL Server stored procedure and to put the results in a dataset (a repeater cannot be used for a pageable, sortable GridView) and bind each control to the appropriate table in the dataset. The disadvantage to this method is that I now have to code the GridView Sorting and PageIndexChanging events rather than just supplying attributes for that control.

    Dave

    ASP.NET

  • javscript to compare 2 dates
    D DaveRRR

    I have never used a popup calendar because I think it is quicker for a user who may have just entered a name and address, perhaps, to continue to use their keyboard to enter a date (or two). Anyway, that should not be relevant to the immediate problem. Try the following... Create a page with the following content:

    <%@ Page Language="VB" %>
    <html xmlns="http://www.w3.org/1999/xhtml" >
    <head>
    <title>Test</title>
    </head>
    <body>
    <form id="form1" runat="server">
    <div>
    Date Range:
    <asp:Textbox id="txtDate1" runat="server" columns="15" Text="01/04/2006" />
    <asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server"
    ControlToValidate="txtDate1" ErrorMessage="Date must be entered" Display="Dynamic" />
    to
    <asp:Textbox id="txtDate2" runat="server" columns="15" Text="03/01/2009" />
    <asp:RequiredFieldValidator ID="RequiredFieldValidator2" runat="server"
    ControlToValidate="txtDate2" ErrorMessage="Date must be entered" Display="Dynamic" />
    <asp:CompareValidator ID="CompareValidator1" runat="server"
    ErrorMessage="Date must be in the format dd/mm/yyyy and it must be after the first date"
    ControlToValidate="txtDate2" Type="Date" Display="Dynamic" Operator="GreaterThanEqual"
    ControlToCompare="txtDate1" />
    </div>
    </form>
    </body>
    </html>

    ... then test it, change the second date to 03/01/2006 and press the tab key. A suitable error message should appear. Change the second date to 03/01/2007, press the tab key and the error message should disappear. Hope that helps. If not try looking in C:\Inetpub\wwwroot\aspnet_client\system_web\1_1_4322\WebUIValidation.js (assuming you are running IIS and your website root folder is C:\Inetpub\wwwroot). I'm not sure if this is the up-to-date JavaScript validation code, especially if you are using ASP.NET 2.0 (or 3.0!) but the version number of 125 suggests it is OK. I really hope my example helps because the JavaScript code takes a fair bit of time to get to understand. Cheers, Dave. :) -- modified at 15:29 Tuesday 2nd January, 2007

    ASP.NET tools help

  • javscript to compare 2 dates
    D DaveRRR

    We used to have a similar problem with the compare validator and two dates. We were entering dates in British dd/mm/yyyy format but the validators work by default with American mm/dd/yyyy dates. The answer is to include a globalization element in your web.config:

    <system.web>
    <globalization requestEncoding="utf-8" responseEncoding="utf-8" culture="en-GB" uiCulture="en-GB"/>
    </system.web>

    Cheers, Dave.

    ASP.NET tools help
  • Login

  • Don't have an account? Register

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