Showing posts with label linq. Show all posts
Showing posts with label linq. Show all posts

Last Sunday Linq Session At sir syed university

Thursday, January 20, 2011

Download Source Code and Handon


C# Language Basics

Tuesday, August 24, 2010

helpful Guide for CShare Developers

  • Working With Numbers
  • Dates and Times
  • Conditional Logic
  • Compare Operators
  • Loops
  • Defi ne New Types
  • fields
  • properties
  • methods
  • constructors
  • Inheritance
  • override inherited method
  • call base class version
  • Working with XML
  • Load an XML fi le
  • Working With Text
  • Create a text file
  • Read from a text fi le
  • Working With a Database
  • insert a record
  • read records
  • read a single value
  • linq
  • Dynamic DataType and expandoObject
  • Optional Parameter
  • Parallel Programing
  • Parallel For Loop
  • PLINQ















Entity Framework with Linq CRUD Operation Example

Friday, June 25, 2010

Download Tutorial


Download Source Code

Usama Wahab KHan

Simple DataBind in Silverlight

Tuesday, January 12, 2010





ADO.Net Classe is Absent in Silverlight That why some time Developer get confused How Retrieve Data in Silvrelight Application? Silverlight Provide ServiceModel Class You Thought this Class You can Call Web services ,WCF Services , RIA Services, Syndication (Rss,Atom) To Get Data. For Communicate with Data Base Web Prefer to Use Entity Framework Or We Can Use Linq to Sql, ADo.net Also through Services . Here i am try to Retrieve Data form Sql in my DataGridControl
1 Create Silverlight Application.
2 Add DataGrid Control and set its Properties .
3 Add Web Service to you Asp.net Application Where u display Silverlight Application (.XAP).
3 Add EntityFramework Data Model and Connect it to Database Thought Wizard.
4 Add any Table to your EntityFramework Data Mode Like (Products).
5 Add Function in your webservice (MydataServices.asmx.cs) .
6 Set return Type to List tableName type like List.
7 Add Linq Select Qurey and return toList() .
8 Add Service in you Silver light Application in Service References
9 Create load function call Service and Service Completed Event
10 on Completed ( EventArgs e ) Retrieve e.result.tolist() ,
11 assigned to DataGrid Item Source Property
















By Usama Wahab Khan


SEO Support in Asp.net 4.0 Matedata and Page Ruting

Friday, November 13, 2009




SEO( Search engine optimization ) is One of the Important Part for internet base Website SEO or E-Marketing is Very Important for get you site top take in Search engg:
or get more Visitor, Normally Search engines bot scan pages like mysite.com\asp you site and save you meta specially Keywords . but mostly the did get dynamic pages we were crated by the help of qureystring like mysite.com\MobileProduct.aspx?Product="Mobile" . Before asp.net 4.0 where were generate Metadata like Dynamic Keywords,Description,Title , for dynamic website like shopping cart there were hundreds
Product in database but u Search Engg only listed those pages those were query Now in asp.net 4.0 we had solution all of these problems we can resistor Our dynamic Pages with the help of asp.net 4.0 feature called Page Routing it has been introduce in Asp.net MVC now you can use this feature in asp.net-4.0 here i try to create one demo application where i had Products, Category's i will care Product page and route them and each page have dynamically generate keyword,title metadata

here u can see auto generated metadata and page routing it Product page dynamically generate from database
1. vs 2010 >New Website and named mycartapplicaiton
2. Right click on App_data folder add northwinds database from sample crate linq to sql add table and view

3. Right click on solution explorer and add two asp.net webform Product.aspx,Categories.aspx.
3 add gridview and set template like this on default.aspx

set sqldatasorce with wizard connectionstring >select columns [CategoryName], [Description], [CategoryID], [Picture] FROM table[Categories]

its will look like this

4.add gridview on categories.aspx


5. add sqldatasorce wizard for girdview ConnectionString>Select view Alphabetical list of products and columns ProductName, QuantityPerUnit, UnitPrice, UnitsInStock, UnitsOnOrder, ReorderLevel, Discontinued click on where button you will route option like this

6. product page repeat again same exercise code like this

7 add Global.asax handler add this coe in protected void Application_Start(object sender, EventArgs e)

9 add this code in Product.aspx on pageload event or dynamic keyword and meatadata


10 add this code in default.aspx on pageload event or dynamic keyword and meatadata



Download SourceCode
and enjoy asp.net 4.0 or any other help contant me
By Usama wahab khan

Asp.net Databind With Linq & linq to Sql

Sunday, September 6, 2009

LINQ: .NET Language-Integrated Query
After two decades, the industry has reached a stable point in the evolution of object-oriented (OO) programming technologies. Programmers now take for granted features like classes, objects, and methods. In looking at the current and next generation of technologies, it has become apparent that the next big challenge in programming technology is to reduce the complexity of accessing and integrating information that is not natively defined using OO technology. The two most common sources of non-OO information are relational databases and XML.
Rather than add relational or XML-specific features to our programming languages and runtime, with the LINQ project we have taken a more general approach and are adding general-purpose query facilities to the .NET Framework that apply to all sources of information, not just relational or XML data. This facility is called .NET Language-Integrated Query (LINQ).
We use the term language-integrated query to indicate that query is an integrated feature of the developer's primary programming languages (for example, Visual C#, Visual Basic). Language-integrated query allows query expressions to benefit from the rich metadata, compile-time syntax checking, static typing and IntelliSense that was previously available only to imperative code. Language-integrated query also allows a single general purpose declarative query facility to be applied to all in-memory information, not just information from external sources.
.NET Language-Integrated Query defines a set of general purpose standard query operators that allow traversal, filter, and projection operations to be expressed in a direct yet declarative way in any .NET-based programming language. The standard query operators allow queries to be applied to any IEnumerable-based information source. LINQ allows third parties to augment the set of standard query operators with new domain-specific operators that are appropriate for the target domain or technology. More importantly, third parties are also free to replace the standard query operators with their own implementations that provide additional services such as remote evaluation, query translation, optimization, and so on. By adhering to the conventions of the LINQ pattern, such implementations enjoy the same language integration and tool support as the standard query operators.
The extensibility of the query architecture is used in the LINQ project itself to provide implementations that work over both XML and SQL data. The query operators over XML (LINQ to XML) use an efficient, easy-to-use, in-memory XML facility to provide XPath/XQuery functionality in the host programming language. The query operators over relational data (LINQ to SQL) build on the integration of SQL-based schema definitions into the common language runtime (CLR) type system. This integration provides strong typing over relational data while retaining the expressive power of the relational model and the performance of query evaluation directly in the underlying store.
Object Relational Designer (O/R Designer)
The Object Relational Designer (O/R Designer) provides a visual design surface for creating LINQ to SQL entity classes and associations (relationships) that are based on objects in a database. In other words, the O/R Designer is used to create an object model in an application that maps to objects in a database. It also generates a strongly-typed DataContext that is used to send and receive data between the entity classes and the database. The O/R Designer also provides functionality to map stored procedures and functions to DataContext methods for returning data and populating entity classes. Finally, the O/R Designer provides the ability to design inheritance relationships between entity classes.

Tutorial



1 open Vs 2008 and Create new website







2 Drag n Drop on Form Button and GridView Control From ToolBar






3 set there id girdView to Gvlinq and Button1 to btnbinding





4 Right Click on Solution Explorer click on Add newitem and Select linq to sql







5 Open Server Explorer and Drag and drop any table form Database if u did`nt Created at yat so Sample database is available in Sorcecode copy from there




6 goback to default.aspx and double Click on button
and write code blow
try this linq and need any help so just contat me thank to spend your time on usamawahabkhan.blogspot.com learn free
By
Usama Wahab Khan