Posts

Showing posts from June, 2015

Export Table data into Excel

Html  <input type="button" id="btnExport" value=" Export Table data into Excel " /> <br/> <br/> <div id="dvData">     <table>         <tr>             <th>Column One</th>             <th>Column Two</th>             <th>Column Three</th>         </tr>         <tr>             <td>row1 Col1</td>             <td>row1 Col2</td>             <td>row1 Col3</td>         </tr>         <tr>             <td>row2 Col1</td>             <td>row2 Col2</td>             <td>row2 Col3</td>         </tr>         <tr>             <td>row3 Col1</td>             <td>row3 Col2</td>             <td>row3 Col3</a>             </td>         </tr>     </table> </div> Scripts Section $("#btnExport&qu

Lambda Query

What is a Lambda Expression?             A lambda expression is an anonymous function. It allows to write a method in the same place you are going to use it.  syntax : Parameters => Executed code. Basic Lambda Expression 1)Where List< int> mark = new List< int> {90, 71, 82, 93, 75, 82 }; var result= mark.Where(n => n > 80); Console.WriteLine( "Values greater than 80 are" );  foreach(val item in result) {  Console.WriteLine( "{0}" , item );  } // Outputs:  // Value greater than 80 are // 90 // 82 // 93 // 82 2)Count() int result= mark.Where(n => n > 80).Count() ; Console.WriteLine( "{0} markare greater than 80" , result);   // Outputs:  // 4 mark are greater than 80   3)Sum()   int result= mark.Where(n => n > 80).Count() ; Console.WriteLine( "{0} markare greater than 80" , result);     // Outputs:  // Sum of mark greater than 80 are // 347

NuGet - Common Database Settings

NuGet Common Database Settings Step 1:  get the nuget package https://www.nuget.org/packages/CommonDatabaseSettings Step 2: Make a object for DataBase class. (you can see many Method ) Call the method named CheckDatabaseConnection . Note : you can get the connection sting by calling DataBase.ConnectionString That's all, select which type of database to be connected. More over there are many methods in the BataBase class. Function Description Return type GetConnectionString(string) Set the database connection string void CheckDatabaseConnection(string) Check the connection string existing or not bool CheckDataExist(string) Check the data is present in the table bool DropdownFill(string) Fill the a Dropdown DataTable ExecuteDB(string) Can insert, update and delete data in the database void GetData(string) Get a strin