When i tried to insert News data

Last post 07-26-2009 12:34 AM by rvega75. 5 replies.

Sort Posts:

  • Angry [:@] When i tried to insert News data

    07-23-2009, 7:07 AM
    • Member
      5 point Member
    • africano
    • Member since 03-22-2007, 6:04 AM
    • Posts 29

      i tried to insert my own data and i connect it to the SQL, when i do try to insert data it gives me this error, also i change in the database this default value to (getutcdate()) and still have the same error.

    Server Error in '/' Application.

    The version of SQL Server in use does not support datatype 'date'.

    Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

    Exception Details: System.ArgumentException: The version of SQL Server in use does not support datatype 'date'.

    Source Error:

    An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.

    3point5
    Color separation, Advertising, Decorate, Designs, 2D Animation, Web Design, Web Develop and web Host. All in One www.3-point-5.com
  • Re: When i tried to insert News data

    07-23-2009, 11:01 AM
    • Member
      18 point Member
    • rvega75
    • Member since 07-16-2009, 2:06 PM
    • Posts 6

    Please elaborate in your situation. What type of connectiona are you using? are you Using LINQ?  SQLDataAdapters? or a SQLCommand whith the insert SQL Statement itself?

    This sounds like you're not using the correct datatype, sql server supports 'datetime', the datetime type of .NET maps perfectly to this.

    Alos if you're setting a default value in SQL server, try removing this particular field from the insert statemnt used in the .NET application that you're building.

    Best regards,

    Rodrigo Vega

  • Re: When i tried to insert News data

    07-23-2009, 11:08 AM
    • Contributor
      3,262 point Contributor
    • basheerkal
    • Member since 06-28-2009, 3:33 AM
    • Kerala, India
    • Posts 772

    Hi,

    Try to find any occurance of type= 'Data"  or Type="Date)  in your html code and replace it "Date" with DateTime.

     

    Good Luck

    azk

    Kindly mark this post as "Answer", if it helped you.
  • Re: When i tried to insert News data

    07-23-2009, 7:18 PM
    • Member
      5 point Member
    • africano
    • Member since 03-22-2007, 6:04 AM
    • Posts 29

    Thank you very much it works with me but it shows me another error with the ID can't be NULL so how can i make it Autonumbering ?

    and by the way i am using the sql statement with sql database 2005  

    3point5
    Color separation, Advertising, Decorate, Designs, 2D Animation, Web Design, Web Develop and web Host. All in One www.3-point-5.com
  • Re: When i tried to insert News data

    07-24-2009, 9:18 PM
    • Contributor
      3,262 point Contributor
    • basheerkal
    • Member since 06-28-2009, 3:33 AM
    • Kerala, India
    • Posts 772

    Hi,

    to creat an AutoNumber field in sql2005 please refer this link

    http://www.kodyaz.com/content/autonumberidentitycolumnsqlserver2005.aspx

     

    azk

     

    Kindly mark this post as "Answer", if it helped you.
  • Re: When i tried to insert News data

    07-26-2009, 12:34 AM
    • Member
      18 point Member
    • rvega75
    • Member since 07-16-2009, 2:06 PM
    • Posts 6

    for that in the properties of the SQL studio manager, you have to set in the properties for that id particula colum, set Identity to "yes", and that's all it takes to make auntonumber, just make sure that the datatype for the this id column is int, if it isn't int, the Identity property won't even show.

Page 1 of 1 (6 items)