TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
waqas khan
NA
2
560
Problem in asp.net application while running on liveserver
Nov 17 2016 5:51 AM
i was trying to upload my asp.net webform website on live server . Database handled with LInq . Every thing was working fine on local host . On live server em able to get data from database . But unfortunately when i try to insert data to any table it give me the following error
"Cannot insert the value NULL into column 'Id', table 'db.dbo.branch'; column does not allow nulls. INSERT fails. The statement has been terminated.
" .
Although in database Id is auto increment . my data insertion code is
public static bool addbranch(branch b) {
ctownDataContext db = new ctownDataContext(); int count = (from x in db.GetTable() where x.name == b.name || x.brachno == b.brachno select new { x.Id }).Count(); if (count == 0) { db.branches.InsertOnSubmit(b); db.SubmitChanges(); return true; } else { return false; }
}
while my connection string is
providerName="System.Data.SqlClient" />
Reply
Answers (
1
)
How to run progress bar while inserting data into sql?
ERROR: Method name expected