•
•
•
•
What is DaniWeb IT Discussion Community?
You're currently browsing the C# section within the Software Development category of DaniWeb, a massive community of 428,391 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 3,531 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our C# advertiser: Programming Forums
Views: 213 | Replies: 0
![]() |
•
•
Join Date: May 2008
Posts: 39
Reputation:
Rep Power: 1
Solved Threads: 0
hi frds,
I want to show link b/w 2 table. Where both table is genrate at run time with same name.
& want to establish to relation .
but problem is how i access columns of both table ..
my code is
OleDbConnection con11;
OleDbDataAdapter daquery;
DataSet dsquery;
void chktable1_MouseDown(object sender, MouseEventArgs e)
{
CheckedListBox chktable1 = (CheckedListBox)sender;
mdown=chktable1.Name.ToString();
//MessageBox.Show(mdown);
Point ClickPoint = new Point(e.X, e.Y);
selectcdown = chktable1.SelectedItem.ToString();
//MessageBox.Show(selectcdown);
con11 = new OleDbConnection();
ss = ((MDIParent1)this.mdi_form).s5;
con11 = new OleDbConnection(ss);
daquery = new OleDbDataAdapter("Select * from " + mdown + " ", con11);
dsquery = new DataSet();
con11.Open();
daquery.Fill(dsquery, mdown);
}
string mup;
void chktable1_MouseUp(object sender, MouseEventArgs e)
{
CheckedListBox chktable1 = (CheckedListBox)sender;
mup = chktable1.Name.ToString();
string selectcup = chktable1.SelectedItem.ToString();
MessageBox.Show(selectcup);
daquery.SelectCommand = new OleDbCommand("Select * from " + mup + "", con11);
daquery.Fill(dsquery, mup);
dsquery.Relations.Add("Temp", dsquery.Tables[mdown].Columns[selectcdown], dsquery.Tables[mup].Columns[selectcup]);
}
I want to show link b/w 2 table. Where both table is genrate at run time with same name.
& want to establish to relation .
but problem is how i access columns of both table ..
my code is
OleDbConnection con11;
OleDbDataAdapter daquery;
DataSet dsquery;
void chktable1_MouseDown(object sender, MouseEventArgs e)
{
CheckedListBox chktable1 = (CheckedListBox)sender;
mdown=chktable1.Name.ToString();
//MessageBox.Show(mdown);
Point ClickPoint = new Point(e.X, e.Y);
selectcdown = chktable1.SelectedItem.ToString();
//MessageBox.Show(selectcdown);
con11 = new OleDbConnection();
ss = ((MDIParent1)this.mdi_form).s5;
con11 = new OleDbConnection(ss);
daquery = new OleDbDataAdapter("Select * from " + mdown + " ", con11);
dsquery = new DataSet();
con11.Open();
daquery.Fill(dsquery, mdown);
}
string mup;
void chktable1_MouseUp(object sender, MouseEventArgs e)
{
CheckedListBox chktable1 = (CheckedListBox)sender;
mup = chktable1.Name.ToString();
string selectcup = chktable1.SelectedItem.ToString();
MessageBox.Show(selectcup);
daquery.SelectCommand = new OleDbCommand("Select * from " + mup + "", con11);
daquery.Fill(dsquery, mup);
dsquery.Relations.Add("Temp", dsquery.Tables[mdown].Columns[selectcdown], dsquery.Tables[mup].Columns[selectcup]);
}
![]() |
•
•
•
•
•
•
•
•
DaniWeb C# Marketplace
•
•
•
•
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
- non blocking getchar.. big problem :( (C)
- BIG problem with STL List Container (C)
- internet explorer / virus problem here (Viruses, Spyware and other Nasties)
- Big Problem (Viruses, Spyware and other Nasties)
- BIG problem... laptop screen shaking/whiting out! (Monitors, Displays and Video Cards)
- Big Problem!!!!!!!!!!! (Viruses, Spyware and other Nasties)
- Big Problem, Generic Error (VB.NET)
- Big Problem (system freezing) (Troubleshooting Dead Machines)
- CommonName big problem (Windows NT / 2000 / XP / 2003)
Other Threads in the C# Forum
- Previous Thread: Datagridview control
- Next Thread: How to upload .doc file into SQLSERVER2005 in c# windows application


Linear Mode