Hallo,
http://www1.minpic.de/bild_anzeigen.php?id=140841&key=73559177&ende
http://www1.minpic.de/bild_anzeigen.php?id=140844&key=10672182&ende
http://www1.minpic.de/bild_anzeigen.php?id=140845&key=15665863&ende
ich habe ja die 3 Tabellen
Type - Name
1:n Global - Name
1:n Dynamic - Name
Ziel:
Eine Combobox befüllen, mit allen möglichen Namen.
Anhanad einer ID, kann ich dann herausfiltern, wo der Name herkommt.
Wie erreiche ich das?
Ggf. mit LinQ, oder?
Das habe ich nicht.
// Create a database connection string
Ich habe nur ein Dataset!!
String str = String.Format("user id=sa;password=;initial catalog=Northwind;data source=(local)");
public void InitDataset()
{
try
{
// Create a database connection string
String str = String.Format("user id=sa;password=;initial catalog=Northwind;data source=(local)");
// Create the database connection object
SqlConnection sqlcon = new SqlConnection (str);
sqlcon.Open (); // open it
// Create the export query strings
String strCustomers = String.Format ("SELECT * FROM Customers WHERE City='London'");
String strOrders = String.Format ("SELECT O.* FROM Orders O INNER JOIN Customers C ON O.CustomerID = C.CustomerID WHERE C.City='London' ");
SqlCommand sqlCustomers = new SqlCommand (strCustomers, sqlcon);
SqlCommand sqlOrders = new SqlCommand (strOrders, sqlcon);
SqlDataAdapter ProjectAdapter = new SqlDataAdapter (sqlCustomers);
SqlDataAdapter OrdersAdapter = new SqlDataAdapter (sqlOrders);
DataTable CustomersTable = MyDataSet.Tables.Add ("Customers");
DataTable OrdersTable = MyDataSet.Tables.Add ("Orders");
ProjectAdapter.Fill (CustomersTable);
OrdersAdapter.Fill (OrdersTable);
MyDataSet.Relations.Add (CustomersTable.Columns[0],
OrdersTable.Columns[1]);
}
catch (Exception e)
{
MessageBox.Show (this, e.Message);
}
}
Danke + Grüße Andreas