problem binding data with gridview

Discussion in 'ASP .Net' started by Seema, May 14, 2009.

  1. Seema

    Seema Guest

    I have the following coding but when I build it it gives me following error


    public static DataFeedEntities2 entities = new DataFeedEntities2();
    var type = (from p in entities.Address select p);
    this.GridView2.DataSource = type;
    this.GridView2.DataBind;

    ERROR:--> Only assignment, call, increment, decrement, and new object
    expressions can be used as a statement
     
    Seema, May 14, 2009
    #1
    1. Advertising

  2. On May 14, 4:43 pm, Seema <> wrote:
    > I have the following coding but when I build it it gives me following error
    >
    > public static DataFeedEntities2 entities = new DataFeedEntities2();
    > var type = (from p in entities.Address  select p);
    >             this.GridView2.DataSource = type;
    >             this.GridView2.DataBind;
    >
    > ERROR:--> Only assignment, call, increment, decrement, and new object
    > expressions can be used as a statement


    this.GridView2.DataBind()
     
    Alexey Smirnov, May 15, 2009
    #2
    1. Advertising

  3. Seema

    shawpnendu

    Joined:
    Mar 4, 2009
    Messages:
    17
    Location:
    Dhaka, Bangladesh
    I THINK THE PROBLEM IS IN
    var type = (from p in entities.Address select p);
    this line. Check that both are same object.

    REGARDS
    shawpnendu.blogspot.com
     
    shawpnendu, May 17, 2009
    #3
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Jordan
    Replies:
    2
    Views:
    2,571
    Jordan
    Feb 10, 2004
  2. Amit
    Replies:
    6
    Views:
    13,913
    Assimalyst
    Oct 24, 2006
  3. =?Utf-8?B?UGhpbGlw?=

    GridView - ObjectDataSource - Data Binding

    =?Utf-8?B?UGhpbGlw?=, Oct 24, 2006, in forum: ASP .Net
    Replies:
    2
    Views:
    1,027
    =?Utf-8?B?UGhpbGlw?=
    Oct 24, 2006
  4. vignesh86
    Replies:
    0
    Views:
    633
    vignesh86
    Jul 17, 2010
  5. JcFx
    Replies:
    0
    Views:
    313
Loading...

Share This Page