Click here to Skip to main content
14,742,011 members

Comments by Benktesh Sharma (Top 28 by date)

Benktesh Sharma 13-Mar-20 6:40am View
The question is only stating the problem in the index out of bound error. The original code intended to display first and every 10th after and so did the proposed solution.
Benktesh Sharma 12-Mar-20 16:13pm View
The solution is correct to the extent that the assumption is re-stated. First and every 10th after that. Updated.
Benktesh Sharma 12-Mar-20 16:11pm View
Did you intend to print every 10th including the first or excluding the first?
Benktesh Sharma 12-Mar-20 8:51am View
I see. Thanks.
Benktesh Sharma 12-Mar-20 7:03am View
@Nelek, the loop is printing the actual number in the array. The original code from the poster of the question intended to print 1st, 10th and so on. In addition, 'every 10th' implies first, tenth, twentieth and so one. You may be right in handling other edge conditions, but the original concern was 'index out of bound exception'.
Benktesh Sharma 8-Aug-19 12:15pm View
Don't worry. Things can be simpler if you make them simpler. Bootstrap is not an exception. For testing things out, just add link to bootstrap from cdn in the same page
. It will override the bootrsap only on this page for your testing.
Benktesh Sharma 8-Aug-19 10:29am View
:). The tags are Oracle, VB.NET, ASP.NET4 and that's why I asked a language-specific question.
Benktesh Sharma 8-Aug-19 10:26am View
The theme may be an additional dependency. Also check if you are using Bootstrap 3 or 4.
Benktesh Sharma 8-Aug-19 10:25am View
You could use col-lg-offset-4 in bootstrap 3 which will move the field by that offset from left.
Benktesh Sharma 8-Aug-19 8:41am View
What is your code to store the date? Your loop will run once and the value of i will be 0 all the time so can't be used for month, day or year.
Benktesh Sharma 8-Aug-19 8:25am View
Are you looking at raw dates and get the range of months beginning from the first date? Or you just want to create a list starting with 08/2019 and values 3 months after each of those?

Also, are you looking in strictly SQL or C# or other language?
Benktesh Sharma 7-Aug-19 9:29am View
One area to check is the profiles in launchSetting for iisexpress and iis. There must be two different ports. If you are using iisexpress, then the iis setting looks like below:

"iisSettings": {
"windowsAuthentication": false,
"anonymousAuthentication": true,
"iisExpress": {
"applicationUrl": "http://localhost:8881",
"sslPort": 44325
Benktesh Sharma 3-Aug-19 11:21am View
Got it. Thanks
Benktesh Sharma 3-Aug-19 8:25am View
If the installed office is of 64 version and VS is 32 bit version, I am guessing you cannot refer to that office. Is that not correct? It is not about the target, but the reference to Microsoft.Office.Interop.Excel.Application. For example, SDK for 64 bit is not available when VS is 32 bit.
Benktesh Sharma 2-Aug-19 10:36am View
One area that you can check is the bit version. Check if 32bit version or 64bit of office and the corresponding version of Visual Studio match.
Benktesh Sharma 1-Aug-19 16:45pm View
Obviously, the behavior is something not-legal. The copy site is flagged as insecure by my firewall.
Benktesh Sharma 1-Aug-19 16:39pm View
Can you include the structure of SchoolTable?
Benktesh Sharma 1-Aug-19 13:58pm View
Got it. Looks like the solution I provided is no good. Going to delete it.
Benktesh Sharma 31-Jul-19 10:22am View
Thanks, @TheRealSteveJudge. I accidentally deleted solution 2 that was rated. Would you please re-rate. Thank you.
Benktesh Sharma 31-Jul-19 10:11am View
Thaks will do.
Benktesh Sharma 31-Jul-19 10:05am View
In that case, the constructor can initlize the parameters:
 public class EventsController : ApiController
        private EmailAddress[] emailAddress;
        private Attendee[] attendees;
        private Event[] events;

        public EventsController()

            EmailAddress[] emailAddress = new EmailAddress[]
                new EmailAddress { Address = "", Name = "helloname" }

            Attendee[] attendees = new Attendee[]
                new Attendee { EmailAddresses = emailAddress , Type = "user"}

            Event[] events = new Event[]
                new Event { Id = 1, Subject = "Hello World", Start = DateTime.Parse("2019-07-31 18:00:00"), End = DateTime.Parse("2019-07-31 20:00:00"), Location = "NCS Hub", Attendees = attendees }


Benktesh Sharma 28-Jul-19 9:48am View
Thanks. I updated the question.
Benktesh Sharma 27-Jul-19 9:42am View
Thanks Thomas Daniels
Benktesh Sharma 26-Jul-19 17:09pm View
in C++, I can have a function (e.g. Fibonacci) like below:

constexpr int Fibonacci(int n) {
//cout << "Executed Fib" << endl;
switch (n) {
case 0: return 0;
case 1: return 1;
return Fibonacci(n - 1) + Fibonacci(n - 2);


and I can check in the main to ensure the function is correct by doing something like:

int main()
static_assert(Fibonacci(5) == 7, "Bad Program");

That means I do not have to wait till run time to evaluate if the Fibonacci function will work. It is like a simple test at a compile-time. I am asking if I can do thing kind of thing in C#.
Benktesh Sharma 26-Jul-19 11:50am View
As mentioned above, a trigger could be a stored procedure to send email. Example here -
Benktesh Sharma 25-Jul-19 10:31am View
That is even easier. Another suggestion is to make a third project (a dll) that only does the database reading and writing and refer to that dll from both projects. This way you can scale the mdb to something else and individual projects won't need to worry about the data access. Lets say the dll has class ProcessData with member functions to do read/write. Then both project can refer to the dll and file read/write can be handled at one place.
Benktesh Sharma 10-Jul-19 14:59pm View
Wonderful. Thanks.
Benktesh Sharma 10-Jul-19 11:13am View
Thanks Steve,
I am glad that the solution I provided helped you. To get a solution that you need, I believe we can extend the attribute to pass the values as well as the equality operator. Let me work a bit on this and provide you with something to get started. Thanks.