Tech
Forums
Jobs
Books
Events
Interviews
Live
More
Learn
Training
Career
Members
Videos
News
Blogs
Login
Sign Up
Ask Question
1
Reply
How to write unittest for database classes?
darma teja
Dec 14 2017 4:53 AM
148
Reply
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 ;
}
Upload Source Code
Select only zip and rar file.
Post
Reset
Cancel
Answers (
1
)
Next Recommended Forum
File Exists using url
How to find earliest and latest date from list of dates?