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
Abdalla Omran
NA
334
32k
How to read several different commands in one method
Jun 24 2019 7:46 AM
Hallo
i want to read many different commands in one method passing int year as parameter for method . the method should read 3 different commands for example 2017,2018 and 2019 .
what i have done so far is the following
What I have tried:
public
int
GetSumYear(
int
year)
{
int
sum = 0;
string
CS =
"+++++"
using
(SqlConnection connection =
new
SqlConnection(CS))
{
connection.Open();
SqlCommand command =
new
SqlCommand(
"select COUNT (ÜbertragenAm) from BranchSale_all where ÜbertragenAm between '2017-01-01' and '2018-01-01'"
, connection);
// here i want to read the same command for 2018 and 2019
sum = (
int
)command.ExecuteScalar();
}
return
sum;
}
Reply
Answers (
3
)
how to insert multi record in grid view on one id of emp?
TEAMVIEWER LIKE PROGRAM