User Name Password Register
DaniWeb IT Discussion Community
All
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
Reply
Join Date: May 2008
Posts: 39
Reputation: jainendra.shah is an unknown quantity at this point 
Rep Power: 1
Solved Threads: 0
jainendra.shah jainendra.shah is offline Offline
Light Poster

big problem

  #1  
Jun 10th, 2008
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]);

}
AddThis Social Bookmark Button
Reply With Quote  
Reply

Only community members can participate in forum threads. You must register or log in to contribute.

DaniWeb C# Marketplace
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)

 

Thread Tools Display Modes

Similar Threads
Other Threads in the C# Forum

All times are GMT -4. The time now is 7:20 am.
Forum system based on vBulletin Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
©2003 - 2008 DaniWeb® LLC