Showing posts with label LINQ. Show all posts
Showing posts with label LINQ. Show all posts

Sunday, 24 July 2016

LINQ to Array Example

Posted by : Manav Pandya

LINQ to Array example

As we discussed previously  in LINQ to SQL queries  , we can also specify Array with LInQ

It means query result will be forwarded to LINQ from Array object 

I have taken simple example in which i have taken 10 value as int , and specified condition and at last executed my query 

So it is simple you can try this 










Read More

Benefits of choosing LINQ

Posted by : Manav Pandya


One question arise that "Why LINQ query is used rather that normal SQL query ???"


So your solution are here as follow   :

LINQ is integrated into the C# and VB languages and it provides syntax highlighting and IntelliSense features and even you can debug your queries using the integrated debugger in Visual Studio.

Using LINQ it is possible to write code much faster than older queries and lets you save half of the time spent writing queries.


Using LINQ you can easily see the relationships among tables and it helps you compose your query that joins multiple tables.


Transformational features of LINQ make it easy to convert data of one type into a second type. For example, you can easily transform SQL data into XML data using LINQ. 


Read More

LINQ to SQL basic example

Posted by : Manav Pandya

Here you can see that we have used some data as follow :

[ 1 ] using System. Linq;


This namespace defines that we are using LINQ query mechanism , and it will provide intellisense to use necessary attributes

[ 2 ] Data Source


It defines that we are using "StudentDataContext" , it means we are connected to database by this object .

[ 3 ]  Executing Query 


As you can see query is there , so that its time to execute LINQ to SQL query as above example , it will print all result that returned by "stdNames" variable


Normally it does 

  • Create connection to database
  • It submits and retrives object to database
  • Convert object to SQL queries and vice versa

Read More

What is LINQ To SQL ?

Posted by : Manav Pandya

LINQ 

LINQ Stands For :-

"Language Integrated Query"

LINQ is basically used to manipulate queries easily with efficiency , because LINQ queries are vary much flexible and adjustable wherever you want .

LINQ enabled provide full "Type Safe" & "Compile Time Checking" scenario so that for developer rich refactoring support when writing LINQ queries .

  
Read More