User Name
Password

Go Back   Planetarion Forums > Non Planetarion Discussions > Programming and Discussion

Reply
Thread Tools Display Modes
Unread 26 Oct 2006, 17:06   #1
Squidly
Avenger of Calamari
 
Squidly's Avatar
 
Join Date: Aug 2003
Location: Alberta, Canada
Posts: 939
Squidly is a pillar of this Internet societySquidly is a pillar of this Internet societySquidly is a pillar of this Internet societySquidly is a pillar of this Internet societySquidly is a pillar of this Internet societySquidly is a pillar of this Internet societySquidly is a pillar of this Internet societySquidly is a pillar of this Internet societySquidly is a pillar of this Internet societySquidly is a pillar of this Internet societySquidly is a pillar of this Internet society
[C#] Generic datasets vs drag/drop on form

Well. Damn. I know how to use generic datasets defined and filled in my normal code, but here's the situation.

Using VS 2005.

I have 4 combo boxes in a column down the page.
One dataset that has 5 tables.

Quote:
family: ---

department: ---

category: ---

subcategory: ---


PRODUCTS DATAGRID GOES HERE
I need to find a way to link my dropdown menus, and datagrid, so that when one dropdown option is changed, everything below it updates and changes as well. Using generic datasets, and index-changed event handlers will result in much frusteration, circular logic, and squidly jumping out of several windows.

there's a dataset item I'm supposed to use in the toolbox, but I haven't the foggiest how to use it to accomplish what I'm looking for.

Anyone know wtf I should be doing? :/
Squidly is offline   Reply With Quote
Unread 28 Oct 2006, 19:06   #2
Raging.Retard
Street Tramp
 
Raging.Retard's Avatar
 
Join Date: Apr 2000
Location: Street Gutter
Posts: 341
Raging.Retard has a brilliant futureRaging.Retard has a brilliant futureRaging.Retard has a brilliant futureRaging.Retard has a brilliant futureRaging.Retard has a brilliant futureRaging.Retard has a brilliant futureRaging.Retard has a brilliant futureRaging.Retard has a brilliant futureRaging.Retard has a brilliant futureRaging.Retard has a brilliant futureRaging.Retard has a brilliant future
Re: [C#] Generic datasets vs drag/drop on form

Careful of your terminology. By "generic dataset" are you referring to a bog-standard framework dataset (which I think is the case)? Or an actual generic dataset ... some kind of dataset based around Systems.Collections.Generic. Since .Net 2... "Generics" are the means to achieve parameterised types / parametric polymorphism, so careful how you word things.

Why will index changed event handlers result in frustration and circular logic? I don't see why that is the case. Of course, I don't know how these items are related so perhaps you could shed some light on that. Doing it that way would make the most sense to me.
__________________
Chimney Pots.
Raging.Retard is offline   Reply With Quote
Unread 30 Oct 2006, 16:48   #3
Squidly
Avenger of Calamari
 
Squidly's Avatar
 
Join Date: Aug 2003
Location: Alberta, Canada
Posts: 939
Squidly is a pillar of this Internet societySquidly is a pillar of this Internet societySquidly is a pillar of this Internet societySquidly is a pillar of this Internet societySquidly is a pillar of this Internet societySquidly is a pillar of this Internet societySquidly is a pillar of this Internet societySquidly is a pillar of this Internet societySquidly is a pillar of this Internet societySquidly is a pillar of this Internet societySquidly is a pillar of this Internet society
Re: [C#] Generic datasets vs drag/drop on form

Alrighty!

Well, I figured it out eventually, but I shalt explain! There was some pain with those handlers, as when my dropdown boxes populated, that counted as a change event. This caused said events to fire. When they fired, there was some relations established between each of the boxes, so that when one changed, anything below it changed as well to match the necessary category showings.

Normally, this would be a good thing [very good thing ] but since not all of the DDlists had populated yet, this resulted in a nasty set of null errors coming up right at the start. This was eventually fixed by putting the initial populating of the datagrid into a segment of code that had all of the indexchanged event handlers nullified for the moment.

famCombo.SelectedIndexChanged -= somethingsomething {sender e, }

and I will edit that one bit a little bit later once I can pull the code onto this machine and give correct syntax and whatnot

after the populating was done, I ended up using the above line, but with a += instead. This allowed all of the resulting event handlers that should have fired... to fire. This was a good thing, as everything became what it should be!

As for the question on datasets... I was referring to the generic dataset used when not specifying a physical datasource {IE through the menu up top visual studio} and thus not using the adapter that resulted. I usually code my own in the form of:

SqlConnection dbConn = new SqlConnection(connString); {connString is a variable in a global module}

sqlDbAdapter dbAdapter = new SqlAdapter("exec LoadProductData ", dbConn);

DataSet ds = new DataSet();

ds.Fill(ds);

return ds;

This results in me having one dataset, with 5 tables in it. What I was worried about in terms of logic was having to do a lot of foreach row... if the itemsubcategory = "example1" then show. If not, then don't. Apparently .rowfilter works wonders, but I was not aware of that particular function at the time of posting the original note.

At least my lab is done now
Squidly is offline   Reply With Quote
Reply


Thread Tools
Display Modes

Forum Jump


All times are GMT +1. The time now is 16:37.


Powered by vBulletin® Version 3.8.1
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2002 - 2018