January 30, 2011

LINQ on DataTable

How to works with Linq on DataTable
How LINQ works with DataTable
Why we can not query against the DataTable's Rows collection?
I can not find AsEnumerable() in my DataTable

Sample
DataTable Student = new DataTable("Student"); 
Student.Columns.Add("Name", typeof(String)); 
Student.Columns.Add("Date", typeof(DateTime)); 
Student.Columns.Add("NO", typeof(Int32)); 
Student.Rows.Add(new object[] {"A1",Convert.ToDateTime("2010/01/01"),0}); 
Student.Rows.Add(new object[] {"A2",Convert.ToDateTime("2011/01/01"),0}); 
Student.Rows.Add(new object[] {"A3",Convert.ToDateTime("2009/01/01"),1}); 
Student.Rows.Add(new object[] {"A4",Convert.ToDateTime("2012/01/01"),1}); 
Student.Rows.Add(new object[] {"A5",Convert.ToDateTime("2011/01/01"),1}); 
Student.Rows.Add(new object[] {"A6",Convert.ToDateTime("2011/01/01"),2}); 
Student.Rows.Add(new object[] {"A7",Convert.ToDateTime("2011/01/01"),2}); 

// Linq Query 
var query = from rows 
            in Student.AsEnumerable() 
            where rows["NO"].Equals(1) 
            orderby rows["Date"] descending 
            select rows; 

// A 
DataTable result = query.CopyToDataTable(); 
MessageBox.Show(result.Rows[0][0].ToString()); 

// B 
MessageBox.Show(query.AsDataView()[0][0].ToString());



PS: If you want to use of LINQ to DataSet as ORM you can used of ToQueryable() instead of AsEnumerable().
PS: If you want to use of EF (ADO.NET Entity Framework) as ORM you can directrly use of your Table instead of ToQueryable() or AsEnumerable()

January 28, 2011

Great Trick for increase website traffic

Questions
How to increase traffic on my blogger posts?
Increase traffic with change of title.
Choose the best title for your posts.
How to increase weblog traffics with simple and useful solution?

Solution
It's a great, simple and more useful and unique solution for SEO and I’ll guaranty the result it.
1- Go to Google Analytics
2- Go to Content
3- Go to Top Content
4- Chose a top content (or post) form Content combo box
5- Find out a new hot title for this post based of useful keyword which most visitors search about it.
6- Go to your weblog and change your title of that content (or post)
7- And take enjoy

Example (scenario):
1- I have a post from 2005/11 (link) and it's a very useful post for our visitors
2- The title of this post was "connect to the localhost"
3- I follow top solution and find out half of my visitors of this page, comes from Google with "connect to localhost" instead of "connect to the localhost"
4- I changed the title and increase traffic on this post.

January 24, 2011

All fax accounts are inaccessible

- All fax accounts are inaccessible
- Windows Fax and Scan: The message could not be sent. The RPC server is unavailable.
- When I try to send a new fax, it immediately pops up a message that says: "New Fax: Unable to retrieve cover pages associated with the selected account."


Solution:
You can solve it, fast and easy with this solution just flow these steps.
1- Open Windows Fax and Scan
2- Goto Tools > Fax Accounts...
3- Select and Remove the error signed account(s)

4- Press on Add... button
5- Choose a right options from Fax Setup wizard.

6- Fine and for more details, please let me and other readers ;-)

January 17, 2011

How to change post titles in blogger for SEO

- Best SEO for blogger
- How to change title blogger posts for SEO?
- How to change title of all posts for SEO?
- Change the title of each post for best SEO in blogger.
- Change the title of each post for best SEO in blogspot.
- Optimize post title for SEO on Blogger/Blogspot.
- What's a blogger SEO optimization solution.

Story
After passing a week of my hottest post i googled my topic's title (exact title with copy/paste) and foud it in page 3 and it made me upset but after a careful look i saw the title of my page that was
    Software Developer: How to install Android on Windows
and that wasn't SEO Friendly like below at least.


Before SEO

After SEO
Solution
change the 
<title><data:blog.pageTitle/></title>
to
<b:if cond='data:blog.pageType == "item"'>
    <title><data:blog.pageName/> - <data:blog.title/></title> 
<b:else/> 
    <title><data:blog.pageTitle/></title> 
</b:if>


Solution (In details)
1- Go to your Blogger.com
2- Go to your Dashboard of your weblog
3- Go to Template
4- Find and click on Edit HTML button
5- Press Ctrl+F and find below line
<title><data:blog.pageTitle/></title>
6- Replace it with below
<b:if cond='data:blog.pageType == "item"'>
        <title><data:blog.pageName/> - <data:blog.title/></title> 
    <b:else/> 
        <title><data:blog.pageTitle/></title> 
    </b:if>
7- Press the Save Template button and Close
8- Enjoy :-D

January 12, 2011

Monitor or LCD-TV - that is the question

SONY-BRAVIA TV (US)
EX710
32
LED
1080p
120Hz
WiFi
USB
800$
EX600
32
LED
1080p
60
----
USB
600$
EX500
32
---
1080p
120Hz
----
USB
580$
EX400
32
---
1080p
60
----
USB
450$
EX308
32
---
720
60
WiFi+
USB
430$
BX300
32
---
720
60
----
----
400$
BX308
22
---
720
60
WiFi+
USB
300$
BX300
22
---
720
60
----
----
270$

Samsung Monitor (IR)
PX23720
23
LED
1920x1080
2ms
HDMI/DVI
360$
P23700
23
---
1920x1080
2ms
DVI (LowPower)
284$
P23500
23
---
1920x1080
2ms
DVI
270$

I was wondering if you could help me to find the best product ...

January 11, 2011

How to install Android on Windows

- How to install Android on PC
- How to install Android on VMware
- Install Android in a Virtual Machine
- How to install Android on Windows 7
- Can i have both of Microsoft and Google OS with together

Solution:
Yes, it's possible and so simple with android-x86.org project.  Follow the instructions, step-by-step and feel free to contact me for any other questions.

1- Download froyo-vm-20100812.iso from the following links.
2- Run VMware Workstation. (After install VMware on your machine)
3- Create a virtual machine.


4- Select the DVD Player or ISO file (i select the iso file directly).


5- Select 1GB for start (if you want to have more than this check the SCSI/IDE option because in this version android have problem with SCSI)

6- Choose the Customize button

7- Unchecked the 3D graphics option in Display Adapter

8- Follow the screen-shots and enjoy :-D










January 05, 2011

How to post a Source Code in Blogger or Website

- Source Code on Blogger
- Source code plugin for blog
- Source code plugin for blogspot
- The best source code posting
- How to add source code to my blogspot post
- How to add HTML code to Blogger (blogspot.com)
- What's the best solution for post a source code in my weblog?


Best Solution:
If did you want to post source code snippets in your weblog on Blogger (blogspot) or any weblog services like WordPress or your website, SyntaxHighlighter is the best solution. There are another solution like below but the human readability is first important and i think that with SyntaxHighlighter you can kill two birds with one stone. It solves your problem for make a page with look nice source code and very human/developer readable, trust me, It comes from an old developer man:-D

All Solutions:
1- SyntaxHighlighter: SyntaxHighlighter is a fully functional self-contained code syntax highlighter developed in JavaScript.
link: http://alexgorbatchev.com/SyntaxHighlighter/
used by: Apache, Aptana, Mozilla, Yahoo, Wordpress, Bug Labs, Freshbooks and others.
demo: http://alexgorbatchev.com/SyntaxHighlighter/manual/demo
version: 3.0.83
Integration: http://alexgorbatchev.com/SyntaxHighlighter/integration.html
syntax:
<pre class="brush: css">##YOUR CSS CODE##</pre>
<pre class="brush: csharp">##YOUR C#(C-SHARP) CODE##</pre>

2- WordPress Source Code Plugin: Wordpress have created a shortcode which you can wrap around source code that preserves its formatting and even provides syntax highlighting for certain languages just with a simple wrap like below. It's same SyntaxHighlighter with same developer ;-)
link: http://en.support.wordpress.com/code/posting-source-code/
syntax:
[sourcecode language="css"]your code here[/sourcecode]

3- Google Code Prettify: Its offer a JavaScript module and CSS file too.
link: http://code.google.com/p/google-code-prettify
syntax:
<pre class="prettyprint">your code</pre>