File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes C / C++ and the fly likes DataConnections - Simple C# desktop app in Visual Studio Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Languages » C / C++
Bookmark "DataConnections - Simple C# desktop app in Visual Studio" Watch "DataConnections - Simple C# desktop app in Visual Studio" New topic

DataConnections - Simple C# desktop app in Visual Studio

Bill Zdarko

Joined: Aug 11, 2012
Posts: 5

I am creating a very simple desktop app using visual studio express for C#.

I have a database with two tables.
One is the header - it has an auto number field and a text name field.
The other table has 5 parts, auto number, IndexTableOne, Description, date, outdated(truefalse)
first table looks like this.
1 Section one
2 Section two
3 Section three
4 Section four
table two looks like this
1 1 bunchoftext 1/2/2012 no
2 1 bunchoftext 1/2/2012 no
3 2 bunchoftext 1/2/2012 no
4 3 bunchoftext 1/2/2012 no
5 1 bunchoftext 1/2/2012 no
6 4 bunchoftext 1/2/2012 no

I created a connection to the database using the menu options in Visual studio. I know I can do a bunch of drag and drop stuff but I want to be able to go into the code and make a new data set and run SQL queries on the existing data connection.
The current data connection is called _implimentDataSet and shows both tables inside of it.

The application will have a drop down box that will be populated by a database (table one). When I select a section in the drop down, I want the table to only show the second table in a dataview of only that section.
if I select section one I want to have the dataview show only where the second field is 1.
So I want a sql statement
Select *
From _implimentDataSet
WHERE fieldone = fieldtwo
I can handle the SQL statement, what I want to know is how to make a method that when my drop down changes that it will select do this.

My problem.
How to I make a dataset? I do not want to use menus and drag n drop, I want to write this in code.
So far I have DataSet ds = new DataSet();
now how do I make this new dataset to look in the _implimentDataSet that has been created?

Thank you.

Bill Zdarko

Joined: Aug 11, 2012
Posts: 5

if it is much easier in a visual view, can I get a step by step on how to make a change in a dropdown effect the contents of a datagridview.

I agree. Here's the link:
subject: DataConnections - Simple C# desktop app in Visual Studio
Similar Threads
Tutorial PostgreSQL 8.3 on Glassfish V2.1 for ConnectionPool in Netbeans 6.5.1, WindowsXP (Post 3)
RE: stmt.ExecuteQuery question
Bug in JDBC ? Simple Select statement not returning a resultSet
DB2 700 and 701 - Test Sample
db2 - 703 certification