Click here to Skip to main content
15,895,799 members
Articles / Programming Languages / C#

SharePoint 2010 Working with Dates in CAML

Rate me:
Please Sign up or sign in to vote.
4.00/5 (4 votes)
10 Jul 2012CPOL2 min read 112.2K   572   6  
Some of the challenges faced working with the Client Object Model.
namespace ClientObjectModelAndDate
{
    partial class DemoForm
    {
        /// <summary>
        /// Required designer variable.
        /// </summary>
        private System.ComponentModel.IContainer components = null;

        /// <summary>
        /// Clean up any resources being used.
        /// </summary>
        /// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
        protected override void Dispose(bool disposing)
        {
            if (disposing && (components != null))
            {
                components.Dispose();
            }
            base.Dispose(disposing);
        }

        #region Windows Form Designer generated code

        /// <summary>
        /// Required method for Designer support - do not modify
        /// the contents of this method with the code editor.
        /// </summary>
        private void InitializeComponent()
        {
            this.CreateDataButton = new System.Windows.Forms.Button();
            this.UrlText = new System.Windows.Forms.TextBox();
            this.ShowAllDataButton = new System.Windows.Forms.Button();
            this.grid1 = new System.Windows.Forms.DataGridView();
            this.grid2 = new System.Windows.Forms.DataGridView();
            this.ShowThisMonthDataButton = new System.Windows.Forms.Button();
            ((System.ComponentModel.ISupportInitialize)(this.grid1)).BeginInit();
            ((System.ComponentModel.ISupportInitialize)(this.grid2)).BeginInit();
            this.SuspendLayout();
            // 
            // CreateDataButton
            // 
            this.CreateDataButton.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(255)))), ((int)(((byte)(128)))), ((int)(((byte)(128)))));
            this.CreateDataButton.Font = new System.Drawing.Font("Candara", 9.75F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
            this.CreateDataButton.Location = new System.Drawing.Point(3, 3);
            this.CreateDataButton.Name = "CreateDataButton";
            this.CreateDataButton.Size = new System.Drawing.Size(221, 35);
            this.CreateDataButton.TabIndex = 0;
            this.CreateDataButton.Text = "Create Data";
            this.CreateDataButton.UseVisualStyleBackColor = false;
            this.CreateDataButton.Click += new System.EventHandler(this.CreateDataButton_Click);
            // 
            // UrlText
            // 
            this.UrlText.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
                        | System.Windows.Forms.AnchorStyles.Right)));
            this.UrlText.Font = new System.Drawing.Font("Candara", 12F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
            this.UrlText.Location = new System.Drawing.Point(226, 7);
            this.UrlText.Name = "UrlText";
            this.UrlText.Size = new System.Drawing.Size(547, 27);
            this.UrlText.TabIndex = 1;
            this.UrlText.Text = "http://localhost";
            // 
            // ShowAllDataButton
            // 
            this.ShowAllDataButton.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
                        | System.Windows.Forms.AnchorStyles.Right)));
            this.ShowAllDataButton.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(126)))), ((int)(((byte)(138)))), ((int)(((byte)(207)))));
            this.ShowAllDataButton.Font = new System.Drawing.Font("Candara", 9.75F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
            this.ShowAllDataButton.Location = new System.Drawing.Point(3, 62);
            this.ShowAllDataButton.Name = "ShowAllDataButton";
            this.ShowAllDataButton.Size = new System.Drawing.Size(770, 35);
            this.ShowAllDataButton.TabIndex = 2;
            this.ShowAllDataButton.Text = "Show All Data";
            this.ShowAllDataButton.UseVisualStyleBackColor = false;
            this.ShowAllDataButton.Click += new System.EventHandler(this.ShowAllDataButton_Click);
            // 
            // grid1
            // 
            this.grid1.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
                        | System.Windows.Forms.AnchorStyles.Right)));
            this.grid1.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize;
            this.grid1.Location = new System.Drawing.Point(3, 103);
            this.grid1.Name = "grid1";
            this.grid1.Size = new System.Drawing.Size(770, 148);
            this.grid1.TabIndex = 3;
            // 
            // grid2
            // 
            this.grid2.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
                        | System.Windows.Forms.AnchorStyles.Right)));
            this.grid2.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize;
            this.grid2.Location = new System.Drawing.Point(3, 313);
            this.grid2.Name = "grid2";
            this.grid2.Size = new System.Drawing.Size(770, 148);
            this.grid2.TabIndex = 5;
            // 
            // ShowThisMonthDataButton
            // 
            this.ShowThisMonthDataButton.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
                        | System.Windows.Forms.AnchorStyles.Right)));
            this.ShowThisMonthDataButton.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(126)))), ((int)(((byte)(138)))), ((int)(((byte)(207)))));
            this.ShowThisMonthDataButton.Font = new System.Drawing.Font("Candara", 9.75F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
            this.ShowThisMonthDataButton.Location = new System.Drawing.Point(3, 272);
            this.ShowThisMonthDataButton.Name = "ShowThisMonthDataButton";
            this.ShowThisMonthDataButton.Size = new System.Drawing.Size(770, 35);
            this.ShowThisMonthDataButton.TabIndex = 4;
            this.ShowThisMonthDataButton.Text = "Show this Month Data";
            this.ShowThisMonthDataButton.UseVisualStyleBackColor = false;
            this.ShowThisMonthDataButton.Click += new System.EventHandler(this.ShowThisMonthDataButton_Click);
            // 
            // DemoForm
            // 
            this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
            this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
            this.BackColor = System.Drawing.Color.WhiteSmoke;
            this.ClientSize = new System.Drawing.Size(777, 511);
            this.Controls.Add(this.grid2);
            this.Controls.Add(this.ShowThisMonthDataButton);
            this.Controls.Add(this.grid1);
            this.Controls.Add(this.ShowAllDataButton);
            this.Controls.Add(this.UrlText);
            this.Controls.Add(this.CreateDataButton);
            this.Name = "DemoForm";
            this.Text = "Client Object Model, CAML and Date";
            ((System.ComponentModel.ISupportInitialize)(this.grid1)).EndInit();
            ((System.ComponentModel.ISupportInitialize)(this.grid2)).EndInit();
            this.ResumeLayout(false);
            this.PerformLayout();

        }

        #endregion

        private System.Windows.Forms.Button CreateDataButton;
        private System.Windows.Forms.TextBox UrlText;
        private System.Windows.Forms.Button ShowAllDataButton;
        private System.Windows.Forms.DataGridView grid1;
        private System.Windows.Forms.DataGridView grid2;
        private System.Windows.Forms.Button ShowThisMonthDataButton;
    }
}

By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.

If a file you wish to view isn't highlighted, and is a text file (not binary), please let us know and we'll add colourisation support for it.

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


Written By
Architect
United States United States
Jean Paul is a Microsoft MVP and Architect with 12+ years of experience. He is very much passionate in programming and his core skills are SharePoint, ASP.NET & C#.

In the academic side he do hold a BS in Computer Science & MBA. In the certification side he holds MCPD & MCTS spanning from .Net Fundamentals to SQL Server.

Most of the free time he will be doing technical activities like researching solutions, writing articles, resolving forum problems etc. He believes quality & satisfaction goes hand in hand.

You can find some of his work over here. He blogs at http://jeanpaulva.com

Comments and Discussions