Wednesday, August 20, 2025

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.

Friday, August 15, 2025

How to open binary file from database on browser- only display

 byte[] bytes =   file.FileData;

Response.Clear();

    Response.ContentType = file.ContentType;

Response.BinaryWrite(bytes);


https://www.aspsnippets.com/questions/206135/Open-Show-Base64-PDF-data-in-new-window-Tab-using-C-and-VBNet-in-ASPNet/

How to open new window with width and height - using window.open

  <a href="#" onclick="MyWindow=window.open('https://www.aspsnippets.com/Articles/660/Display-image-from-database-in-Image-control-without-using-Generic-Handler-in-ASPNet/','MyWindow','width=600,height=300'); ">click to open new window</a>