0

Export / Import Tables from one Database to other

Today, I discovered how to export/import a database from one server to another, following are the steps I followed.
Hope this may of help to someone. Please leave your comments and suggestion if any.


1. Connect to a Database engine, where your source database is present.
2. Open Databases
3. Right click on the database. Select Task > Export Data.
An Inport Export wizard should be started, click next
5. Punch in username and password for the server.
6. Select the database from the Database drop down list. ( Select that database whose table you need to copy)
7. Click next
8. Now select your destination server and database, provide username and password.
9. Select the first option. ( No idea what the second option does :P )
10. Select the table you want to copy. You can select all if you want.
11. Click next will show you a window with "Execute Immediately" check box, Click next and finish.
12. All the selected tables will be copied to the destination database along with the data in it.


Cheers!





1

Create a timestamp in c# (using Datetime)


Hi wondering how to create a timestamp in c# using Datetime values, use the method below. 
public static String GetTimestamp(this DateTime value)
{
    return value.ToString("yyyyMMddHHmmssffff");
}

0

FULL FORMS OF BANKS IN INDIA


ICICI- INDUSTRIAL CREDIT AND INVESTMENT CORPORATION OF INDIA 


SBI - STATE BANK OF INDIA 


IDBI - INDUSTRIAL DEVELOPMENT BAN K OF INDIA 


NABARD- NATIONAL BANK FOR AGRICULTURE AND RURAL DEVELOPMENT 


HDFC - HOUSING DEVELOPMENT FINANCE CORPORATION 


HSBC - HONGKONG AND SHANGHAI BANK CORPORATION 


IFCI - INDUSTRIAL FINANCE CORPORATION OF INDIA 


ICFAI - INSTITUTE OF CHARTERED FINANCIAL ANALYSTS OF INDIA 


PNB- PUNJAB NATIONAL BANK
4

The timeout period elapsed prior to completion of the operation or the server is not responding.

"The timeout period elapsed prior to completion of the operation or the server is not responding."


Reason:
Whenever you try to retrieve huge amount of data from a database, the query execution time increases, if you have a low connection timeout value set, this error is shown.


Solution:
Set ConnectionTimeout property of the SqlConnection Class to a higher value.


Refer:
http://msdn.microsoft.com/en-us/library/system.data.sqlclient.sqlconnection.connectiontimeout.aspx
0

GIF images for google+


Click on the image if it does not load.
___________________________________________________________________________
___________________________________________________________________________
___________________________________________________________________________
0

Clear an Array in c#


string[] arr = new string[4];
arr[0] = "000";
arr[1] = "111";
arr[2] = "222";
arr[3] = "333";
 
Array.Clear(arr, 0, arr.Length);

0

How to use Stopwatch in C#


Create an object of Stopwatch class and start it, then execute the method, logic whose execution time is to be calculated. Next stop the watch shown below.

Stopwatch watch = new Stopwatch();
watch.Start();           

for (int i = 0; i < 100000; i++)
{
   for (int j = 0; j < 20000; j++)
   { 
                    // To waste some time....:P
   }
}
watch.Stop();
double time_wasted = watch.Elapsed.TotalSeconds;
// To round 
double time_wasted_rounded = Math.Round(watch.Elapsed.TotalSeconds);
0

How to limit decimal places in double


Here I am limiting the decimal places to 3 in a double.
 
 double old_value = 3.142356;
 double new_value = Math.Round(old_value, 3);
:)
0

How to block a website

1.       Open Run, and type in ‘C:\Windows\System32\drivers\etc’, press enter. A folder should open up with the following contents.

2.       From the above files, open the “hosts” file using a notepad. The following is how the contents of this file should appear.

Now we will have to edit this “hosts” file, so as to block certain sites, which in this scenario are
 1. Yahoo.com and
 2. Bing.com.
The following changes are required for the same…


3.       Now try opening these websites using any of the browsers. The site will not open instead an error message will be shown. You can block any number of websites using this method.



Cheers!
6

Create Horizontal Menu Bar using HTML and CSS


Following is a simple demonstration of how to get a horizontal menu bar using HTML (using <ul> / <li>) and CSS.

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
 <head>
  <title>Sample by Yasser.</title>
  <style type="text/css">
.hovermenu ul{
fontbold 18px calibri;
height25px;
}

.hovermenu ul li{
list-stylenone;
displayinline;
}

.hovermenu ul li a{
padding10px 25px 10px 25px;
text-decorationnone;
floatleft;
colorwhite;
background-colorrgb(15,41,77);
border1px solid rgb(15,41,77);
}

.hovermenu ul li a:hover{
background-color#e5e5e5;
color:rgb(15,41,77);
}
</style>
 </head>

 <body>

<div class="hovermenu">
<ul>
<li><a href="">Menu1</a></li>
<li><a href="">Menu2</a></li>
<li><a href="">Menu3</a></li>
<li><a href="">Menu4</a></li>
<li><a href="">Menu5</a></li>
</ul>
</div>

</body>
</html>

Expected Output:

 Cheers!
 

2011 ·Code-Studio by yrus.