|
8kelvin wrote: Thanks, Pankajkumar Nikam.Thumbs Up
You are welcome 8kelvin
Always Keep Smiling.
Yours Pankaj Nikam
|
|
|
|
|
Hi all
I have 2 tables in the same data set like this:
string sqlCus="select * from Customers";
string sqlOrder="select * from Orders";
SqlDataAdapter daCus=new SqlDataAdapter(sqlCus,conn);
SqlDataAdapter daOrder=new SqlDataAdapter(sqlOrder,conn);
DataSet ds=new DataSet();
daCus.Fill(ds,"Customers");
daOrder.Fill(ds,"Orders");
now I want to get the OrderID column in Orders table and ContactName (CustomerName) in the Customers table according to the CustomerID column in the Orders table then show both column in a DataGridView control, how to do that?
note: not use stored procedure and Linq
|
|
|
|
|
You could do one query and join the tables on the query
string sql = "select ContactName, Orders.OrderID from Customers Left Outer Join Order ON CustomerID = Order.CustomerID";
The above should work, you may just have to change the column names to what you want. You could also add an Order by statement in the end of that if you wanted.
This link may help you in the future with joining tables in sql queries.
http://en.wikipedia.org/wiki/Join_(SQL)[^]
hope that helps you.
Matthew Vass
QA Analyst
mvass@hostmysite.com
http://www.hostmysite.com?utm_source=bb[^]
|
|
|
|
|
Thank you for your answer, but what I wanted to know is how to join 2 tables in the same data set using data relation. I do know how to join 2 tables using sql's select command, but this one is not.
Could you please point me out for this?
Thanks
|
|
|
|
|
I'm sorry the first answer did not help you, I'm guessing you have a reason to populate two separate datasets and then parse through them to get your info.
You may want to look at this article, it explains how to use select/sort things using your dataset and a datatable.
http://msdn.microsoft.com/en-us/library/system.data.datatable.select.aspx[^]
Also you will most likely have to do a dataset copy then dataset.add to add the columns to the copied dataset in order to get the results you want. Not sure if this is exactly what your looking for but hope this points you in the right direction.
|
|
|
|
|
If I double click on the windows media player control, it goes full screen. Any way to stop this behaviour ?
Christian Graus
Driven to the arms of OSX by Vista.
|
|
|
|
|
|
|
|
You can read my image processing articles, they all do it.
Christian Graus
Driven to the arms of OSX by Vista.
|
|
|
|
|
|
Collin Jasnoch wrote: Stream tStream = new FileStream(imgPtr, FileAccess.Read);//Can I do this???
ImageTransfer.EnqueueImageStream(tStream);
Not sure if you can do this. But, the rest looks right.
Christian Graus
Driven to the arms of OSX by Vista.
|
|
|
|
|
Image handle != File handle. That's why the filestream constructor fails.
Out of curiosity though, couldn't you just convert tempImage to a Bitmap, then call GetHbitmap?
|
|
|
|
|
Hi
how can i connect Oracle to my C# program ?
thank's
|
|
|
|
|
|
I can successfully build a list of processes and threads; but I'd like to be able to identify which user is running a process.
Does anyone have any insight into how to do this?
Thanks,
Matt Brown
|
|
|
|
|
|
Thanks for the info.
I had come across other example using win32_process, but I felt like it should be easier than this = there should be a method in a .NET class in system.diagnostic that I should be able to use to query for the username of a process.
But, I guess, I could be wrong
Thanks!
Matt Brown
|
|
|
|
|
Hi all
I dont know whether I am asking stupid ques or not but Can anyone advice me about some Insert in windows application.
I have 500000 data to insert in a database.
What will be most efficient way to do it?
Should I use ADO.NET or LINQ or in a proceduse or View....
By your advice I will start my coding
I am a Beginer...
Thanks
|
|
|
|
|
|
Yes Im using SQL Server...
|
|
|
|
|
Then create a stored procedure in you database with the method which was linked to in my previous post.
Then convert you information into an XML format and call the stored procedure with the XML.
Simple...
hmmm pie
|
|
|
|
|
|
I type this same thing over and over in emails to my customers and i was wondering how to write a macro to paste
Please acknowledge receipt of this order by email to me.
into the body of email by hitting a button on the task bar called "Please Acknowledge"
i have visual studio 2008 and using outlook 2007
anyone have any ideas.
Thank you
-Ryan
|
|
|
|
|