31 October 2010

DataView Sorting

        SqlConnection conn = new SqlConnection(Connection);
        SqlDataAdapter daprod = new SqlDataAdapter("select * from tbl_details", conn);
        daprod.SelectCommand.CommandType = CommandType.Text;
        DataSet dsprod = new DataSet();
        daprod.Fill(dsprod);
        DataTable productDataTable = new DataTable();
        productDataTable = dsprod.Tables["Table"];
        DataView view = new DataView(productDataTable);
        view.Sort = "Emp_Last_Logged_In DESC";
        DataTable dt = view.ToTable();       
        DataTable cloneDataTable = dt.Clone();
        for (int i = 0; i < 5; i++)
        {
            cloneDataTable.ImportRow(dt.Rows[i]);
        }    
        GridView1.DataSource = cloneDataTable;
        GridView1.DataBind();

Resetting VS Language Settings

Resetting your Default Language Settings in VS 2005 
After you have installed Visual Studio 2008/2005  you are prompted to ‘choose’ the default collection of settings for your environment.  Depending one what choice you chose will dictate your keyboard mappings, your menu options, etc.

What do you do if you don’t like your selection after the initial install or if you want to change them?  You can change them, but it is not intuitive.
Here are the steps to change your settings:
  1. Choose Tools -> Import and Export Settings...
  2. Select Reset All Settings and click Next
  3. Select whether you would like to save the current settings (I would say not here) and click Next
  4. Select the settings you want to use and click Finish
  There you have it, the steps to reset/change your default language settings…

"Generic Host Process For Win32 Services Encountered A Problem and needs to close."


How to Fix "Generic Host Process For Win32 Services Encountered A Problem and needs to close."?

It's a common error message of Windows XP "Generic Host Process For Win32 Services Encountered A Problem and needs to close." This error is occurred for several reasons. For example, if Internet Explorer suddenly crashes you will see this message. But the great thing is that you can easily solve this type of error message. This page contains the information related to fixing Generic Host Process Error.

Steps to to Fix "Generic Host Process For Win32 Services Encountered A Problem and needs to close."

You can easily solve the problem or error message "Generic Host Process For Win32 Services Encountered A Problem and needs to close." Just follow any of the following methods:
Note: Both the method is the same. If you like the simple and easy solution then only follow Method 2 and ignore Method 1.

Method 1:

1. Copy the following code [only the bold codes].
@ECHO off
Echo Coded by http://hubpages.com/profile/rancidTaste
reg  add  HKLM\SYSTEM\CurrentControlSet\Services\netbt\parameters  /v  TransportBindName  /t REG_SZ  /d  ""  /f
reg  add  HKLM\Software\Microsoft\OLE  /v  EnableDCOM  /t  REG_SZ  /d  "N"  /f
Echo Coded by http://hubpages.com/profile/rancidTaste
Echo Generic Host Error Problem Is Fixed, Press any key to continue
pause

2. Open a notepad and paste the above copied content to the notepad.
3. Save the file as GenericHostErrorProblem.bat and close it.
4. Double-click on GenericHostErrorProblem.bat and run it.
5. After fixing or removing the errors, it will ask you to press any key to finish.
6. Press any key and that's all to fix the problem Generic Host Process For Win32 Services Encountered A Problem and needs to close.

Method 2:

This is very simple and straight forward. Just download the code form the following link and run it and that's all to solve or fix the problem "Generic Host Process For Win32 Services Encountered A Problem and needs to close."
Download Generic Host Process Error Removal Tool
By following any of the above method, you can easily solve the problem Generic Host Process For Win32 Services Encountered A Problem and needs to close. If you face any problem, then put the problem in the comment section.