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. Web Development
  3. ASP.NET
  4. Data set Filter

Data set Filter

Scheduled Pinned Locked Moved ASP.NET
databasetutorial
4 Posts 2 Posters 1 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.
  • L Offline
    L Offline
    Lost User
    wrote on last edited by
    #1

    Hi All, I am using Data set to get value from the data base using following code.

    DataSet ds = new DataSet();
    String connectionString = ConfigurationManager.ConnectionStrings["ConnectionString"].ToString();
    MySqlDataAdapter mySqlDataAdapter = new MySqlDataAdapter(query, connectionString);
    mySqlDataAdapter.Fill(ds);

    once i get this i want filter with another query how to add do this. Thanks, Amit

    Z 1 Reply Last reply
    0
    • L Lost User

      Hi All, I am using Data set to get value from the data base using following code.

      DataSet ds = new DataSet();
      String connectionString = ConfigurationManager.ConnectionStrings["ConnectionString"].ToString();
      MySqlDataAdapter mySqlDataAdapter = new MySqlDataAdapter(query, connectionString);
      mySqlDataAdapter.Fill(ds);

      once i get this i want filter with another query how to add do this. Thanks, Amit

      Z Offline
      Z Offline
      zeego
      wrote on last edited by
      #2

      You can either filter with a SQL query or use datatable's 'Select' method like DataRow[] dr=ds.Tables[0].Select("id="+yourid);

      L 1 Reply Last reply
      0
      • Z zeego

        You can either filter with a SQL query or use datatable's 'Select' method like DataRow[] dr=ds.Tables[0].Select("id="+yourid);

        L Offline
        L Offline
        Lost User
        wrote on last edited by
        #3

        hi I want like query like this way i am filling dataset in following way

        SELECT O.name , study_uid_mask FROM study_org_mapping s INNER JOIN Organization O ON O.PK = S.ORG_FK"

        ds.Tables[0].Select(myid + "LIKE 'study_uid_mask'";

        but it seems it is not working Thanks, Amit

        Z 1 Reply Last reply
        0
        • L Lost User

          hi I want like query like this way i am filling dataset in following way

          SELECT O.name , study_uid_mask FROM study_org_mapping s INNER JOIN Organization O ON O.PK = S.ORG_FK"

          ds.Tables[0].Select(myid + "LIKE 'study_uid_mask'";

          but it seems it is not working Thanks, Amit

          Z Offline
          Z Offline
          zeego
          wrote on last edited by
          #4

          Would'nt it be study_uid_mask=your_value; DataRow[] foundRows=ds.Tables[0].Select("myid ="+study_uid_mask); ? More on filter expressions here http://msdn.microsoft.com/en-us/library/system.data.datacolumn.expression.aspx[^]

          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