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
Bineesh Viswanath
NA
1k
777.9k
Foreign key data deleting error in ADO.NET Application
Jan 2 2014 1:50 PM
Sir, I am in the midst of a Data Deleting problem as it a foreign key.
Below the table where getting problem when delete data:-
tbl-Class tbl_Division
------------ ----------------
classId divisionId
className divisionName
noOfSeats classId
I cannot delete data from tbl_Class
as I getting the error in below :-
Form.cs code:-
SP Class
code :-
public int
ClassDelete(
classInfo
infoClass)
{
try
{
if
(sqlCon.State ==
ConnectionState
.Closed)
{
sqlCon.Open();
}
SqlCommand
cmd =
new
SqlCommand
(
"ClassDelete"
, sqlCon);
cmd.CommandType =
CommandType
.StoredProcedure;
cmd.Parameters.Add(
"classId"
,
SqlDbType
.Int).Value = infoClass.classId;
int
inCount = cmd.ExecuteNonQuery();
if
(inCount > 0)
{
MessageBox
.Show(
"Deleted Successfully"
,
"School Automation"
,
MessageBoxButtons
.OK,
MessageBoxIcon
.Information);
}
return
inCount;
}
catch
(
Exception
)
{
throw
;
}
}
Please tell how can overcome this error.
Reply
Answers (
1
)
database retrival value of zero, but linqpad is not zero
How to get the Public IP