Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7739159
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T08:27:07+00:00 2026-06-01T08:27:07+00:00

I have a form where when it was created it will this query public

  • 0

I have a form where when it was created it will this query

 public IQueryable<PatientInfo> showMyPatients() 
 {    
        DbClassesDataContext myDb = new DbClassesDataContext(dbPath);
        var patientInfo = from patients in myDb.PatientInfos
                          where patients.Phy_ID == physcianID
                          select patients;

        return patientInfo;
  }

Once I call that I will insert it to a variable and pass it as a paramaters here

public void fillDataGrid(IQueryable<PatientInfo> patients) 
{                
       dgvMyPatients.DataSource = patients;
}

Sounds simple right? but when I run this query

private IQueryable<PatientInfo> searchPatient() 
{    
      DbClassesDataContext myDb = new DbClassesDataContext(dbPath);
      var search = from myPatients in myDb.PatientInfos
                   where (myPatients.Pat_ID == patient_ID && myPatients.Pat_First_Name.Contains(txtSearch.Text)) ||
                         (myPatients.Pat_ID == patient_ID && myPatients.Pat_Last_Name.Contains(txtSearch.Text)) ||
                        (myPatients.Pat_ID == patient_ID && myPatients.Pat_Middle_Name.Contains(txtSearch.Text))
                         select myPatients;

       return search;
 }

and pass it as a parameter to fillDataGrid() the DataGrid will have a blank value even though there is a result from that query

BindingSource bs = new BindingSource();
bs.DataSource = searchPatient();
dgvMyPatients.DataSource = bs;

NOTE: Both of the queries return PATIENTINFO and I would be inserting in the same DataGrid

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-01T08:27:08+00:00Added an answer on June 1, 2026 at 8:27 am

    What I did was, Replace my connection string , then changed in my query, there seems to be problem on my Query soo that is why it is not working. it is not producing any result.

    So what I did was, each time I call this event and change the datasource I use dgvMyPatients.Columns.Clear(); and dgvMyPatients.Refresh();

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have created a macro for excel which will pop up form that contains
i have asked to create a module that will record video messages form the
I have a form created in Windows Forms which is draggable wherever I click.
When you have an ASP.Net MVC form created by Html.BeginForm(), how do fields inside
I have created an form validation using ajax/php. Each text box is validated using
I have created a form that is used for both adding and editing a
I have created a form with a dropdown list for 'Region'. Once the form
I have created a form for my news articles which I then call to
I have created a form on which two components are present, button and progressbar
I created this form: <form method=post action=process-form.php id=emailForm name=emailForm target=_self> <h4>Sign up to be

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.