Great Ideas. Always Flowing.

We are not happy until you are happy. Client satisfaction guaranteed. Whatever your needs and requirements, we have the skills and resources for the job!

Quick login...


Or... now make it easy with Facebook Integration
Connect via Facebook



Top Sellers

Frustrated over the lack of customization for your user's registration fields? Dynamically setup your DNN Portal with custom registration fields, layout, questions, and other core integration options......

Ultra Video Gallery is a brother product of Ultra Media Gallery, UVG allows you to upload videos in various format and automatically encode them to flv or H264 format, you also can add videos from internet or record live videos from your webcam.

Build high performance, completely customizable data-entry forms and views driven by your DNN and external databases. New built-in tools make it a snap to quickly create data entry forms, data views, and even database tables. Plus, add your own HTML, CSS, Javascript, SQL commands, stored procedures,

The most advanced DotNetNuke shopping cart on the planet. Easy to use e-Commerce, Secure Shopping Cart Software and SEO friendly. B2C / B2B Ecommerce Sites.

One stop solution for events calendar and events registration! FREE DOWNLOAD is available now!

Reading Date Fields from MSSQL
Last Post 02-20-2013 06:41 AM by Ryan Bakerink. 7 Replies.
AddThis - Bookmarking and Sharing Button Printer Friendly
  •  
  •  
  •  
  •  
  •  
Sort:
PrevPrev NextNext
You are not authorized to post a reply.
Author Messages
Tim HardinUser is Offline
wading in the water
wading in the water
Posts:24
Avatar

--
02-07-2013 07:34 AM
    Hi all,
    We are using DF to save a date field to a MSSQL Database.  However, when we go back to the page, we cannot get it to populate the field.  It is saving correctly to the DB.  It is the read that is not working.  All our other fields are being populated properly.
    The demo here does not seem to give info on the way the fields are wanting the date formatted:
    Thanks
    Tim

    What format should the data be coming back in?
    Ryan BakerinkUser is Offline
    river guide
    river guide
    Posts:1900
    Avatar

    --
    02-07-2013 01:40 PM
    I would recommend using the mm/dd/yyyy format.

    Perhaps try this:

    1.) If your Date Column name is "DateCreated", then use the SQL Below:

    Select Convert(char(10), DateCreated, 101) As DateCreated

    In order to Bind/Map the value to a field on your Dynamic Form, be sure that you have a Dynamic FOrm Question with the short field name of "DateCreated". I assume you're using Initial SQL Binding?

    What field type are you using? Textbox? Date type, Combo Boxes, Textbox with Calendar, etc...

    Thanks,

    Ryan
    Mark MerrickUser is Offline
    skipping stones
    skipping stones
    Posts:5
    Avatar

    --
    02-12-2013 07:24 AM
    Hi Ryan,

    Regards.

    I am working with Tim on this issue.

    Yes we are using Initial SQL Bind. All the other fields populate except the 4 date fields on our form.

    For testing on the form I tried using your "Textbox w/Calendar", "Month,Day,Year Textbox", and "Month,Day,Year Combobox".

    In the database I have the fields saving to a NVARCHAR(10) but also tried DateTime on one field.

    Using the Convert I can return all those date fields as mm/dd/yyyy. Testing in MSSQL Manager the query runs and the data looks good.

    But it still won't populate on the form. Snippet from my Query:

    SELECT
    Convert(char(10), [DOB], 101) As DOB,
    Convert(char(10), [VISA_issue_date], 101) As VISA_issue_date,
    Convert(char(10), [VISA_expiration_date], 101) As VISA_expiration_date,
    Convert(char(10), [copy_passport], 101) As copy_passport,
    FROM App_Table1
    WHERE UserID = $(UserID)

    Any ideas?
    Mark MerrickUser is Offline
    skipping stones
    skipping stones
    Posts:5
    Avatar

    --
    02-12-2013 07:31 AM
    OK I take part of that back - the DOB field that I have setup as "Month,Day,Year Combobox" is now working. Other date fields that use "Textbox w/Calendar" and "Month,Day,Year Textbox" do not work.

    I am curious as to why those don't work but maybe we can be happy with the "Month,Day,Year Combobox".
    Mark MerrickUser is Offline
    skipping stones
    skipping stones
    Posts:5
    Avatar

    --
    02-12-2013 07:37 AM
    Whoops - EDIT - the DOB is actually using "Textbox w/Calendar" so that is the field type that seems to work.
    Chad NashUser is Offline
    Posts:5260
    Avatar

    --
    02-13-2013 03:50 PM
    Hi Mark - So, when you are using "SQL Bind" or in "Edit" mode, you are saying that the date field type does not bring the data in for combo box date type?

    I think that this could be related to how we store that data in the database for that field. I think we have it stored as a comma separated value instead of with /. So... Maybe that is the problem and you can bind it such as "12,15,2012". If that is the case you can probably change your query to work properly with how our module populates that field type.

    Thanks,

    -Chad
    Mark MerrickUser is Offline
    skipping stones
    skipping stones
    Posts:5
    Avatar

    --
    02-14-2013 07:59 AM
    Yes Chad the databind using Convert(char(10), [DOB], 101) As DOB populates only on a date field with the form field type "Textbox with Calendar".

    So it sounds like your saying that we need to return the field in the format "12,15,2012" if we want the other form field date types to work.
    Ryan BakerinkUser is Offline
    river guide
    river guide
    Posts:1900
    Avatar

    --
    02-20-2013 06:41 AM
    Hello Mark,

    Regarding Chad's comments, if you're saving [DOB] as mm/dd/yyyy in the a custom database table, but are using Initial SQL Bind to pull in the record you're looking for. Then you can use a SQL Replace Statement.

    Select Replace(DOB, '/', ',') As DateWithCommas from YourTable

    Then the DOB Column will replace the "/" with ",". As per Chad's recommendation, this will assist you in following his instructions.

    Please try it out and let us know if it begins working for you.

    Thanks,

    Ryan
    You are not authorized to post a reply.


     
     

    Join our mailing list...

    Get current news and events the easy way
     
     
       
    Subscribe Me

    Recent Blogs...

     
    Copyright 2005 - 2011 by Data Springs, Inc.
     
  • film izle
  • 720 izle
  • film
  • sinema izle
  • film makinesi
  • T�rk�e dublaj film
  • film izle
  • film izle
  • baglan film izle
  • sinema izle
  • 1080 film izle
  • film mercegi