Search Results

Search found 2 results on 1 pages for 'haythamhamdy'.

Page 1/1 | 1 

  • Datetime problem in VB 2005

    - by haythamhamdy
    I am using VB2005 and SQL SERVER 2000. PVAR_SQL_STR = "INSERT INTO GLR_US_PERIOD (ORG5_CODE,PERIOD_YEAR,PERIOD_CODE,PERIOD_NO,FROM_DATE,TO_DATE,INSERT_USER,INSERT_DATE) VALUES " _ & "('" & PVAR_COMPANY_CODE & "' ,'" & TextBox1.Text & "','" & Serial1.Text & "'," & TextBox2.Text & ", '" + DateTimePicker1.Value.ToString("D") + "' ,'" + DateTimePicker2.Value.ToString("D") + "','" & PVAR_USER_CODE & "','" + Now.ToString("F") + "')" Syntax error converting datetime from character string because of this part only: Now.ToString("F") Why, I do not know but when I change into Now.ToString("D") it works well but it saves the date only. I want to insert date and time.

    Read the article

  • DATETIME PROBLEM VB 2005

    - by haythamhamdy
    I AM USING VB2005 AND SQL SERVER 2000 PVAR_SQL_STR = "INSERT INTO GLR_US_PERIOD (ORG5_CODE,PERIOD_YEAR,PERIOD_CODE,PERIOD_NO,FROM_DATE,TO_DATE,INSERT_USER,INSERT_DATE) VALUES " _ & "('" & PVAR_COMPANY_CODE & "' ,'" & TextBox1.Text & "','" & Serial1.Text & "'," & TextBox2.Text & ", '" + DateTimePicker1.Value.ToString("D") + "' ,'" + DateTimePicker2.Value.ToString("D") + "','" & PVAR_USER_CODE & "','" + Now.ToString("F") + "')" Syntax error converting datetime from character string BECAUSE OF THIS PART ONLY Now.ToString("F") why i do not know but when i change into Now.ToString("D") it works well but it SAVES DATE ONLY I WANT TO INSERT DATE AND TIME THANKS

    Read the article

1