.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

How to change The DateTime Automatically according to User TimeZone Offset?

Posted By:      Posted Date: August 28, 2010    Points: 0   Category :.NET Framework
I have an application in which we are displaying DateTime in many pages. we want to display these DateTime's according to UserTime zone. UserTimeZone will be in database. All DateTime values will be saved int UTC format. My Requirement is I want set the TimeZoneOffset of user in ServerSide based on the User TimeZoneOffset All the DateTime values needs to be Added/Substracted while showing the DateTime values to user. I dont want to manully add/substract TimeZoneOffset value in all pages. Is there any way the DateTime  automatically change to the User Timezone.  How can I do this? Thanks in Advance ChellamNaidu

View Complete Post

More Related Resource Links

dynamically change html code when user is authenticated


So I have a fairly simple web site which allows an Administrator to edit some data in a database which is displayed on some web pages.

The main navigation on the site is shown in the code snippet below. The Admin link goes to a Login.aspx which allows the Administrator to log in - once authenticated they get sent to the data edit page.

So my question is, how could I dynamically add a link to the data edit page in the <ul> list below once the user is authenticated ?

This would allow the authenticated user to see links to the secure pages in the main navigation bar.

<%--Top Navigation Menu --%>
<div id="topMenu">
<li><a href="default.aspx">Home</a></li>
<li><a href="introduction.aspx">Introduction</a></li>
<li><a href="curriculum.aspx">Curriculum</a></li>
<li><a href="times.aspx">Times & Fees</a></li>
<li><a href="staff.aspx">Staff</a></li>
<li><a href="login.aspx">Admin</a></li>
</div><%--End of topMenu Container--%>
<div id="clear"></div><%--Floats items cleared End of Master Page--%>

[Sharepoint 2007] How can i change the email of a sharepoint user ?

Hi all,

I have created a new sharepoint user.

1. First of all i have added a new user in active directory. However at that time i forgot to give an email address. Big mistake !

I cannot send mail from sharepoint workflow with the new user.

2. Therefore I updated the email addresd in active directory afterwards. But the change was not reflected in sharepoint.

I updated the mail in sharepoint adminsitrative user profile. But it did not make no difference in the user moss profile.

I followed the article in http://sharepointnotes.wordpress.com/2008/05/05/syncing-wss-and-moss-user-profile-properties-with-active-directory/

I did the following commands :

1. stsadm -o sync
2. stsadm -o sync -synctiming m:2
3. stsadm -o sync -deleteolddatabases 6
 stsadm -o sync

None of these commands updated the user properties mail for my new MOSS User.

I also rebooted the machine but my MOSS user email was not updated.

Also I used the tool at http://userprofilesync.codeplex.com/releases/view/13227
like the following :

tool>UserProfileSync.exe -url http://mysite -ssp http://mysite:37239/ssp/admin
I did not make any difference

What else can I try in order to update the email of my MOSS user ?

MSSQL 2008 R2: Change Server Collation Steps, with user DBs already of desired collation

On the default instance of SQL Server 2008 R2, I want to change the server collation from the usual US default SQL_Latin1_General_CP1_CI_AS to an application vendor's required collation, Latin1_General_BIN.  I understand that changing the server collation is essentially the same as changing the collation of databases master and model -- is that a fair statement? But my main question is, since there are user databases on the server that I would like to preserve, can I not simply detatch the user DBs prior to performing the server collation change, and then reattach?  The database collation of the user databases is already set to Latin1_General_BIN.  This article, Setting and Changing the Server Collation, at http://msdn.microsoft.com/en-us/library/ms179254.aspx says that to preserve the user databases, I should script all DB objects out, and bulk-copy all data out, because the DBs will have to be recreated and repopulated.  Can someone explain why I ought not simply detach and reattach the user DBs, given that they are already of the desired collation (i.e., the same collation that I will be changing the server collation to)? Your help much appreciated. -Tom

Change database fields automatically according to date

Hi, I'm currently developing a software application for my client. Part of the project is to keep track of his stock's shipping status. The client must insert the stock's pick-up date, expected time of departure (ETD) and expected time of arrival (ETA). The stocks will be called out using Grid View and the status, being one of the keys of the database, will be shown. Before the current date reaches pick-up date, the status must show "in warehouse", and after the current date reaches pick-up date and is before ETD, status must show that its "on the way to the port", and after ETD and before ETA, "in freight", and finally after ETA, "arrived". What datatype should I use for the database and where should I program it so that it changes automatically accordingly ?

Manage User Profile -- cannot change order

Hi, Is there any reason why I can't change the order of some of the properties in Manage User Profile. E.g  "about me " and "account name". I clicked the move down error, but it doesn't move Please advice, your help would be greatly appreciated.

Internet facing SharePoint site - user shouldn't have to log in to change the langague

Hello, I am using SharePoint 2010 for Internet sites.  Anonymous access has been enabled.  Language packs have been installed so that users can switch to different languages as required.  However, the only way for a different language to be selected other than the default is for the user to log into the site and then the option would be displayed.....This is an internet facing site with anonymous access therefore users shouldn't have to log in to change the language.  Can someone guide/advise on switching the lanuguage of the site without loggin in. Thanks, Shelley

change snapshot agent user (Agent security)

Hi, we have replicated dbon sql server 2008 (transaction replication) now we want to change the user used for the snapshot agent, from sql Managment studio go to publication property and then agent security and then snapshot agent (now we are using domain user) here we want to use the other option which is " to be run under sql server agent service account" but I couldnt choose this option because its unactive so how we can activate this option for existing replication without restarting the replication (i can use this option for the new replication wizard) Thanks

User cannot change the date value after its been saved. Why not?

I've got a DatePicker control on a WPF 4.0 page (not a XBAP).  It's pulling data find out of our SQL Server database, but boy, if the user tries to change the data, forget it!  And for the life of me, I cannot figure out why not.  Here's the relevant XAML: <DatePicker Name="dpDateOfBirth" SelectedDateChanged="dpDateOfBirth_SelectedDateChanged" Validation.Error="dpDateOfBirth_Error" GotFocus="dpDateOfBirth_GotFocus"> <DatePicker.SelectedDate> <Binding Path="DateOfBirth" NotifyOnValidationError="True"> <Binding.ValidationRules> <ExceptionValidationRule></ExceptionValidationRule> </Binding.ValidationRules> <Binding.Converter> <local:DateConverter></local:DateConverter> </Binding.Converter> </Binding> </DatePicker.SelectedDate> </DatePicker> and here's my DateConverter class: using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Windows.Data; using System.Windows; /* * This is the basic date converter, when no mask editing is involved. It just returns a date. */ namespace WpfRFS { [ValueConversion(typeof(DateTime), typeof(string))] public class DateConverter : IValueConverter { public object Convert(object value, Type targetT

User access stripped automatically on subsites

Hello, I create a subsite, select  "use unique permissions", and create the accessgroups: visitors, members and owners.  I then enter som testusers in the visitors and members-groups, log on as them to make sure the testusers have the correct access-levels.  I also make sure my newly created access-groups are the only groups with access to the subsite.  20 minutes later, the testusers no longer have access to the subsite.  What kind of service running on the server would strip these rights?  When I log on with the owner-account, I can still see the testusers in the correct groups, but they no longer have access. I'm hoping for some good suggestions! Thanks, Kjersti

can't change varchar(13) back to a datetime.

SQL Server 2005  I had a date field that was acting weird.  I decided it didn't really need to be a datetime type and changed it to a varchar(13) which it happily let me do.  Opps, I really do want it to be a date time field...  But now it won't let me take it back.  Oddly, it also won't let me change the data in the field, or delete the data in the field.  When I try to change the data I get the following... String or binary data would be truncated.  The statement has been terminated. When I try to modify the field I get the following. first i get a warning... - Warning: Data might be lost converting column 'EODate' from 'nchar(13)'. then i get an error when I say yes 'ExecutiveOrder' table - Unable to modify table.   Arithmetic overflow error converting expression to data type datetime. The statement has been terminated. Ok, I'm not the sharpest tool in the shed...  Any suggestions?  Thanks for your help.

error message customization in create user wizard, change password wizard


Hi All,

Create User Wiard and Change Password Wizard contain error message literals. They display error messages when a user is trying to sign up with an username that already exists and so on.

These error messages are pre-set. How can they be customized. In particular, how can they be adjusted depending on the language.

How is this usually best achieved?

Thanks a lot.


User Profile - last name change suggestion


First time encountering this scenario and not sure if the method I will be doing is the best way of completing it.

User got married and last name has changed, the account was set up with pre-marraige last name and now needs to be updated.

The way we have our SharePoint users set up is by adding them locally then going into ShareServices - User Profile and Properties - View user profiles and add the user there. We are running MOSS 2007 on Windows Server 2003 R2 SP2.

I noticed I couldn't change the Account Name because it's grayed out so I am assuming I'll have to recreate a new local account and SharePoint User Profile? Or is there a simpler way of going about this?


newbie question: change login name of dbo user


My database has a user "dbo" which is dbo of all database objects. The login name for this user is e.g. "Login1". Now I need to change the login name for user "dbo" from "Login1" to a new login name "Login2".

It is not possible to change the related login name of the user "dbo" in the user's properties dialog. And it is also not possible to change or remove the dbo relation in the login name's properties dialog (because a dbo user can not be removed).

Is there any possibility to change the login name of an dbo user? How can I do it?

How do I change the SelectParameter to accept a datetime sql type?


Hi all, 

If I ran my sproc from query analyzer, I get the correct results(data is filtered by datetime), i.e:

 exec Uds.Dashboard_GetJobs '9/20/2010 11:01:23 PM'

However, if I ran it from the Asp.Net page, (ALL records are showed). Looking at the SQL Profiler I see the following call:
 exec sp_executesql N'exec Uds.Dashboard_GetJobs',N'@date nvarchar(21)',@date=N'9/20/2010 11:01:23 PM'

Running both statements above in the query analyzer it WILL return me different results. Why???

Someone mentioned that it looks like I don't have correct data type specified for SQLParameter in .Net application.
I was asked to create something like: cmd.Parameters.Add("@Date",SqlDbType.DateTime).Value = ..

Well, my code in the asp.net is in this form:

   <asp:SqlDataSource ID="sourceRealtimeLogging" runat="server"
      ConnectionString="<%$ ConnectionStrings:UctConnectionString %>"
      SelectCommand="exec Uds.Dashboard_GetJobs">
        <asp:ControlParameter ControlID="UpdatedTimeUTC" Name="date" PropertyName=&quo

How to change item user permissions by workflow using item fields


Hi, thats not a question, but solution. I have read a lot of requests about how to perform this task, so here it is.

Code behind will run workflow which will take XXZ and XXY which are user fields and assign their values as "Full acces" and "Design" user permissions to given list item.

This workflow contains two sections. onWorkflowActivated1_Invoked and SetItemPermissionsEx.

using System;
using System.ComponentModel;
using System.ComponentModel.Design;
using System.Collections;
using System.Drawing;
using System.Linq;
using System.Workflow.ComponentModel.Compiler;
using System.Workflow.ComponentModel.Serialization;
using System.Workflow.ComponentModel;
using System.Workflow.ComponentModel.Design;
using System.Workflow.Runtime;
using System.Workflow.Activities;
using System.Workflow.Activities.Rules;
using Microsoft.SharePoint;
using Microsoft.SharePoint.Workflow;
using Microsoft.SharePoint.WorkflowActions;

namespace ITCSharepointAddons.Comm_UpdateItemPermissions
  public sealed partial class Comm_UpdateItemPermissions : SequentialWorkflowActivity
    public Guid webID; 
    public Guid siteID; 
    public Guid listID; 
    public int itemID; 
    public Guid workflowId = default(System.Guid); 
    public SPWorkflowActivationProperties workflowProperties = new SPWorkflowActivationProperties(); 


Change user display name


when i add a new user from the AD to the SharePoint.

the user name is formatted like this : " domainName\username".

can i change the display name of my users to this : "username" or "firstName lastName"?

must the change be done in the Ad or within sharePoint?


change user id


I am  administrator of My share point website. If i login my user id(speedstep\jg) it will displayed System Account(SHAREPOINT\system).

how to change System Account to My user id?

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