in theas two methods you are filling the same Dataset, which means after filling the second one, it's gonna overwrite what you had in the first data population.
showdatabase();
showchannelingdatabase();
Basically you need to update your code with the following :
namespace MediAlert.Patient
{
public partial class Patient_Details : Form
{
private MySqlConnection con;
private dbconnection dbcon = new dbconnection();
private MySqlDataAdapter da;
private DataSet ds = new DataSet();
private MySqlDataReader dr;
public Patient_Details()
{
InitializeComponent();
}
private void Patient_Details_Load(object sender, EventArgs e)
{
con = dbcon.openconnection();
showdatabase();
showchannelingdatabase();
}
public void showdatabase()
{
con.Open();
da = new MySqlDataAdapter("select * from patientinformation", con);
da.Fill(ds,"table0");
dtvupdate.DataSource = ds.Tables["table0"];
con.Close();
}
public void showchannelingdatabase()
{
con.Open();
da = new MySqlDataAdapter("select * from channeling", con);
da.Fill(ds, "table1");
dgvchannelingupdate.DataSource = ds.Tables["table1"];
con.Close();
}
public void searchbasedidadddetailsupdate()
{
try
{
con.Open();
DataView view = new DataView();
view.Table = ds.Tables["table0"];
view.RowFilter = "Patient_ID = '" + txtupdatesearch.Text.Trim() + "'";
dtvupdate.DataSource = view;
if (dtvupdate.RowCount < 1)
{
MessageBox.Show(
"Invalide ID! Please select Patient ID from the following combobox or try again",
"Medi Alert Patien Care System", MessageBoxButtons.OK, MessageBoxIcon.Warning);
}
}
catch (MySqlException ms)
{
MessageBox.Show(ms.Message);
}
con.Close();
}
public void searchbasedidupdate()
{
try
{
con.Open();
DataView view = new DataView();
view.Table = ds.Tables["table1"];
view.RowFilter = "Channeling_ID = '" + cmbchannelingidupdate.Text.Trim() + "'";
dgvchannelingupdate.DataSource = view;
if (dgvchannelingupdate.RowCount < 1)
{
MessageBox.Show(
"Invalide ID! Please select Channeling ID from the following combobox or try again",
"Medi Alert Patien Care System", MessageBoxButtons.OK, MessageBoxIcon.Warning);
}
}
catch (MySqlException ms)
{
MessageBox.Show(ms.Message);
}
con.Close();
}
}
}