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
darma teja
NA
496
337.4k
How to write unittest for database classes?
Dec 14 2017 4:53 AM
public
bool
insertCustomer(Customer newCustomer)
{
bool
inserted =
false
;
SqlCommand cmd=
new
SqlCommand();
cmd.CommandText=
"insert into Customer (name, firstname, address) values (@name, @firstname, @address)"
;
cmd.Parameters.add(
new
SqlParameter(
"@name"
,Customer.name));
cmd.Parameters.add(
new
SqlParameter(
"@firstname"
,Customer.firstname));
cmd.Parameters.add(
new
SqlParameter(
"@address"
,Customer.address));
// executes command here and it returns new ID isnsterted= true;
return
inserted ;
}
Reply
Answers (
1
)
File Exists using url
How to find earliest and latest date from list of dates?