Linux hot command for solutions

Install node red


pi@raspberry:~ $ bash <(curl -sL https://raw.githubusercontent.com/node-red/raspbian-deb-package/master/resources/update-nodejs-and-nodered)

Auto Run NODE RED On Boot

To do that you can run the command bellow

pi@raspberry:~ $ sudo systemctl enable nodered.service

Then, for the autostart to take effect restart your Pi:

pi@raspberry:~ $ sudo reboot

How to completely uninstall docker

Step 1

dpkg -l | grep -i docker
To identify what installed package you have:

Step 2

sudo apt-get purge -y docker-engine docker docker.io docker-ce  
sudo apt-get autoremove -y --purge docker-engine docker docker.io docker-ce  
The above commands will not remove images, containers, volumes, or user created configuration files on your host. If you wish to delete all images, containers, and volumes run the following commands:
sudo rm -rf /var/lib/docker
sudo rm /etc/apparmor.d/docker
sudo groupdel docker
sudo rm -rf /var/run/docker.sock
You have removed Docker from the system completely.

Docker: Error response from daemon: Unknown runtime specified nvidia.

Solution:

Step 1  Install the repository for your distribution by following the instructions

curl -s -L https://nvidia.github.io/nvidia-docker/gpgkey | \
  sudo apt-key add -
distribution=$(. /etc/os-release;echo $ID$VERSION_ID)
curl -s -L https://nvidia.github.io/nvidia-docker/$distribution/nvidia-docker.list | \
  sudo tee /etc/apt/sources.list.d/nvidia-docker.list
sudo apt-get update

Step 2   Install the nvidia-docker2 package and reload the Docker daemon configuration:

sudo yum install nvidia-docker2
sudo pkill -SIGHUP dockerd










Clean Cache with 


sudo sh -c "echo 1 > /proc/sys/vm/drop_caches"


Got permission denied while trying to connect to the Docker daemon socket at unix:///var/run/docker.sock: connect: permission denied.

If you have created the docker group and add your user to the docker group but still get the error then:

Do this

$ newgrp docker
and Verify that you can run docker commands without sudo.
$ docker run hello-world










Create table in MS Access

HOW TO CREATE TABLE IN MS ACCESS

I will show how to create tables base on the following diagram and its textual specification.
You can do this same process by using MS Access.
In order to create a database that contains these two tables let use the following code after this diagram.
Description of database tables created by using Enterprise Architect CASE tool

Solution:

CREATE TABLE Occupation(
occupation_code SMALLINT NOT NULL,
name VARCHAR(50) NOT NULL,
max_working_hours_in_week SMALLINT=40 NOT NULL,
min_sal CURRENCY NOT NULL,
CONSTRAINT pk_occupation PRIMARY KEY(occupation_code),
CONSTRAINT ak_occupation_name UNIQUE (name));

CREATE TABLE Worker(
occupation_code SMALLINT NOT NULL,
worker_id AUTOINCREMENT,
birth_date DATETIME NOT NULL,
address VARCHAR(255) NOT NULL,
registr_time DATETIME DEFAULT Now NOT NULL,
is_active YESNO DEFAULT TRUE NOT NULL,
given_name VARCHAR(255) NOT NULL,
surname VARCHAR(255) NOT NULL,
CONSTRAINT pk_worker PRIMARY KEY(worker_id)
);

The tables help to implement a system that can be analyzed with the following statements.
  •   Each worker has exactly one occupation. 
  •   Each occupation is carried by zero or more workers.
Note that the SQL standard does not describe the type CURRENCY. Instead, one can use the type Decimal.

Column is_active of the table worker must contain the truth values TRUE or FALSE  and in MS access YESNO  is the name of the type that contains these values.

If one changes the occupation code in a row of the table Occupation, then the system should extend this change to the table Worker (ON UPDATE CASCADE compensating action in the specification of the foreign key constraint.

Note that Table Occupation contains reference data. which is the data that defines the set of permissible values that other data fields can use. Meanwhile, Table Worker contains master data. Master data its self represents the business objects that are agreed on and shared across the enterprise. 

SQL Question:

  1. Find the average price of flats, the minimal price of flats, maximal price of flats, the number of flats, the sum of flat prices,  the price of which is registered, and the difference between the maximal and the minimal price. In the resulting table the corresponding columns must have names avg_price, minimal_price, maximal_price, sum_of_prices, number_of_flats_with_price, range_of_prices.
Solution:

SELECT Format(Avg(price),'\€#,##0.00') AS avg_price, 
Format(Min(price),'\€#,##0.00') AS minimal_price, 
Format(Max(price),'\€#,##0.00') AS maximal_price, 
Format(Sum(price),'\€#,##0.00') AS sum_of_prices, Count(price) AS number_of_flats_with_price, 
Format(Max(price)-Min(price),'\€#,##0.00') AS range_of_prices
FROM Flat;

Query Result:
Query Result
2. Find the number of hotels in Lagos. The resulting table must contain exactly one column with the name cnt
Solution:
SELECT Count(*) AS cnt

FROM Hotel WHERE city = 'Lagos';

3. Find the numbers of hotels where it is at least one reservation.Duplicate lines must be removed from the result.
Solution:
SELECT hotel_nr
FROM Reservation
GROUP BY hotel_nr;

OR

SELECT DISTINCT hotel_nr
FROM Reservation;

4. Find rooms that cost more than 400 naira for a night. Find data from all the columns of the table Room. In case of each found room, present also the name of the hotel where the room is situated
Solution:
SELECT Room.*, Hotel.hotel_name AS hotel
FROM Hotel, Room
WHERE Hotel.hotel_nr=Room.hotel_nr And Room.price>400;


5Find the number of courses and their average number of credit points, in case of courses that comments are missing, the name ends with y, and the number of credit points is not 1. The result must be a table with one row and two columns. The names of the columns must be cnt and average, respectively.

Solution:
SELECT Count(*) AS cnt, Avg(credit_points) AS average
FROM Course
WHERE Course.comments IS NULL
AND Course.course_name Like '%y'
AND credit_points <> 1;

6. Calculate the value of the following expressions:  331+ 5587  879/54  (879/54) – round the result so that there are only two numbers after comma  (233-24)*565  2^3
Solution:
SELECT 331+5587 AS expr1,
879/54 AS expr2,
Round((879/54),2) AS expr3,
(233-24)*565 AS expr4, 2^3 AS expr5;

7. Find all the data about reservations. For each reservation, find also the concatenated given name and surname of the associated guest (in the column guest_name) as well as the name of the hotel where the reservation is made. Sort the results based on the hotel name in descending alphabetical order. If there are more than one reservation in the same hotel, then sort these rows based on the guest number in the ascending order. Use in the query correlation names (aliases) G, R, and H to reffer to the tables Guest,
Reservation, and Hotel, respectively.
Solution:
SELECT R.*,
trim(G.given_name&' '& G.surname) AS guest_name,
H.hotel_name FROM Reservation AS R ,
Guest AS G,
Hotel AS H
WHERE ((R.guest_nr = G.guest_nr) And (R.hotel_nr = H.hotel_nr))
ORDER BY hotel_name DESC, G.guest_nr;

8.Find the number of reservations in case of each hotel. For each hotel, present the hotel number, hotel name, and the number of reservations. If there are no reservations in a hotel, then the number of reservations must be 0. The column containing data values that represent the number of reservations must have the name cnt. Sort the results based on the number of reservations in the descending order.

Solution:

SELECT Count(Reservation.hotel_nr) AS cnt, 
Hotel.hotel_nr, Hotel.hotel_name
FROM Hotel LEFT JOIN Reservation
ON Hotel.hotel_nr = Reservation.hotel_nr
GROUP BY Hotel.hotel_nr, Hotel.hotel_name
ORDER BY Count(Reservation.hotel_nr) DESC;

9. Find all the data of hotels (from all the columns of the table Hotel) that have no associated reservations.

Solution:

SELECT *
FROM Hotel
WHERE hotel_nr <>ALL (SELECT hotel_nr FROM Reservation WHERE hotel_nr IS NOT NULL);

10. Insert to the table Guest_backup all the data about the guests (from the table Guest) whose address contains the word "Lagos" or whose address is not registered. Please note that table Guest_backup must contain concatenated given name and surname of guests. In case of concatenating string remove from the result leading and trailing spaces by using Trim function.

Solution:

INSERT INTO Guest_backup(guest_nr, guest_name,address) SELECT guest_nr, trim(given_name &' '& surname) AS guest_name, address FROM Guest WHERE address LIKE '%Lagos%' OR address IS NULL;

11. Create a copy of the table Reservation by using a SELECT … INTO statement. The name of the copy table must be Reservation_backup

Solution:

SELECT * INTO Reservation_backup FROM Reservation;

12. Define the primary key constraint in the table Reservation_backup that involves columns hotel_nr, room_nr, guest_nr, and beginning_date (in the specified order). The name of the primary key constraint must be pk_reservation_backup.

Solution:

ALTER TABLE Reservation_backup ADD CONSTRAINT pk_reservation_backup PRIMARY KEY(hotel_nr, room_nr, guest_nr, beginning_date);

13. Delete from the table Reservation_backup data about all the reservations that have started more than 1500 days ago in the hotel "Sheraton".

 Solution:

DELETE *
FROM Reservation_backup
WHERE beginning_date >Date() - 1500 AND
hotel_nr IN (SELECT hotel_nr
FROM Hotel
WHERE hotel_name='Sheraton');

14. Delete from the table Reservation_backup data about all the end dates of reservations where such dates are registered. In case of all the modified rows register also a comment: "End date is removed at X", where X is the current timestamp. The comment must be appended to the existing comment. The current timestamp must be found by using a function.

Solution:

UPDATE Reservation_backup 
SET 
end_date = NULL, 
comment = trim(comment & ' End date is removed at ' & Now())
WHERE 
end_date IS NOT NULL;

15. Modify the data of a guest with number 6 so that new address is "Lagos, Ikeja 13-05". Do it only if the guest has no reservations that have started during the last 300 days.

Solution:

UPDATE Guest SET address = 'Lagos, Ikeja 13-05' 
WHERE guest_nr=6 AND NOT EXISTS
(SELECT * FROM Reservation 
WHERE Reservation.guest_nr = Guest.guest_nr AND Reservation.beginning_date>Date()-300);

16. Find the numbers of guests who have made more than two reservations:

Solution:

SELECT guest_nr
FROM Reservation
GROUP BY guest_nr
HAVING Count(*)>2;

17. Find all the data of all the guests who have made the biggest number of reservations. In addition to the data of guests, present also the number of their reservations. 

Solution:

SELECT Guest.guest_nr, Guest.given_name, Guest.surname, Guest.address, Count(Reservation.guest_nr) AS cnt
FROM Guest INNER JOIN Reservation ON Guest.guest_nr=Reservation.guest_nr
GROUP BY Guest.guest_nr, Guest.given_name, Guest.surname, Guest.address
HAVING Count(Reservation.guest_nr)>=ALL(SELECT Count(*) AS cnt FROM Reservation GROUP BY guest_nr);

18. Find all the learnings that started in 1999 and finally completed with a successful exam (the result is 4 or 5). It is possible that a successful exam was done only after more than one attempt. Present data from all the columns of the table "Learning". The result must contain exactly one row for each learning that satisfies the criteria. In addition, the result must contain the given name and the surname of the student, presented as one string and a space between the names. The result must also contain the surname of the lecturer and the name of the course. Order the result based on the surnames of students in alphabetical order. If there are more than one row with the same surname, then order these rows based on the names of courses in alphabetical order.

Solution:

SELECT Learning.learning, Learning.student, Student.given_name & ' ' & Student.surname AS student_name, Learning.course, Course.course_name, Learning.lecturer, Lecturer.surname AS lecturer_name, Learning.start_date, Learning.end_date
FROM Course INNER JOIN ( Lecturer INNER JOIN (Student INNER JOIN Learning ON Student.student_code=Learning.student) ON Lecturer.lecturer_code = Learning.lecturer) ON Course.course_code = Learning.course WHERE Year(start_date)=1999 AND EXISTS (SELECT * FROM Exam WHERE Exam.learning= Learning.learning AND result IN (4,5))
ORDER BY Student.surname, Course.course_name;

19. Register comment "Has to finish soon!" in case of students whose curricula code starts with the letters "MP" and who were admitted before the beginning of 1996. If there is already a comment in case of a student,  then the new comment should not replace it. Instead, the new comment must be placed in front of the existing comment.

Solution:

UPDATE Student SET comment = Trim( 'Has to finish soon! ' &  comment)
WHERE Year(admission_time)<1996 AND curricula LIKE 'MP%';












Recursion in C#

 Recursion 

Recursion is one of the most useful aspects of subroutines; that is the ability of the procedure or subroutine to call itself.


Download: Application to calculate your days on Earth 

This article will use a rather ancient puzzle known as the Tower of Hanoi originated from Hindu.
Tower of Hanoi
Diagram Tower of Hanoi 
The rules of this puzzle are:


  1. We are interested in moving the rings from A to B, perhaps using  C in the process. 
  2. Also by the rules of the game, rings are to be moved one at a time
  3.  At no point may the larger ring be placed on top a smaller one.
This puzzle can be solved following these 7 steps:
  • move A to  B;
  • move A  to C;
  • move B  to C;
  • move A to  B;
  • move C  to A;
  • move C  to B; 
  • move A  to B;

Algorithm


subroutine move N from A to B using C;
  1. if N is 1 then print "move A to B";
  2. else( If N is greater than 1) do the following:                 
            2.1 call move N - 1 from  A to C using B;
            2.2 call  move 1   from A to B using  C;
            2.3 call move N - 1 from  C to B using A;
    3. return


 Algorithm

 We have 3 rings on Peg A, therefore, our N = 3, which is greater than 1.
 After the function; below are the 3 Steps our code follows:
 P(3, A, C, B) means  call move 3 from A to B using C
 Step1: P(N - 1, Beg, End, Aux)  
 Step2: P(1,       Beg,  Aux, End)
 Step3: P(N - 1, Aux, Beg, End)


 Below also are the meaning of the variables selected:

 P = denotes procedure/subroutine
 N = numbers of ring
 Beg = Initial stage of moving the ring
 End = destination 
 Aux = auxiliary output through which we move rings

If N is greater than 1:
Step1  says: move top (N -1) rings from Beg to Aux peg.
Step2  says: move 1 ring from Beg to End peg.
Step3 says: move top (N-1) rings from Aux to End peg.

Let us see in code:
namespace TowerOfHanoi
{
class Program
{
static void Main(string[] args)
{
char beg_fromPeg = 'A';       // Begining of the tower in output where we move from
char dest_Peg = 'B';            //  end tower in output where we move to
char via_PegtoDest = 'C';   // auxilliary tower in output through which we move
int disks = 3;                    // number of disks to move around
solverHanoiTowers(disks, beg_fromPeg, via_PegtoDest, dest_toPeg);
}
private static void solverHanoiTowers(int n, char beg_fromPeg, char via_PegtoDest, char dest_toPeg)
{
if ( n == 1)
{

Console.WriteLine("move" + beg_fromPeg + "to" + dest_Peg);

}
else
{
solverHanoiTowers(n - 1, beg_fromPegdest_Pegvia_PegtoDest);
solverHanoiTowers(1, beg_fromPegvia_PegtoDest, dest_Peg);
solverHanoiTowers(n - 1, via_PegtoDest, beg_fromPegdest_Peg);

}

Console.Read();
}
}
}

OUTPUT
move A to B;
move A to C;
move B to C;
move A to B;
move C to A;
move C to B;
move A to B;

These processes below is the sequential flow that moves all the rings in peg A to B recursively.

P( 3 , A, B, C)                             
       /                                            1st Chain                    2nd Chain           3rd Chain
P(2, A, C, B) - Step 1,2,3.    P(2 , A, C, B)          P(1,A, B, C)= A to C    P(2, B, A, C)
 /                                            /                                                                     /
P(1, A, B,  C)  - Step 2.        P(1, A, B, C) = A to C                               P(1,B,C,A)= B to A
 /                                             /                                                                    /
P(2, B, A, C)  -  Step 1,2,3.   P(1, A, C, B)= A to B                              P(1,B,A,C)= B to C
                                              /                                                                    /
                                            P(1, C, A, B)= C to B                             P(1, A, B, C) = A to C

Here what happened is that we applied those 3 steps on P(3, A, B, C) and those are the chain we got out of it that gave us the accurate result in code.

Happy reading! 
Follow maxybyte on social media.

Read: Class and Object -Object-Oriented Programming


Database with Maintenance-Driven Approach

Building Database with MDA

A maintenance-driven approach is better than tools-driven approach; although with the tools-driven approach, it's easy to get the work done once you know how to make use of the tools also tools-driven approach is good for departmental application development. 


In a nutshell, many applications are more scope beyond that of a departmental level where you will anticipate changes often-Enterprise level. Here you will learn how to use a maintenance driven approach to creating a database that could anticipate changes. Using this approach involves the logical separation of concerns, where the presentation, domain, and the persistence layers need to work together to get the work done.

Step1: Create a project-LocalDbMDA
Then rename this project to LocalDbMDA.Presentation, This layer present the end result of the application to the end user.
LocalDbMDA.Presentation
LocalDbMDA.Presentation Diagram
Step2: Adding New Projects to the Main Project
Ideally, It is good to make the Persistence and the Presentation layers depend on the Domain
Now we need to add the 2 other layers the domain and the persistence layers by selecting from the menu for each new project.  File > Add > New Projects. Moreover, right within the new project Dialogue, choose Class Library, and be sure that the selection for the solution is changed to 'Add to Solution' and not 'Create New Solution'.
 Then named the new file LocalDbMDA.Persistence. Repeat this step to create LocalDBMDA.Domain, right after this press Cltr+Shift+B which is the shortcut key to build a solution.

Step3: Set Dependencies through Add References
Ideally, you do not want your project to depend on each other, which is the main principle of SOC. But some level of dependency is going to be needed. A project taking dependency from another one simply means a project makes reference to another one in code. Now the Reference logic that we will use for this lesson looks like this:
                      Reference                 Reference
Presentation -------------->Domain--------------> Persistence

layer, which will keep the dependency chain central to the Domain layer, like this:

                      Reference                      Reference
Presentation ---------------->Domain<--------------Persistence

Re-create the Entity Model in the Persistence Layer and also add Data Transfer Object that each layer will reference. This DTO allows data transfers access within the other 3 layers.


Note:
In order to facilitate the development of a system in a piecemeal fashion and simplify making changes in the system, its decomposition into subsystems must follow the advice of patterns of assigning responsibilities (General Responsibility Assignment Software Patterns, GRASP) like Low Coupling and High Cohesion.

Low Coupling means in this context that a subsystem should not depend too much on other subsystems. It helps us to achieve low dependency of subsystems, low change impact of subsystems, and increased reuse of the artifacts that are created during the development of subsystems.

High Cohesion means in this context that the responsibilities of a subsystem must be strongly related in order to reduce the complexity of subsystems. 

These rules are applicable to creating of a database. 

Database is a set of true propositions (facts) about the real world.
Propositions contain representation of values (data) and their interpretation.
Examples of propositions.
A car manufacturer has a numeric identifier 1 and a textual name "Toyota".

A car manufacturer has a textual name "Mitsubishi", numeric id = 2 and its description is "Rarity".


You can also check out an environment for executing SQL statements based on different SQL DBMSs and a set of SQL puzzles
You can also check these catalogs of data models, that contain logical design models of SQL databases. These help us to understand databases domains and hence are an important source of information for the creation of conceptual data models.



Migrate SQL database to Azure SQL database

How to Migrate SQL database to Azure 

Of course, it is very easy to build applications ruining on local computers and accessing stored database directly also on the local database should be very easy. One out of the reasons we build an application is to make it accessible worldwide, and we could get this possibility through the help of the internet.



The benefit of using Azure is because of its scalability, availability, tenancy, provisioning, and their payment model. I will give you the simple logic on how you can construct and transfer your database from your local computer and access it online instead.


SQL Server Management Studio(SSMS) will be useful for this tutorial, it is free, you can directly get it from Microsoft.

Follow the instructions and install it.
Then we will need to follow two steps for this migration:

  • Schema migration from the on-premises database to SQL Azure
  • Table data migration from the on-premises database to SQL Azure
Now to start migration; open SSMS  and connect to a Database engine for our local SQL express instance but also you can connect to a SQL Server on the server on your network, since we presently have the database built in our computer, then connect to the Local SQL express instance.
Database LocalDB
Database LocalDB Diagram
Step 1: Once you are connected, expand the "Databases" to see what you have there
Right inside after expansion, choose the database you want to move, in my case I will use my database named OKIDOKI_7b18cd1fa3f4, then I expand the Tables and have this diagram below that you can follow:
We need to create a new SQL Azure database that we can use for the migration. We can create a new SQL Azure database via the window Azure platform management in Azure portal but we are already in Management studio, let's do it there.
In that case, we just need to open a new connection to our exciting Azure database server, If you haven't signed up you can do that in Azure portal


Once that is done you can access it from SSMS by connecting to the sever name you used during the time you created the sever in the Azure portal mine looks migratingsql.database.windows.net and in Authentication space in SSMS  select SQL sever Authentication.

Maxybyte SQL Server
 SQL Server Diagram

Enter your connection information and click the connect button. Then once you log in right-click Databases and choose new database OR click on Databases to highlight it and click on new query , right inside the new query we can create and name our database to be in the cloud.
Copy and paste this code to create the database named MYCloudOki:

CREATE DATABASE MyCloudOki
GO

And click the Execute button in SSMS.
If you follow tutorial correctly then you should have a new Azure database name MyCloudOki that we will use for our destination.
As I mentioned there are 2 steps to the migration we start with migrating our database schema and we will migrate our data.

To migrate our schema from on-premises to Azure database destination, we will right_click on the

Maxybyte Generate scripts
Generate scripts Diagram
database we want to move the schema , => Tasks => Generate Scripts..
Then follow the instructions. 
When you get to the Advance button make sure you click there that you are targeting SQL Azure engine, therefore scroll down and find the script for the database engine type and in the drop down select SQL AZURE DATABASE. 


Give the script a name and save it to a file and click next to generate the script file. Now that we have our script generated we can deploy the script to our destination SQL Azure database.

Now let's right-click on our SQL Azure database(MYCloudOki) in SSMS and select new query then open our generated saved script file and let execute the script against this query. once this is done then we should have the same schema from on-premises in MYCloudOki.




Step 2: Migrate data
Now we need to move the Data, there are numbers of options available to move the data, such as:
-SQL server integration services, -BCP , - sqlBulkCopy. 


In this case, we will use the SSIS package to move the data. We are going to use SSMS To run the wizard and create an SSIS package.

Now let's right-click on our source database OKIDOKI_7b18cd1fa3f4 go to Tasks and select Export data , then from the wizard specified the source database and the destination database which is in SQL Azure therefore choose.Net framework data provider for SQL server, then scroll down a little and enter the credentials for our destination database and click next and run it immediately. Once the migration is done you can run a query to make sure the data is there. 

Happy coding...


Your feedback will help others...

Create slide advertisement with XML that have URL navigator

How to create default pictures slide advertisement

Have you come across a web site where there are images moving on a slide? that might probably be ruining an advertisement for the web page. This article will show how to implement such in a simple way.

I will show simple 2 steps to get this done:


Download: Calculator


Step 1: Create .Xml file name it whatever you want, e.g slider.xml
Copy and paste the below code inside your created slider.xml file:


<?xml version="1.0" encoding="utf-8" ?>

<advertisements>
<ad>
<imageurl>~/Images/slides/teach.jpg</imageurl>
<navigateurl>https://www.maxybyte.com</navigateurl>
<alternatetext color="Blue">We will teach you how to code</alternatetext>
<impressions>50</impressions>
<keyword>Tech</keyword>
</ad>
<ad>
<imageurl>~/Images/slides/goCsharper.jpg</imageurl>
<navigateurl>https://www.maxybyte.com</navigateurl>
<alternatetext>Go Csharper with maxybyte</alternatetext>
<impressions>50</impressions>
<keyword>Tech</keyword>


</ad>

<ad>
<imageurl>~/Images/slides/serve.jpg</imageurl>
<navigateurl>https://www.maxybyte.com</navigateurl>
<alternatetext>We are here to serve you better</alternatetext>
<impressions>50</impressions>
<keyword>Tech</keyword>


</ad>

</advertisements>

Step 2: Display advertisement in the Default.aspx page

Now go to the default page in your web application or create one, then copy and paste the code below right inside the Default.aspx page:

<asp:ScriptManagerProxy ID="ScriptManagerProxy1" runat="server"></asp:ScriptManagerProxy>

     <asp:UpdatePanel ID="UpdatePanel1" runat="server">
    <ContentTemplate>
      <asp:AdRotator ID="AdRotator1" runat="server" AdvertisementFile="~/slider.xml"
            ImageUrlField="ImageUrl" NavigateUrlField="NavigateUrl"
            AlternateTextField="AlternateText" Style='position:relative' Width="1200px" Height="400px" border="1" alt="Null" CssClass="img" >
      </asp:AdRotator>
        <asp:Timer ID="Timer1" runat="server" Interval="2500"></asp:Timer>
     </ContentTemplate>
    </asp:UpdatePanel>





Note: You need to create your images folder to be able to access those images in code as I have done in "step 1" using the<imageurl>image_path</imageurl>.


Happy coding! and thanks for reading!

Please follow Maxybyte on social media.