T
Ted
Well, I've taken poetic license with "newby" having been programming
for more than a couple dozen years, but I have recently started
studying .NET and ADO.NET, leveraging my experience with other
frameworks such as Borland's VCL, and MS' MFC, and technologies such as
ADO and MDAC, to speed things up.
I have the professional edition of Visual Studio 2005, with MS SQL
Server 2005, and I downloaded and installed ADO.NET 3, the relevant SDK
and extensions to Visual Studio for it.
I intend to experiment with ADO.NET with both a windows forms
application and a web application using ASP.NET.
With my readings so far, I see only simple examples where the master
control (either a text box or a combo box) determines what is seen in a
details grid.
The example I want to use in my experiments is a recipe management
database. The user's user ID will be a parameter in all queries. But
there will be several combo boxes for "Cuisine type" (e.g. Thai,
Mandarin, French, &c.), author (e.g. the user's name, some other
author's name), kind of dish (breakfast, lunch, entrez, appetiser,
desert), possibly with subtypes (e.g. for deserts, cake, pie pudding,
&c.). Some of these combo boxes will have a default value and require
selection of either the default or one other item in the combo box.
Others will allow a NULL value, and if the user decides there should be
a value other than NULL, he or she is constrained to select from the
items in the combo box. The author, for example, might be NULL, to
indicate the recipe may be an old family recipe or a recipe for which
the author is unknown. I guess this is simpler than some cases in that
the user will not be able to type entries into the fields, except for
the author, for which I'll need a validator. OTOH, it is more complex
in that the entries in the combo boxes do NOT affect in any way the
possible choices in any of the other combo boxes. The question I'm
wrestling with is how to use such a collection of controls to manage
what is shown in (in my case) a pair of details grids (one for
ingredients and another for instructions for a given recipe).
Can anyone provide an example, or an URL to a page that gives an
example, that shows how to do this?
The second example I am looking for is how to use a combo box tied to
one table as an editor for the cells in one column of the gridview tied
to another. For example, for the grid representing the ingredients
used in a recipe, the second last column will be a number representing
a quantity and the last column will be units of measure such as grams,
kilograms, ounces, pounds, teaspoons, table spoons, &c. Of course, the
number of possible units is limited, and should be selected from a
combo box rather than entered by the user typing (with all the related
potential sources of error such as typos). But to make things more
interesting, I want to give the user the option of selecting what
system of units (cgs, SI, Imperial) will be used both for entering and
for viewing a recipe, by default but with the option of changing the
system of units used for a given recipe (so a user prefering to use
metric can enter a recipe provided in imperial units and have my
program automatically convert it to metric). After all, a person most
familiar with metric might have, for whatever reason, a cookbook in
which all recipes are provided with imperial units.
Like I said, it is trivially easy for me to get applications similar to
the examples I have found (both in the provided MS documentation and
the multitude of books I have bought) to work, but their extension to
situations like what I describe above is not obvious.
I had thought about doing most of this in code, but I want to know if
there is an easy way to accomplish this using Visual Studio 2005's form
designer before I start writing n-factorial parameterized SQL
statements or a function to create them at run time.
Pointers(URLS) to more useful examples of using ADO.NET2/3 would be
greatly appreciated.
Thanks
Ted
for more than a couple dozen years, but I have recently started
studying .NET and ADO.NET, leveraging my experience with other
frameworks such as Borland's VCL, and MS' MFC, and technologies such as
ADO and MDAC, to speed things up.
I have the professional edition of Visual Studio 2005, with MS SQL
Server 2005, and I downloaded and installed ADO.NET 3, the relevant SDK
and extensions to Visual Studio for it.
I intend to experiment with ADO.NET with both a windows forms
application and a web application using ASP.NET.
With my readings so far, I see only simple examples where the master
control (either a text box or a combo box) determines what is seen in a
details grid.
The example I want to use in my experiments is a recipe management
database. The user's user ID will be a parameter in all queries. But
there will be several combo boxes for "Cuisine type" (e.g. Thai,
Mandarin, French, &c.), author (e.g. the user's name, some other
author's name), kind of dish (breakfast, lunch, entrez, appetiser,
desert), possibly with subtypes (e.g. for deserts, cake, pie pudding,
&c.). Some of these combo boxes will have a default value and require
selection of either the default or one other item in the combo box.
Others will allow a NULL value, and if the user decides there should be
a value other than NULL, he or she is constrained to select from the
items in the combo box. The author, for example, might be NULL, to
indicate the recipe may be an old family recipe or a recipe for which
the author is unknown. I guess this is simpler than some cases in that
the user will not be able to type entries into the fields, except for
the author, for which I'll need a validator. OTOH, it is more complex
in that the entries in the combo boxes do NOT affect in any way the
possible choices in any of the other combo boxes. The question I'm
wrestling with is how to use such a collection of controls to manage
what is shown in (in my case) a pair of details grids (one for
ingredients and another for instructions for a given recipe).
Can anyone provide an example, or an URL to a page that gives an
example, that shows how to do this?
The second example I am looking for is how to use a combo box tied to
one table as an editor for the cells in one column of the gridview tied
to another. For example, for the grid representing the ingredients
used in a recipe, the second last column will be a number representing
a quantity and the last column will be units of measure such as grams,
kilograms, ounces, pounds, teaspoons, table spoons, &c. Of course, the
number of possible units is limited, and should be selected from a
combo box rather than entered by the user typing (with all the related
potential sources of error such as typos). But to make things more
interesting, I want to give the user the option of selecting what
system of units (cgs, SI, Imperial) will be used both for entering and
for viewing a recipe, by default but with the option of changing the
system of units used for a given recipe (so a user prefering to use
metric can enter a recipe provided in imperial units and have my
program automatically convert it to metric). After all, a person most
familiar with metric might have, for whatever reason, a cookbook in
which all recipes are provided with imperial units.
Like I said, it is trivially easy for me to get applications similar to
the examples I have found (both in the provided MS documentation and
the multitude of books I have bought) to work, but their extension to
situations like what I describe above is not obvious.
I had thought about doing most of this in code, but I want to know if
there is an easy way to accomplish this using Visual Studio 2005's form
designer before I start writing n-factorial parameterized SQL
statements or a function to create them at run time.
Pointers(URLS) to more useful examples of using ADO.NET2/3 would be
greatly appreciated.
Thanks
Ted