Posts

Showing posts from 2013

Using Entity Model for connecting the database

When using Entity Model to connect the database, database is connected to the orject as a data model and instances of databse tables are used to perform insert,update,delete and search operations. This is a simple example of a database file connected using Entity Model namespace cecbClasses.Data_Adapters {     public class Func_FillMatrix     {         DSSEntities cecbContext; // This is the databse context         LeopoldMatrixValues matrixVal; // This is an variable of a database table         public Func_FillMatrix()             {                 cecbContext = new DSSEntities();             } // Inserting values to a database table public bool InsertValues(String impR, String actR, String proR, String impV, String magV)             {                 bool IsInserted = false;                 try                 {                     matrixVal = new LeopoldMatrixValues(); // Assigning the variable with a databse object                     matrixVal.impt_referenc

How to Read Excel Cell Values With C#

From this post you will be able to learn How to read row data in Excel worksheet or How to find the used area in an Excel worksheet from C# For reading entire content of an Excel file in C#, we have to know how many cells used in the Excel file. In order to find the used range we use "UsedRange" property of xlWorkSheet . It will return the last cell of used area Excel.Range range ; range = xlWorkSheet.UsedRange;