Thursday, February 4, 2010

Show and highlight the searched Record on Top in scrollable DataGrid

This post solve the problem when we search a record from a scrollable gridview or datagrid and the search record will not on the screen till we scroll down. we have a two option either we maintain the scroll position or we put the searched row on top and highlight.
The solution  is....

I just find the row from the datatable which is bind to datagird or gridview....

and create a new row and get the record from searched row ....

and delete the row from that datatable....

and insert the new created row at 0 position of the datatable and highlight it.

here is the source code


for ( int q = 0; q < dsGetDetails.Tables[0].Rows.Count; q++)

{
    //Searh the record
    if (dsGetDetails.Tables[0].Rows[q].ItemArray[0].ToString()== txtEmpId.Text.Trim())

     {
         // Create new row
         DataRow drNew = dsGetDetails.Tables[0].NewRow();
      
       // Loop through current row and copy values to new row
       for (int x = 0; x <= dsGetDetails.Tables[0].Columns.Count - 1; x++)
         {
           drNew[x] = dsGetDetails.Tables[0].Rows[q][x];
         }
     
       // Remove existing row
      dsGetDetails.Tables[0].Rows.RemoveAt(q);

     //Insert new row
    dsGetDetails.Tables[0].Rows.InsertAt(drNew, 0);


    dgDetails.DataSource = dsGetDetails.Tables[0];
    dgDetails.DataBind();


    //Now highlight the row at position 0.
     dgDetails.Items[0].BackColor = System.Drawing.Color.FromName("Red"); 
     break;

   }
}

Friday, January 29, 2010

What is the concept of Load balancing ?,what is RADWARE? what are the uses of it?

Load balancing is a Process in which web Server Traffic is distributed on multiple servers to increase the performance of the applications. It is also useful if any one server will fail,, in this situation Application will run.

For load balancing there must be 2 or more server are employed. In case one of the servers begins to get overloaded, the requests are forwarded to another server. Load balancing brings down the service time by allowing multiple servers to handle the requests. This service time is reduced by using a load balancer to identify which server has the appropriate availability to receive the traffic.


Load balancing allows the service to continue even in the face of server down time due to server failure or server maintenance. If you are load balancing across several servers and one of the servers fails, your service will still be available to your users.
 
RADWARE- Radware is a device , solve the problem of load balancing and many more. it generally distribute the request or can say that Traffic redirections in multiple servers and provides the health monitoring and server failure detection. provide maximum bandwidth utilization also provide security threads.

Thursday, January 21, 2010

Generate Script of Database schema and data both

You can Create Database script in sqlserver 2005 with data and schema.

Just open Your Sql server management studio -> Tools-> Extrnal Tools.

Write Title - Publishing Wizard

Select on Command  and select Your ( sql server install folder) \90\Tools\Publishing\1.2\SqlPubWiz.exe

click apply  and ok.

(If you didn't find the above location than you must install this Setup )

Now select Tools->Publishing Wizard.

Database publishing Wizard is open now .

select server and select database and set location of files and  set Schema and data  to  Schema and Data

click next and finish this will Generate script with insert query of data.