Turn your TV into a computer using Raspberry pi

Merry Christmas to all . Here is my Christmas idea : Turn TV into a computer.

With HDMI port TV / monitor with HDMI / VGA port you can build a computer for kids or just for you with one of the following options

  • Pi 400
  • Manually setup Pi board

Pi 400

Pi 400 is a integrated key board with USB Ports, HDMI port and other necessary IO options. It cost around 7500 Rs / 101.85 $ . The keyboard itself contain a Raspberry computer board with inbuilt RAM and processor, capable of running powerful Pi OS.

Manually configure Pi

If you already had a good monitor, keyboard and mouse , you can assemble the Raspberry Pi board ( if you are familiar with computer hardware and Linux). Following is required for you

  • Micro SD card for OS
  • Power supply ( Mobile charger may fit for this purpose)
  • HDMI Cable / VGA to HDMI Converter
  • Monitor / TV
  • Mouse and Keyboard
  • Raspberry Pi 3 or later
  • Cup of coffee / Christmas Cake

Please go through the steps carefully to setup the OS.

Raspberry Pi imager

Use Raspberry Pi imager to create SD Card image for Installation other options not recommended for first time users.

Connect keyboard,mouse,HDMI and Insert the SD card on the port below the board correctly and power on the Pi.

Then the Red light will power on and Green light blink ( means SD card is OK), go through the installation.

Finish the setup and you just setup the Pi computer.

Reading and Writing Json objects in C#

JSON objects are fast to read. From Python to C# JSON objects are widely used for the database as well as data transaction purposes, some of them are simple, some others are complicated.

So let begins with a simple C# Projects



  1. Build a class for constructing JSON string
  2. Write to JSON text file
  3. Read from the file back to JSON class

How to Property binding in C#

I love the data binding features rather than anything else in my visual studio. I am going to demonstrate binding feature in c#.

We have an MDI form called ‘Master’ and a Label on it and another child form in My C# Project. The child simply shows ‘company’ with ‘codes’.

Task: Want to display Company name on Master when the user double-click the company.

How to, do this, we can achieve this with global variables, maybe, but need to refresh the label every time. But the binding feature offers the better solution for this.

  1. We need to create the property to access label control  Text in master as follows
private string foo="My Company";
 public string Company

 get { return foo; }

Now place the label data binding code just below the Initialize section of the ‘Master’.

lbl_company.DataBindings.Add("Text", this, "Company");

The code will work every time when the label Text changes. Actually, we need to change the value of the label when company property altered, which require a two-way binding. This is possible with the INotifyPropertyChanged interface.

Property Binding with Control -c#
How to data bind controls in C#

Our Master class need to be modified as follows Continue reading How to Property binding in C#

How to Split strings using separator symbols in C#

We had some interesting string as follows which need to split and take the desired portion. C#.Net provides special string function called Split, which helps you broke complex strings into fragments.

Here are our Stings look like

121 | Whole Sale Rate

131 | Retail Rate

We begin with initialization of string and then build separator array, then call the split method. I guess you are familiar with the string array if you don’t just look at the 3rd line.

string  st=”121 | Whole Sale Rate”;

Here  “|” is the separator

string[] separator= { “|” };

string []selRateStr = null;

Let’s split the string with Split, which is the function available with string object also with ToString() too.

selRateStr =st.Split(separator,StringSplitOptions.None);

the first element in the selRateStr will be 121, which can be accessed as selRateStr [0];

Here is the authentic link from MSDN which may help you to learn Split function in detail.



Change DataGridView column style at runtime in C#

How to change DataGridview column style at runtime in Visual Studio C#.Net?

Simply get the column from the Gridview with the help of subclass of GridView. The code will look like

DataGridViewComboBoxColumn products = new DataGridViewComboBoxColumn();
products = (DataGridViewComboBoxColumn)dataGridView1.Columns[ITEM.Index];
products.DisplayStyle = DataGridViewComboBoxDisplayStyle.ComboBox;
products.FlatStyle = FlatStyle.Flat;

All changes made to the object products will change the dataGridView1.Columns[ITEM.Index] since the object point to the dataGridveiw column ITEM.

* It resembles pointers in C, where a value changes in a pointer also reflect the variable.

Ado.Net connection,adapter,dataset and dataview explained

I wrote this post for those who have no idea about C# database connection.

When starting with Visual Studio language like C#/VB.Net, you need to understand the concept of adapter, dataset and data view.

SQL connection

SQL connection class helps you to build the connection string.Visual studio can build connection string for you or  can create your in App config [Solution Explorer]

<add name=”MACCon” connectionString=”Data Source=(LocalDB)\MSSQLlocalDB;AttachDbFilename=e:\Developerm\c# Projects\MAcc_Prime\MAcc\MACCDATA.mdf;Integrated Security=True” />

Use SQL connection object to configure the connection as follows

con.ConnectionString = System.Configuration.ConfigurationManager.ConnectionStrings[“MACCon”].ConnectionString;

Now you’re ready to use database

Data Adapter

The data adapter is the bridge between database tables with the application. The Adapter class helps you to the configugure table. The Adapter connects to the database throw the connection object.

geTradp = new SqlDataAdapter(“select dr,cr from accounttransactions where entry=” + mcode + ” and acid=” + acid + ” and tdate>='” + sdate + “‘ and tdate<='” + edate + “‘”, Common.con);

Here “conn” is the SQL database connection object

Dataset and Data Views

DataSet is the local version of your database table, you can work with the dataset and its data even if the connection has closed. Data Set accompanying with command builder also simplifies operation like adding new data, updating /deleting data etc

Dataset can also be used as data source for controls like data grid view.

Data View is a special object which offers table view so that you can fetch columns, rows, filter, extract rows with Find, FindRow methods loops through recordsets with the help subclasses of data view like Data RowView.

Let’s begin with .Net programming




Add column names to listview using dataSet in C#

When we need to populate various reports, usually we also need to supply customized column names too. We can easily grab column name from the database using objects like DataSet in C#

In our example, we use SQL database objects as follows.

AccountReportAdapter = new SqlDataAdapter(sql, con);
AccountReportDS = new DataSet();

Get started with a foreach statement and store the names into a List collection object.

List<string> hds = new List<string>();

foreach (DataColumn c in Common.AccountReportDS.Tables[0].Columns)

The hds list simply store the column name, just like an array does. Later we can use the list for supplying heads for ListView  as follows

public void ReportHeader(List<string> ar)
ColumnHeader headers = new ColumnHeader();
listView1.View = View.Details;
headers.Text = ” “;
headers.Width = 0;
foreach (var htext in ar)
headers = new ColumnHeader
Text = htext.ToString(),
Width = htext.ToString().Length * 20

if (hds != null) ReportHeader(hds);


Accessing controls in a panel -C#

Accessing controls using collection is pretty simple in C#. It comes handy when you want to perform group tasks.

I have a panel which contains many text boxes and Labels. Some of the controls used to format the result. Others name start with txt_ and lbl_. Our task is to clear the Text property with “”/null.


We can iterate through panel controls as follows

foreach(Control c in panel_rateSettings.Controls )
if ( c.Name.Contains(“txt_”) || c.Name.Contains(“lbl_”))

Maybe you can find another use of the control collection.

Remove OEM Recovery Drive letter in Windows 10

Branded PC like HP/Lenovo used to set recovery partition[Windows 10/7], probably with drive letter D/E/F etc. Sometimes there are applications which always work with specific drives. In such cases when you try to change OEM partition, the effort may fail.

 OEM partition is designed for system recovery or factory restore. It allows users to easily and quickly restore the system to the original state when system failure or system crash occurs

I personally suggest removing the drive letter from the OEM part, this becomes another troublesome job indeed. With DiskPart command you can remove drive letter of volumes.


Enter cmd command(Window + R) and Run button

Type diskpart on your command prompt

Type List Volume

Choose the OEM voliume with select Volume [volume#]

Execute Remove letter [Drive Letter]

If you are too lucky the OEM drive will disappear from My computer/My Pc. and the drive letter is available for use.