How to insert new record in asp.net 2.0

Discussion in '.NET' started by yazzy, Jul 3, 2006.

  1. yazzy

    yazzy

    Joined:
    Jul 3, 2006
    Messages:
    1
    Hi

    I am very very new to ASP.NET 2.0 and C#

    I have a simple form and i need to insert a new record.

    I used the following query

    INSERT INTO FeatS
    (ProjectID, Title)
    VALUES (@projectID, @Title);
    Select FeatureID, ProjectID,Title
    From Feats
    Where (FeatureID = SCOPE_IDENTITY())

    But i got an error

    Cannot insert the value NULL into column 'FeatureID', table 'CRM.dbo.FeatS'; column does not allow nulls. INSERT fails.

    Could someone please help ?

    Thanks in advance
     
    yazzy, Jul 3, 2006
    #1
    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. Sharon
    Replies:
    0
    Views:
    4,085
    Sharon
    Aug 10, 2004
  2. loreille
    Replies:
    1
    Views:
    4,489
    Ben Strackany
    Oct 28, 2004
  3. Frits van Soldt

    How to insert a new record in detailsview when there are no record

    Frits van Soldt, Nov 16, 2005, in forum: ASP .Net Web Controls
    Replies:
    2
    Views:
    789
    Frits van Soldt
    Nov 17, 2005
  4. Guest
    Replies:
    1
    Views:
    274
    Alex G
    Jan 9, 2004
  5. Maximus
    Replies:
    2
    Views:
    196
    Bob Barrows [MVP]
    Apr 12, 2007
Loading...

Share This Page