GridView problems.

Discussion in '.NET' started by DrunkenSeer, Jun 21, 2007.

  1. DrunkenSeer

    DrunkenSeer

    Joined:
    Jun 21, 2007
    Messages:
    2
    Hello,

    Should first of all say I am very new to ASP.NET and i am currently working my way through several books however I have come accross a problem.
    I am using Visual Studio Expression.

    I have a SQLDatasource that has several Columns
    Title, Author, LastRead, PageCount.

    I have the Title set to not allow Nulls.

    Now the issue I am having is that I have set up a GridView with edit enabled.

    I have the title field set to ReadOnly so people cannot change the title however when updating it says cannot insert Null value.

    I have therefore set the ConvertEmptyStringToNull="false" on the boundfield as well as the InsertParameter and UpdateParamter for 'Title'

    Yet I am still getting the exception cannot insert Null Value into 'Title'

    can anyone help? The book I am using tells me that it will work with the ConvertEmptyStringToNull will work yet it doesn't. Am I missing sumthin here?

    Any help will be.... well.... Greatly appreciated!!! :cheers:
     
    DrunkenSeer, Jun 21, 2007
    #1
    1. Advertising

  2. DrunkenSeer

    DrunkenSeer

    Joined:
    Jun 21, 2007
    Messages:
    2
    Can no-one help?? it is happening again this time with columns that are not even on the gridview.

    i.e. the gridview shows title and image author and price yet if I try an edit a column it says I cannot insert a null value into Year Published?!?

    seems all a bit mad to me.

    [SqlException (0x80131904): Cannot insert the value NULL into column 'YearPublished', table 'C:\DOCUMENTS AND SETTINGS\CHRISTOPHER HANCOCK\DESKTOP\R&D\VISUAL WEB\DATABASEHOUR13+\APP_DATA\MYFIRSTDATABASE.MDF.dbo.Books'; column does not allow nulls. UPDATE fails.
    The statement has been terminated.]


    How do I solve this as I will not be able to create any editable gridviews where this keeps happening.
     
    DrunkenSeer, Jun 25, 2007
    #2
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Nalaka

    GridView in a GridView

    Nalaka, Nov 11, 2005, in forum: ASP .Net
    Replies:
    6
    Views:
    6,608
    Nalaka
    Dec 5, 2005
  2. wallermj@hotmail.com
    Replies:
    3
    Views:
    5,115
    wallermj@hotmail.com
    Nov 21, 2005
  3. Carlos Albert

    GridView in a GridView

    Carlos Albert, Dec 5, 2005, in forum: ASP .Net
    Replies:
    2
    Views:
    501
    Carlos Albert
    Dec 6, 2005
  4. Carlos Albert

    Gridview inside Gridview little problems...

    Carlos Albert, Dec 6, 2005, in forum: ASP .Net
    Replies:
    1
    Views:
    3,660
    Carlos Albert
    Dec 6, 2005
  5. =?Utf-8?B?bWdvbnphbGVzMw==?=

    GridView Hierarchical View - Gridview in Gridview

    =?Utf-8?B?bWdvbnphbGVzMw==?=, May 9, 2006, in forum: ASP .Net
    Replies:
    1
    Views:
    17,974
    =?Utf-8?B?UGhpbGxpcCBXaWxsaWFtcw==?=
    May 9, 2006
Loading...

Share This Page