.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Win Surprise Gifts!!!

Top 5 Contributors of the Month
Gaurav Pal
Post New Web Links

Problem with date values on forms libraries

Posted By:      Posted Date: October 25, 2010    Points: 0   Category :SharePoint


I have some InfoPath form with date input field published as a content type to forms library. When I choose a date for example 2010 - 10 - 12 in my form, sharepoint column shows 2010 - 10 - 11T22:00:00. There's always one day shift between date choosen from form and shown on a list.

View Complete Post

More Related Resource Links

Problem with date values in data-driven subscription reports

Hello together, I have a question in regards of data-driven subscription report. I already have an ad-hoc report in place which can be customized by date etc. I now want to run these reports with a subscription. My challenge is now that I don't know how I can pre-define the date. I basically want the start date of NOW() and the end date 7 days in the past. I was looking around but did not get any clue where and how I have to configure it the way it works. I found this thread but honestly do not understand it well... :( http://social.msdn.microsoft.com/Forums/en-US/sqlreportingservices/thread/fb48fd15-09dd-4f5f-a09f-d92bf304c1a2 Can someone help me out please? M.

passing object values from server to client problem


I get a message that x_login is not declared.  I added Dim login as String = "123", but that didn't help.  What's the problem?

code behind....

Dim Login = "123"
x_login.Value = loginID


<%@ Page Language="vb" AutoEventWireup="false" CodeBehind="Default.aspx.vb" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" >
<form id="simForm" runat="server" method='post' action='https://test.authorize.net/gateway/transact.dll'>
        <input id="HiddenValue" type="hidden" value="Initial Value" runat="server" />
        <input type='hidden' runat="server" name='x_login' id='x_login' />
        <input type='submit' runat="server" id='buttonLabel' />



Problem with SharePoint Designer 2007 and Custom List Forms


I created several forms (Create/Edit/View) for a SharePoint list, using Custom List Forms.  I'm using Content Types in the list to ensure that each item only has the necessary fields.  When I created the ASPX forms, and inserted the Custom List Forms, I selected the correct Content Type, and I got the right fields inserted in the form.

Now, for some reason I can't identify, every time I create a new form, and insert a Custom List Form, SPD is bringing ALL fields from the list, instead of just bringing the fields included in the selected Content Type.

I have tried many different things to solve the problem, including creating new lists/content types/forms, etc. but SPD is doing the same thing all the time.

Can somebody tell me what may have gone wrong in SPD or MOSS?


DataContractJsonSerializer: Problem when deserializing the Date

Sorry for cross-posting. I posted the same question on the Silverlight forum, but it has not received a single answer yet. The majority of folks there must be more interested in UI than in more fundamental stuff.     Hello everyone! Let's say we have the folllowing POCO classes: public class PocoObject : List<PocoPropertyData> {     public PocoObject() {}     public override string ToString()     {         var parts = new List<string>();         foreach (var pd in this)             parts.Add(string.Format("{{N=[{0}], Type=[{1}], V=[{2}]}}", pd.N, pd.V == null ? typeof(object) : pd.V.GetType(),  pd.V));         return string.Join(",", parts);     } } public class PocoPropertyData {     public string N { get; set; }  // the property name     public object V { get; set; }  // the property value } As you can see, the PocoPropertyData can hold value of any type. When I execute the following code in both .NET 4 application and Silverlight 4 application: ========================================================= var poco = new PocoObject {       { new PocoPropertyData { N = "DateTimeField", V =  Da

Problem getting values next to each other from two separate CheckBoxList controls

Hi, I am using three CheckBoxList controls in ASP.NET Wizard control. CheckBoxList controls: <asp:CheckBoxList ID="cblLondonDates" runat="server" DataSourceID="SqlDataSource1" DataTextField="ShowDate" DataTextFormatString="{0:G}" DataValueField="ShowDate" ForeColor="#333333" CssClass="ShowDateMargin"></asp:CheckBoxList> <asp:CheckBoxList ID="cblSingleL" runat="server" DataSourceID="SqlDataSource2" DataTextField="size8" DataValueField="size8" ForeColor="#333333"> </asp:CheckBoxList> <asp:CheckBoxList ID="cblHalfL" runat="server" DataSourceID="SqlDataSource2" DataTextField="size6" DataValueField="size6" ForeColor="#333333"></asp:CheckBoxList>   cblLondonDates chackboxlist control shows dates generated from SQL table. cblSingleL an cblHalfL show table sizes. On ASP page they come up as following: 12/03/2011(checkboxlist-ID="cblLondonDates")-Single(checkboxlist-ID="cblSingleL") - Half(checkboxlist-ID="cblHalfL") 03/03/2012(checkboxlist-ID="cblLondonDates")-Single(checkboxlist-ID="cblSingleL") - Half(checkboxlist-ID="cblHalfL") 05/10/2010(checkboxlist-ID="cblLo

Problem casting date

I'm developing a Windows Forms app using VS 2008 with a SQL Server 2005 database. I've got search form where users can search for data by entering one or two criteria. One of these is a date which corresponds to a date field in my database. The user clicks on a button, which feeds the criteria into a stored procedure. The results are displayed in a datagridview control. While the functionality works well with the non-date criteria, whenever a date criteria is used on it's own a cast error is raised ('Conversion failed when converting datetime from character string.') I've tried lots of ways of casting the date (formatting using left, right and mid finctions, using the substring function etc) but still can't get it to work. Code and SQL are shown below. Does someone know where I've gone wrong? 'DateAssayRequested' is the date in question. <vb> 'set up and initialise connection conn = New SqlConnection(etc) comm = New SqlCommand comm.Connection = conn comm.CommandText = "SPSearch" comm.CommandType = CommandType.StoredProcedure 'create input parameters, set types and values param = comm.CreateParameter param.ParameterName = "@assayid" param.Direction = ParameterDirection.Input param.Value = txtLabNo.Text

Date validation problem modelstate.isvalid is false

In my view i am formatting the date as follows<%= Html.TextBox("MemoDate", string.Format("{0:dd/MM/yyyy hh:mm}", DateTime.Now),new{ @readonly = true })%> In controller ModelState.IsValid become false as my current culture culture {en-US} doesn't match with the format of date.

problem with passing parameter values to stored proceedure from asp.net c#

hi all, i am facing a problem while passing parameters to a stored proceedure. following is my sql query written for creating this stored procedure:   CREATE proc [dbo].[getstudent]( @wherecolumn nvarchar(2000), @wherevalue nvarchar(2000)) asbegin  declare @sql nvarchar(max) set @sql = 'select * from student2 where ' + @wherecolumn+'='+@wherevalueexec sp_Executesql @sql end   my table contains four columns: And the sql Query For the table is as follows:   CREATE TABLE [dbo].[student2]( [name] [varchar](50) COLLATE SQL_Latin1_General_CP1_CI_AS NULL, [rollno] [int] NOT NULL, [class] [varchar](50) COLLATE SQL_Latin1_General_CP1_CI_AS NULL, [section] [varchar](50) COLLATE SQL_Latin1_General_CP1_CI_AS NULL, CONSTRAINT [PK_student2] PRIMARY KEY CLUSTERED ( [rollno] ASC)WITH (IGNORE_DUP_KEY = OFF) ON [PRIMARY]) ON [PRIMARY]   from page behind I am passing the values to parameter as follows:   SqlCommand command = new SqlCommand("getstudent", c.con); SqlDataAdapter datadapter = new SqlDataAdapter(c.cmd); command.CommandType = CommandType.StoredProcedure; command.Parameters.Add("@wherecolumn", SqlDbType.NVarChar).Value = "rollno"; command.Parameters.Add("@wherevalue", Sq

Problem with CQWP "There is a problem with one or more of the field values below"

Hi, I'm trying out the content query webpart combined with content types. First I created a new site collection. In this site collection, these are the steps I did: - I enabled "SharePoint Server Publishing Infrastructure" feature at the site collection level - I enabled "SharePoint Server Publishing" feature at the site level - I created a new site column "Is Meat Eater", which is a yes/no field and added this to a new custom group called "Zoo" - I created a new content type called "Zoo Animal" that inherits from "Item" in category "List", and added this to a new custom group called "Zoo" - I added my site column "Is Meat Eater" to this content type (so now I have Title + Is Meat Eater) - I created a new custom list called "SharePoint Zoo" - I enabled content types on this list - I added "Zoo Animal" from the existing content types - I removed the default content type "Item" from the list (so now only 1 content type left, my own) - I added a few animals in the list - I added a content query web part on the homepage - As source I chose "Show items from all sites in this site collection" - As List Type I chose "custom list" - As Content Type Group I chose "Zoo" - As Content Type I chose "Zoo Animal" - I hit apply at

Forms Authentication - IE problem

Hi folks,I already implemented some kind of Forms Authentication. I got the following problem - When I'm using IE(7, 8) ONLY (FF, Opera, Chrome - they are OK) it is impossible to to get logged and get redirect to specified page from the Login.aspx. This problem occurs ONLY with IE. After passing some validations and creating ticket the Login page is reloaded again, and NO redirect to Default page exists. Address bar consists always this string:      http://localhost:3706/Login.aspx?ReturnUrl=%2fdefault.aspx  In Global.asax - HttpContext.Current.User is ALWAYS NULL under IE.Here is my code implementation:Web.config:<authentication mode="Forms">   <forms defaultUrl="Default.aspx" loginUrl="Login.aspx" protection="All" timeout="30"> </forms> </authentication>  <authorization>    <deny users="?"/> </authorization><!-- Allow anonymous access (non-Forms login) to the Images folder --> <location path="Images">   <system.web>      <authorization>          <allow users="*"/>      </authorization>   </system.web> </location>Global.asax:protected void Application_AuthenticateRequest(object sender, EventArgs e) {    // look if any security information exists for this request    if (H

Problem displaying Date from Sql table on Calendar Control

Hi, I am displaying Event dates from SQL table on Calendar Control in ASP.NET. Also, I have GridView Control which shows event details when certain date is clicked on calendar control. But I have a problem as not all dates are displaying properly. Strangly enough only dates which have same month and day date are displayed. For example: It shows ok dates such as 08/08/2010, 09/09/2010, 10/10/2010 etc. If I click on the date which in SQL table exists as 11/25/2010 or 12/15/2010 etc (no matching month/day numbers) it shows error message saying: "System.Data.SqlClient.SqlException: Conversion failed when converting date and/or time from character string."  Follwoing is my code: using System; using System.Collections.Generic; using System.Linq; using System.Web; using System.Web.UI; using System.Web.UI.WebControls; using System.Data.Sql; using System.Runtime.Remoting.Messaging; using System.Configuration; using System.Data.SqlClient; using System.Data; using System.Drawing; public partial class Test_Calendar : System.Web.UI.Page { SqlConnection mycn; SqlDataAdapter myda; DataSet ds = new DataSet(); DataSet dsSelDate; String strConn; private void Page_Load(object sender, System.EventArgs e) { strConn = "Data Source=mydatasource;Initial Catalog=DBname;Persist Security I

Date formate problem

Hi I have faced one problem with processing date field from xml file. i have read RSS site and get date field from this site and parse that date field using below code i got pubDate field from xml like : <pubDate >06 Sept 2010 09:15:01 +0300</pubDate > datefield = DateTime.Parse(xmlfile.Element("pubDate").Value.Replace("\n\r", "").Replace("\r\n", "").Replace("\n", "").Replace(" Sept "," Sep ").Trim(), FinishCulture.DateTimeFormat, DateTimeStyles.AdjustToUniversal).AddHours(3).ToString("dd.MM.yyyy HH:mm:ss"),   I have face this problem because of month format "Sept". i have also implement this functionality with other RSS site they working fine with above code as they return date like : <pubDate >06 Sep 2010 09:15:01 +0300</pubDate > So, the problem is with month name Sept - Sep. can you please tell me how can i handle "Sept" month name format.   Thanks Nikunj Padaliya  

Date Time interval Problem

Hi I have a problem in which i have to check the time interval to the another which is already exist in Database table.For Exp.10:00 am  To 11:00 am i add an Event now if user insert the again this time interval  it's throw the error message.if user want's to edit this event For exp.10:15 am to 11:00 amhow do this.Thanks

Problems with Custom List Forms in Document Libraries

I have setup several custom list forms for various lists with no issues however when it comes to document libraries a few things dont seem to work correctly. I create a copy of the editform.aspx --> Hide existing web part --> Insert custom list form (edit) --> restyle the fields etc. save it as edit.aspx confirm it is being used as the default form in the supporting files section. Great it appears to work whenever someone uploads a document or clicks edit. However... that is only th first impressions as there are a few issues that crop up at this time.  Clicking the edit button on an existing document doesn't display the Name field, meaning individuals cannot rename a document. After an item is uploaded and the required fields are entered in the form the user then clicks check-in. The library then opens and shows the document is still checked out to that user. Has anyone else experienced these issues before? The critical factor is the checking in a document, as to why this breaks on a custom edit form I have no idea. Any help would be greatly appreciated as under quite a lot of pressure to get this resolved. Chris

SSRS problem with passing multiple parameter values via URL %2c

Hi, I have a problem with passing multiple parameter values from one report (A) to another report (B).   For example I built a URL string in report (A) with the parameters like &Parameter1=1&Parameter1=2. As soon as I click on that URL the URL parameters look like &Parameter1=1%2c2 and the parameters don’t getting populated on report (B).   If I change the parameter in the URL to &Parameter1=1&Parameter1=2 and execute the URL manual the parameter on report (B) getting populated properly.   Is there a way to disable the coding like %2c (comma) or is there another solution for it?   Thanks

Rich Text in list forms & date picker

Hi, I was hoping that someone could help me on a few issues. I have created a custom list form in sharepoint designer to display the contents of my list in a nice format. I have also customised the edit form for the list. I am having a problem with special characters now showing up when they are being entered (the HTML does not seem to be parsed on the output). I would like to make a description field in my list edit form a rich text box, is this possible? This is the code I am using at the moment for the text box: <asp:TextBox runat="server" id="ff5{$Pos}" text="{@status}" textmode="multiline" __designer:bind="{ddwrt:DataBind('u',concat('ff5',$Pos),'Text','TextChanged','ID',ddwrt:EscapeDelims(string(@ID)),'@status')}" Width="600px" Height="100px" /> And this is the code that I am using on the display side of the list to show the status update: <xsl:value-of disable-output-escaping="yes" select="ddwrt:AutoNewLine(string(@status))" /> Is there code that I can use on the data entry side that will show a rich text box? Also then I will need to change the tag on the display end so it parses the HTML? In addition to this, is there specific code for a 'date picker' ? At the moment my date entry box is just a standard text box, is there code I can u

Attempt to load Oracle client libraries threw BadImageFormatException. This problem will occur when

We are migrating our application from windows server 2003 32 bit to windows server 2008 64bit, after I have created the virtual folder on the new machine, I am unable to connect to the database. We have oracle 11g client installed and below is the error which I am getting - </BR></BR> System.InvalidOperationException: Attempt to load Oracle client libraries threw BadImageFormatException. This problem will occur when running in 64 bit mode with the 32 bit Oracle client components installed. ---> System.BadImageFormatException: An attempt was made to load a program with an incorrect format. (Exception from HRESULT: 0x8007000B) at System.Data.Common.UnsafeNativeMethods.OCILobCopy2(IntPtr svchp, IntPtr errhp, IntPtr dst_locp, IntPtr src_locp, UInt64 amount, UInt64 dst_offset, UInt64 src_offset) at System.Data.OracleClient.OCI.DetermineClientVersion() --- End of inner exception stack trace </BR>Any help is greatly appreciated, I have tried couple of solutions going through some threads online but no luck.
ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  Silverlight  Others  All   

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend