.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 Update a row with Current system date and add a Prefix to it

Posted By:      Posted Date: September 02, 2010    Points: 0   Category :Sql Server
Hi Could you please help me out, How to write an update Query to update the row with the current system date and I need to add a prefix like "ABC_" The Column is in VARCHAR datatype. I need it like  ABC_System date update Table1 set column1= getdate() updates the row when i add prefix,it throws Syntax error converting datetime from character string.   Thanks in advance Shan

View Complete Post

More Related Resource Links

How do I populate a Textbox with the current system date and time?

Hello, all! First I am a complete newbie and I have a project that I need help with. I am building a Windows form application to keep track of servers and their last maintenence date. I have a simple one table SQL Express database (empty). One of my rows is set up to store the date and time. But first, I need to know how to auto populate the system date and time to a TextBox control everytime someone opens the application. I have tried using the System.DateTime method in the Textbox event properties as a string but I am doing something wrong. Thanks in advance for your help and guidence!

Convert Update Date/Time to VB.NET



I was wondering if someone could convert this into VB.NET for me.  I'm not a PHP pro and not entirely sure what's happening here nor do I know how to get this to display the same way.

The new field is within a DetailsView, so you can give me example code as well, I'll greatly appreciate it.

Thanks.. -Jeff

PHP Code:

function updFormat($tStamp) {
	$tsTime = (strftime('%I', $tStamp) + 0) . strftime(':%M %p', $tStamp);
	// 86400 == # of seconds in a day
	$tsDays = floor($tStamp / 86400);
	$nowDays = floor(time() / 86400);
	if ($tsDays == $nowDays) $updTime = "Today at $tsTime";
	elseif ($tsDays == $nowDays - 1) $updTime = "Yesterday at $tsTime";
	else $updTime = strftime('%b ', $tStamp) . (strftime('%d', $tStamp) + 0) . strftime(', %Y' , $tStamp);

	return $updTime;
<asp:DetailsView ID="dtv_LastUpdated" runat="server" Width="100%" 
    AutoGenerateRows="False" DataSourceID="ods_MVPParcelUpdate" 
    CellPadding="1" CellSpacing="1" GridLines="None">
        <asp:BoundField DataField="Update_time" HeaderText="Parcel Data:" 

.net update - current list

Is there a list of applicable updates for .net 2.0sp2, 3.5sp1, 4.0 ? Thanks  

AjaxControlToolkit.CalendarExtender - highlight current date

I have used AjaxControlToolkit.CalendarExtender for calendar in my project.but anyhow I am unable to highlight current date  in calendar control.(Note: Current date I mean is today's date and not the selected date.)e.g.( If today is 15th August 2010, and I have selected 24 August 2010. then when I press calendar icon, I should see 15 august highlighted with different look or same as selected date 24 highlighted in August month of 2010 page in calendar popup.)Please guide me to accomplish the taskThanks in advance for support.

How to insert the Current date and time in to SQL Table..

Hello Members,              I have create the table as per the following ..create table company(  empname varchar(30),  empid int,  joindate smalldatetime)I tried,insert into table values('Kumar',202, ??????)I want to insert Current date and time into table Company.....Please give me the solution...Thanks.. 

How to get "Current Date" on SharePoint Designer for Invoice Ageing Data View Report??

Hi Experts, I would like to know how can i get/show "Current Date" in SharePoint Designer ?? Any good tutorial ? FYI, I need this "Current Date" for my Ageing Data View Report, Purpose To offset with "Invoice Receive Date" to get total days of payment payable for the invoice. Please assists, Thanks

When attempting to install Security Update Microsoft for the Microsoft 2007 Office system updates (u

When attempting to install "Security Update Microsoft for the Microsoft 2007 Office system updates (updates KB2277947 and KB982331)" the sintallation fails and then I recieve the error "The detection failed, this can be due to a corrupted installation database". System Info: XP Home Edition Version 2002 Service Pack 3 Intel Atom CPU N270 @ 1.60 GHz I am running XP and have installed and run the "Fit It" tool, to no avail. I even tried downloading each update individually, from the Microsoft site, instead of through the automatic update. I also read this same question posted by another user (link: http://social.technet.microsoft.com/Forums/en-US/sharepointadmin/thread/cfa66cd3-2aa2-44ee-9393-ffae41d4f70c/) only to find his info contained no answer either. How do I fix this so that I can get these updates installed?

how to get the current date and time using sharepoint designer workflows

hi, how to send an email using sharepoint designer workflow when an item equals to end time. How to get the current date and time.I am able to capture the date but not the time  the time is showing as 12:00:00 AM. First i have create an variable  and storing the date and time in that variable and i am comparing the variable value with end time. If both are equal then i want to send an mail to attendees

How to display the date only till current date in ajax calendar extender .

Hi,1) How can i display the date only till current date in ajax calendar extender ?2)How to validate the date in one TextBox with the Date in another TextBox ?    Please Help me ...

How To Update Database When The System Shut Down By Light Problem

Hi,I want to update the User LoggedIn Status to 'False', when the system shut down by light problem, or when the user click the 'Browser Close Button'Please help me in details.Thanks in advance.

Date maskedEdit with watermark doesn't update on invalid date


I'm trying to use the TextBoxWatermarkExtender with MaskedEditExtender/Validator and have found a bug (I think).

In the textbox I enter an invalid date such as 55-55-5555 and exits the textbox. I would then expect the watermark to be shown, but it doesn't. Instead the prompchar is shown (like __-__-____).

If I simply give focus to the textbox and then another control, the watermark is shown.

Is there a workaround such as manually force the TextBoxWatermarkExtender to update.

I'm not the best with javascript, I tried to call focus() and blur() on the textbox in the textbox's onBlur event using window.setTimeout. This works in Firefox, but not IE8, also there has to be a better way I think :-)

            <asp:TextBox ID="TextBox5" runat="server" MaxLength="1" onBlur=""/>
            <asp:ImageButton ID="ImgBntCalc" runat="server" ImageUrl="~/images/Calendar_scheduleHS.png" CausesValidation="False" />

        <ajaxToolkit:TextBoxWatermarkExtender ID="TBWE2" run

update list text or date value via sharepoint designer using JAVA


Hi All,

Bit of a noob question - but tried all sorts and can't get this to work - also first time i've ever used sharepoint.

(I'm using sharepoint designer 2007) I have a form, on the form i select a type (drop box choice) and it hides or displays a related field, I want to auto populate the field when it displays, below is the java i have currently. 

Please advise how to populate (date field) with tommorows date, and also if it was a text field with the word "testdre"

<script type="text/javascript">
  function hideFieldsOnStart()
   //hide the control at start
   var control = getTagFromIdentifierAndTitle("input","TextField","Urgent Change Justifacation");
   //add an onchange event to the dropdown
   getTagFromIdentifierAndTitle("select","DropDownChoice","Change Type").onchange = function() {ChangeEvent()};
  function ChangeEvent()
   //get the dropdown

return records based on current date?


I tried finding a QA which already addressed this idea, but with no luck. Sorry if it's been addressed before.


I have a table where sales pricing is managed; it contains history of pricing where every price record has an 'effective date'. Currently when a user needs the 'active' price for a customer/item combination, the table is queried by the record that has the most recent 'EffectiveDate' before GETDATE(). Here is the def for table 'tim_PriceSheet'

ItemKey int, not null

EffectiveDate datetime, notnull

CurrID varchar(3)

ListPrice decimal (15,5)

The primary key is set on ItemKey, EffectiveDate

Sample Data:


ItemKey	EffectiveDate	    CurrID	ListPrice
45	2010-07-01 00:00:00.000	CAD	100.00000
45	2010-09-14 00:00:00.000	CAD	110.00000
45	2010-10-01 00:00:00.000	CAD	112.00000
63	2010-09-01 00:00:00.000	CAD	45.00000
63	2010-09-01 00:00:00.000	USD	45.00000
63	2010-09-18 00:00:00.000	CAD	40.00000
63	2010-10-01 00:00:00.000	USD	40.00000
63	2010-10-15 00:00:00.000	CAD	41.00000
63	2010-10-21 00:00:00.000	USD	41.00000

My challenge is this:

I want to return a record set which shows the current price for each distinct item and currency code; in the example below the result would be based on the date being September 16, 2010

The current process has used all of its system allowance of handles for Window Manager objects



I get an error message which says like "The current process has used all of its system allowance of handles for Window Manager objects" that i dont know what it its. I have winForm project and it works fine but after sometime it raised this error.

I really need help on this.


Using Now() to get the current date in a MDX expression




Could anyone please let me know how I could use the VBA function Now() to get the current time and assign it to the (year-month) hierarchy?

I need this for a report which retrieves amount collected in the past 24 months from the current date.

I have read that I could use the VBA functions but I am not sure how to assign it to the time dimension hierarchy and then use the LASTPERIODS function to get the past 24 months of data.


Any help would be greatly appreciated.



ServiceSecurityContext.Current.PrimaryIdentity.AuthenticationType Throwing System.UnauthorizedAccess



I have a WCF web service enabled with two binding configurations. One using basicHTTPBinding with NTLM authentication and another with wsHTTPBinding using X509 certificate authentication.



I am trying to retrieve the AuthenticationType from the ServiceSecurityContext.Current.PrimaryIdentity.AuthenticationType property. It throws me the following error:


Type : System.UnauthorizedAccessException, mscorlib, Version=, Culture=neutral, PublicKeyToken=b77a5c561934e089
Message : Attempted to perform an unauthorized operation.
Source : mscorlib
Help link :
Data : System.Collections.ListDictionaryInternal
TargetSite : System.String get_AuthenticationType()
Stack Trace :    at System.Security.Principal.WindowsIdentity.get_AuthenticationType()

Here comes the configurations and code for you to have a look:

A separate application pool is used, a service account is configured as Identity.

Directory Security >
Integrated Windows Authentication : Enabled
Anonymous : Enabled


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