Me again!
I have a question re. inserting into a sql table using LINQ. I am essentially creating a feedback form whereby a user enters there details, hits submit and their data is inserted into a sql table.
I haven't got very far!!!
protected void btnSubmitFeedback_Click(object sender, EventArgs e)
{
ORFeedDataClassesDataContext db = new ORFeedDataClassesDataContext();
tblOnlineReportingFeedback newtblonlineReportingFeedback = new tblOnlineReportingFeedback();
newtblonlineReportingFeedback.Name = "txtbxFdName";
db.tblOnlineReportingFeedbacks.InsertOnSubmit(newtblonlineReportingFeedback);
db.SubmitChanges();
}
I have set up the sql table so that an unique autonumber is inserted each time a row is inserted. However, when I run the above, I receive the following:
"SqlException was handled by user code - String or binary data would be truncated. The statement has been truncated"
Can anyone think of a work around for this? Chances ar emy code is a load of poo anyway so if someone can correct me, I would be most grateful.