Wednesday, October 30, 2013

Oracle Error ORA-12560 solution

In oracle you might get an error while connecting

ORA-12561 : TNS: Protocol adapter error


This error usually come when the required oracle service is not installed or started

To fix this error just follow the following steps

1. Go to services by typing services.msc
(You must be a Administrator to perform this)

Now find service name "OracleServiceORCL"

2. Right click on this service and click on Properties

3. Now set startup type to Automatic

4. Below the service status label just click on Start Button

You are done now you can connect to SQLPLUS easily.

If you have any queries than please do comment

Thursday, October 24, 2013

How To Change Default Port Of Web Site in IIS

Hello folks,
                  In this tutorial I will show you how can you change the default port for your website i.e. port 80 to something else in IIS.

1. Open IIS by typing inetmgr in run command OR you can go to Administrative tools and Double click on IIS Manager

2. From Left panel expand Web Site folder

3. Right Click on your Web Site and Click on properties


4. In TCP port field type any port number that is not currently being used by any other application

5. Click on OK

That's it you have Successfully changed your web site port.

If you have any firther queries than please do comment.

Thanks

Friday, October 18, 2013

REPAIR WINDOWS 7 FROM USB DRIVE STEP BY STEP

Hello,
        You might got stuck in a situation where your windows 7 got corrupted and there is either no cd or cd rom to run recovery or reinstall windows.

Well in this tutorial I will show you how you can repair you windows 7 by using a USB drive

Before you continue, Make sure you fullfill the following requirements.

1. A USB 
2. System should support booting from USB
3. Windows 7 Repair Disk Download from HERE

 Ok So lets start

1.  Open up command prompt
(run it as an Administrator)

n    Now type the following commands

2. diskpart

3. listdisk

This will list down all the Drives connected to your system, Now you have to carefully select the USB drive which you want to use for windows recovery.
In My case the USB Drive is Disk 1, this could be different for you so choose carefully

4. Now type select disk 1

5. Clean

6. create primary partition

7. select partition 1 << again this is the partition number which you choose above

8. active

9. format fs=NTFS

Now Windows will start formatting your USB Drive, this might take some time depending on your drive size

10. Now type assign

11. type Exit



You have successfully format your USB drive, now it’s time to put the recovery files in this Drive
To do this

12.  Extract the Windows 7 Repair Disk files (which you downloaded above) in your USB Drive And you are done

If you have any queries than please do comment

Thanks

Wednesday, October 16, 2013

The type or namespace name 'OracleConnection' Could not be found C#

Hello,

In C# you you might have receive a type or namespace missing error like the one below
The type or namespace name 'OracleConnection' could not be found (are you missing a using directive or an assembly reference?)

The type or namespace name 'OracleCommand' could not be found (are you missing a using directive or an assembly reference?)

The type or namespace name 'OracleDataReader' could not be found (are you missing a using directive or an assembly reference?)     


This means that c# was unable to find the reference to for the following classes

               OracleConnection conn
               OracleCommand cmd
               OracleDataReader
All these classes are required to connect Oracle with c#

So in order to fix this error we will need to add dll(references) files for these classes.

Download dll from HERE
File is password protected, password is taqi

1. Download the dlls from link provided above

2. Now in C# right click on your project, and than click on Add reference

3. Click on Browse Tab

4. Now add the 3 files which you downloaded above

5. Click ok

Now Your code will compile without the namespace error

I hope it was informative for you and I would like to Thank you for reading.

Thanks

Saturday, October 12, 2013

Get GridView Column Value of Control C#

In order to find value of certain column of gridview, we need to find weather they are control or simple text

If they are control like Label, Hyperlink etc than we must use the findControl method to get the value

The following code will show you how to get value of a HyperLink type Column



   1:  foreach (GridViewRow gvRow in gv1.Rows)
   2:              {
   3:                  CheckBox chkItem = (CheckBox)gvRow.Cells[0].FindControl("GvCheckBox");
   4:                  if (chkItem.Checked)
   5:                  {
   6:                        HyperLink abc = (HyperLink)gv1.Rows[1].Cells[2].FindControl("hlFileName");
   7:                  }
   8:   
   9:                  else
  10:                  {
  11:                      //this code will execute if the CheckBox is Not Checked
  12:                  }
  13:              }
asdasdasd

Inside the (chkItem.Checked)

We first declare a variable abc of type HyperLink

Than using (HyperLink) we type cast the result which we will get

The Name of my GridView is gv1

To Change Rows just change the index or we can use variable as well

the FindControl() method which accepts 1 parameter we provide the Column Header and thus we are able to get the value of that column

I hope it was informative for you, And I would like to Thank you for reading.

Saturday, October 5, 2013

Find which CheckBox is Checked inside GridView C#

Below is a simple code that will help you finding all the CheckBox inside Grid View weather they are checked or Not Checked.

   1:  foreach (GridViewRow gvRow in gv1.Rows)
   2:              {
   3:                  CheckBox chkItem = (CheckBox)gvRow.Cells[0].FindControl("GvCheckBox");
   4:                  if (chkItem.Checked)
   5:                  {
   6:                     //this code will execute if the CheckBox is Checked
   7:                  }
   8:                  
   9:                  else
  10:                  {
  11:                      //this code will execute if the CheckBox is Not Checked
  12:                  }
  13:              }

We Define a variable called gvRow of type GridViewRow this will be use to hold information about each row

Now Because it is Control and it's type is CheckBox so we will need to typecast the result in CheckBox

I hope it was informative for you, and I would like to Thank You for reading