Techiio-author
Started by Pauline MorelSep 16, 2021

Open
How does one use ADO.Net and enter a random date on a notetaking application?

1 VIEWES 0 LIKES 0 DISLIKES SHARE
0 LIKES 0 DISLIKES 1 VIEWES SHARE

I am looking to enter a random date for a given class in a note when passing a note of a block of text. How does one input and add a random date for a given note text?

using CY.Data.Interface;
using CY.Model;
using System;
using System.Collections.Generic;
using System.Data;
using System.Data.SqlClient;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace CY.Data.Ado
{
public class NoteRepository : INoteRepository
{

.....


public static void RandomDate()
{

// 1. Adding the Start Date for the number of time that it is going to start.
// 2. Adding the End Date for the time it is going to end.
// 3. Adding the range of the time for the total number of days.
// 4. Add a int randDays where one converts the rnd.Next to in a Int32 numRange format.
// 5. Print a Random Random on a console writeline input.
DateTime startDate = DateTime.Now.AddYears(-1);
DateTime endDate = DateTime.Now;
double numRange = (endDate - startDate).TotalDays;
int randDays = rnd.Next(Convert.ToInt32(numRange));
DateTime randDate = startDate.AddDays(randDays);
Console.WriteLine(randDate.ToString());
}
}
}

The end result should be utilizing a random Date and running it on the browser. How does use ADO.NET to integrate printing a random date on a given note?

0 Replies

You must be Logged in to reply
Trending Technologies
15
Software40
DevOps47
Frontend Development24
Backend Development20
Server Administration17
Linux Administration26
Data Center24
Sentry24
Terraform23
Ansible83
Docker70
Penetration Testing16
Kubernetes21
NGINX20
JenkinsX17
Techiio-logo

Techiio is on the journey to build an ocean of technical knowledge, scouring the emerging stars in process and proffering them to the corporate world.

Follow us on:

Subscribe to get latest updates

You can unsubscribe anytime from getting updates from us
Developed and maintained by Wikiance
Developed and maintained by Wikiance