Wednesday, August 20, 2025

How to add dummy data to datatable with multiple columns

 DataTable dt = new DataTable("DummyData");

        dt.Columns.Add("Id", typeof(int));

        dt.Columns.Add("Name", typeof(string));

        dt.Columns.Add("City", typeof(string));



        DataTable dt1 = new DataTable("DummyData");

        dt1.Columns.AddRange(new DataColumn[] {

        new DataColumn("Id", typeof(int)),

        new DataColumn("Name", typeof(string)),

        new DataColumn("City", typeof(string))

    });


        dt.Rows.Add(1, "John Doe", "New York");

        dt.Rows.Add(2, "Jane Smith", "London");

        dt.Rows.Add(3, "Peter Jones", "Paris");

//or

 //  DataRow newRow = dt.NewRow();

    newRow["Id"] = 4;

   // newRow["Name"] = "Alice Brown";

    //newRow["City"] = "Tokyo";

    //dt.Rows.Add(newRow);

        GridView1.DataSource = dt;

        GridView1.DataBind();

How to add dummy data to datatable or gridview with array of string

   string[] myString1 = { "sum", "minus"};



        

        DataTable dt = new DataTable();

        dt.Columns.Add("Name", typeof(string));


        foreach (string item in myString1)

        {

            System.Data.DataRow row = dt.NewRow();

            row["Name"] = item; // Assign the string to the column

            dt.Rows.Add(row); // Add the row to the DataTable

        }


        

        GridView1.DataSource = dt;

        GridView1.DataBind();

How to use same mouse for computer and mobile

 >To use this, you have to first connect these devices by bluetooth

> Second you have to install GlideX, Phone mirror , Remote mouse, PC remote to your both devices

How to use two displays or two monitors with one mouse

>Right click on desktop

 >Go to display settings

> and there is option of "Duplicate these videos", "Extend these videos" and click on Extend these videos , it will work for both monitors.


and use "microsoft without borders" for two different computers and having same mouse.