Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. LINQ
  4. linq to BindingNavigator/BindingSource

linq to BindingNavigator/BindingSource

Scheduled Pinned Locked Moved LINQ
databasequestioncsharplinqhelp
1 Posts 1 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • D Offline
    D Offline
    dkosasih
    wrote on last edited by
    #1

    Hi all, Here I am with my question again :) i am wondering how do I bind linq query to BindingNavigator or at least a BindingSource so I can bind it to BindingNavigator. say, I have go a BindingNavigator called bn (BindingNavigator bn) var query = from t in db.SOMETHINGS select t; I tried bn.BindingSource = query; and it was no help at all I also tried BindingSource bs = new BindingSource(); bs.DataSource = query; bn.BindingSource = bs that also return me errors. Basically I just wanted to achieve something like this with linq. Because I have started it with linq :( String strConn = "Data Source=DATASOURCE;Initial Catalog=DB;User ID=sa;Password=sa;"; SqlConnection conn = new SqlConnection(strConn); SqlDataAdapter da = new SqlDataAdapter("Select * From [TRANSACTION]", conn); SqlCommandBuilder cmd = new SqlCommandBuilder(da); DataSet ds = new DataSet(); da.Fill(ds, "trans"); BindingSource bs = new BindingSource(ds, "trans"); //I can't simply use linq query result here :(:(:( bnPrevTrans.BindingSource = bs; Again, thank you guys ....

    1 Reply Last reply
    0
    Reply
    • Reply as topic
    Log in to reply
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes


    • Login

    • Don't have an account? Register

    • Login or register to search.
    • First post
      Last post
    0
    • Categories
    • Recent
    • Tags
    • Popular
    • World
    • Users
    • Groups