Showing posts with label Learn/techniques. Show all posts
Showing posts with label Learn/techniques. Show all posts

Sunday, July 25, 2010

Top Ten Seo Techniques

Seo is very important thing for the promotion of any site/blog.I am giving you ten tips to get high rank in the search engines
  1. Title Tag : It is very important to make a title that has some keywords and the tile must tell what the site has.
  2. Description meta tag : Major search engines(google,yahoo,msn) check the description meta tag and rank the site on its quality.So,put up a very attractive and very much relative to the content of the site description tag.
  3. Keyword meta tag : In my opinion keyword is the most dominating meta tag so give very well keywords.Do put too less keywords and also donot put repetative keywords.
  4. Author meta tag : It is good to put up a author meta tag to show your personal or compnay name for the promotion.
  5. Robots meta tag : Always give a robots meta tag and put its value as index,follow.
  6. Also put up a revisit after meta tag to tell the search engine that after how many days it must revisit the site.Put its value according to your updation routine.
  7. Make backlinks i.e some other sites must have links to your sites.It is very good if different sites have different links to your site.Means give the internal links to other sites.
  8. Quality content : Always put up the quality content to get higher rank.
  9. Your own content : Copy paste make a downfall for your site/blog.So, always put your own content.
  10. Directories Submission : Enlist your site's links in alot of  directories.
Hope you have learned something.Plz comment for the feedback

Saturday, June 20, 2009

C# DataGrid with DataSet

This is a simple C# Program that illustrate the usage of DataGrid with DataSet.

Create Database and Table accordingly.


/*
* Simple C# example to illustrate the usage of Dataset with DataGrid
* Need to change the url and query accordingly
*/

using System;
using System.Data;
using System.Data.SqlClient;
using System.Drawing;
using System.Windows.Forms;

public class DataGridSample:Form{
DataGrid myGrid;

SqlConnection con;
SqlDataAdapter adapter;
DataSet ds;
Button ok, cancel;

SqlParameter workParam = null;

// apply to the columns in the table
string query = "select CardNo,CardType,CardAmount, CardHolderName from CardTest";

// change the Server ,uid, pwd and database accordingly
string url = "server=TR4;uid=sa;pwd= ;database=RBSGTest";



static void Main(){
Application.Run(new DataGridSample());
}

public DataGridSample(){
InitializeComponent();
}

public void InitializeComponent(){
this.ClientSize = new System.Drawing.Size(550, 450);
myGrid = new DataGrid();
myGrid.Location = new Point (10,10);
myGrid.Size = new Size(500, 350);
this.Text = "C# DataGrid with DataSet - Example";
this.Controls.Add(myGrid);

ok = new Button();
ok.Location = new Point(10, 375);
ok.Size = new Size(70, 30);
ok.TabIndex = 1;
ok.Text = "OK";
this.Controls.Add(ok);
ok.Click += new System.EventHandler(button_Click);

cancel = new Button();
cancel.Location = new Point(95, 375);
cancel.Size = new Size(70, 30);
cancel.TabIndex = 1;
cancel.Text = "Cancel";
this.Controls.Add(cancel);
cancel.Click += new System.EventHandler(button_Click);

ConnectToData(); // establish database connection and create DataSet
myGrid.SetDataBinding(ds, "CardTest");
DataTable t = ds.Tables["CardTest"];
t.RowChanged += new DataRowChangeEventHandler(Row_Changed);

}

public void ConnectToData(){
ds = new DataSet();
con = new SqlConnection(url);
adapter = new SqlDataAdapter();
adapter.SelectCommand = new SqlCommand(query, con);
adapter.Fill(ds, "CardTest");
insertCommand();
updateCommand();
}

public void updateCommand()
{
string query = "Update CardTest Set CardHolderName = @CardHolderName, CardType = @CardType, CardAmount = @CardAmount WHERE CardNo = @CardNo";

adapter.UpdateCommand = new SqlCommand(query, con);

workParam = adapter.UpdateCommand.Parameters.Add("@CardNo", SqlDbType.NChar);
workParam.SourceColumn = "CardNo";
workParam.SourceVersion = DataRowVersion.Original;

workParam = adapter.UpdateCommand.Parameters.Add("@CardType", SqlDbType.NChar, 50);
workParam.SourceVersion = DataRowVersion.Current;
workParam.SourceColumn = "CardType";

workParam = adapter.UpdateCommand.Parameters.Add("@CardAmount", SqlDbType.Int);
workParam.SourceColumn = "CardAmount";
workParam.SourceVersion = DataRowVersion.Current;

workParam = adapter.UpdateCommand.Parameters.Add("@CardHolderName", SqlDbType.NChar, 50);
workParam.SourceColumn = "CardHolderName";
workParam.SourceVersion = DataRowVersion.Current;
}


public void button_Click(object sender, EventArgs evArgs)
{
if (sender==ok){
UpdateValue(); // update the database once everything done.
}
if (sender==cancel) {
this.Dispose();
}
}


private void Row_Changed(object ob, DataRowChangeEventArgs e)
{
DataTable t = (DataTable) ob;
Console.WriteLine("RowChanged " + e.Action.ToString() + "\t" + e.Row.ItemArray[0]);
}

public void insertCommand()
{
string insertQuery = "Insert into CardTest VALUES (@CardNo, @CardType, @CardAmount, @CardHolderName)";
adapter.InsertCommand = new SqlCommand(insertQuery, con);

workParam = adapter.InsertCommand.Parameters.Add("@CardNo", SqlDbType.NChar);
workParam.SourceColumn = "CardNo";
workParam.SourceVersion = DataRowVersion.Current;

workParam = adapter.InsertCommand.Parameters.Add("@CardType", SqlDbType.NChar, 50);
workParam.SourceVersion = DataRowVersion.Current;
workParam.SourceColumn = "CardType";

workParam = adapter.InsertCommand.Parameters.Add("@CardAmount", SqlDbType.Int);
workParam.SourceColumn = "CardAmount";
workParam.SourceVersion = DataRowVersion.Current;

workParam = adapter.InsertCommand.Parameters.Add("@CardHolderName", SqlDbType.NChar, 50);
workParam.SourceVersion = DataRowVersion.Current;
workParam.SourceColumn = "CardHolderName";
}


public void UpdateValue()
{
try
{
adapter.Update(ds, "CardTest");
Console.Write("Updating DataSet succeeded!");
}
catch(Exception e)
{
Console.Write(e.ToString());
}
}

}

To rename recycle bin

To change the name of recycle bin or rename recycle bin in Windows XP, Windows 2000, Windows NT, Windows Me, Windows 98 or Windows 95, just edit a registry value:

Open registry editor by going to Start -> Run, and execute regedit.
Navigate to the following registry branch:
HKEY_CLASSES_ROOT\CLSID\{645FF040-5081-101B-9F08-00AA002F954E}\

On the right pane, locate the registry key of LocalizedString.
Double click on LocalizedString or right click on LocalizedString and select Modify to modify the registry value.
You should see the default value of “@%SystemRoot%\system32\SHELL32.dll,-8964″. Delete or remove the default value and key in your desired new recycle bin’s name in text, e.g. “Garbage Bin” (without quote).
Refresh your desktop or Windows Explorer by pressing F5. You will see the new ‘recycle bin’ name.
Optionally, you can also modify the text of InfoTip, commonly known as tooltip what display certain help tip, guide or description about Recycle Bin when the mouse is hovering on Recycle Bin icon on desktop. The default text is “Contains files and folders that you have deleted.” Simply double click on InfoTip, or right click on InfoTip and select Modify to change the text of the info tip.
The default value is “@%SystemRoot%\system32\SHELL32.dll,-22915″, simply change it to another description that you want the tooltip to be.
Refresh the desktop to make it effective.

 
Technology-Computer-Robotics | New IT World