I want to pull down information from two tables from a db. One row from A, and the rows in B with an FK to the row I pulled from A.
I'd like to make this a single stored proc with two select statements, rather than having to make two calls to the DB.
I know several ways to pull the information from a single select...but can't remember how to get data from multiple selects. Googling has proven to be difficult, since I'm having trouble coming up with nouns/verbs to describe the situation that don't describe a million other things.
Can someone point me in the right direction?
(To keep things simple, I know to use "using" statements and such...I just need the basic idea of the approach).
using (SqlConnection conn = new SqlConnection(connectionString))
{
using (SqlCommand com = new SqlCommand(commandString, conn))
{
<somehow get multiple select's of data here in one call>
}
}