If this is your first visit, be sure to
check out the FAQ by clicking the
link above. You may have to register
before you can post: click the register link above to proceed. To start viewing messages,
select the forum that you want to visit from the selection below.

Enjoy an ad free experience by logging in. Not a member yet? Register.

Need Help Inserting ID

Hello everyone! I am new to the form and looking for some help. I am working at a local newspaper as a web programmer and my current project is giving me some trouble. Here is the situation, I am making a form for users to input data on alumni but when I go to insert the data it fails because it needs a value for the id field. I am in Visual Studio 2010. Here is my code:

using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

what does your table look like- is the 'id' field the primary key? is it an identity field? if it is PK, and is identity, then don't try to assign anything to it- SQL will take care of it... if it is PK and not identity field- you should probably change it to be identity field and let SQL take care of it... if it is not PK or identity field, then you need to get the id from somewhere- add a textbox or something on the page that needs filled out

Users who have thanked alykins for this post:

I left person.id blank because I was having trouble, if I comment it out I still get an error. How do I check what is the PK in SQL Server management studio? I am really green at this stuff and the person that was supposed to help me out quit so I am by myself on all this stuff.

I don't know- no clue what your tables look like- learning DB schemas and architectures is in depth and requires more than just a thread--i don't see anything with the word "organization" in it- no idea what you're talking about :|

Oh, yes I forgot to tell you that I had fixed the key problem. Now I am working on an issue with the file upload. It is saying that I Cannot use a leading .. to exit above the top directory. I am thinking this is a problem I will have to deal with myself? Thanks for your help everyone!