Snitz Forums 2000
Snitz Forums 2000
Home | Profile | Register | Active Topics | Members | Search | FAQ
 All Forums
 Community Forums
 Community Discussions (All other subjects)
 A little SQL problem

Note: You must be registered in order to post a reply.
To register, click here. Registration is FREE!
Before posting, make sure you have read this topic!

Screensize:
UserName:
Password:
Format Mode:
Format: BoldItalicizedUnderlineStrikethrough Align LeftCenteredAlign Right Horizontal Rule Insert HyperlinkInsert EmailInsert Image Insert CodeInsert QuoteInsert List
   
Message:

* HTML is OFF
* Forum Code is ON
Smilies
Smile [:)] Big Smile [:D] Cool [8D] Blush [:I]
Tongue [:P] Evil [):] Wink [;)] Clown [:o)]
Black Eye [B)] Eight Ball [8] Frown [:(] Shy [8)]
Shocked [:0] Angry [:(!] Dead [xx(] Sleepy [|)]
Kisses [:X] Approve [^] Disapprove [V] Question [?]

 
   

T O P I C    R E V I E W
thermal_seeker Posted - 19 February 2011 : 09:07:47
MS SQL 2005 DB
I have created a form that is partially filled by bringing in data from another table.

The Username dropdown decides which table the data should go into and the other dropdown boxes are the columns in that table. Obviously I cant have the columns named because when the username dropdown is changed the other dropdowns are re-populated with different data.

Is it possible to have the columns linked to the results of the dropdowm boxes??


PiggieWeightsDataSource.InsertCommand = String.Format("INSERT INTO {0} (freddie, bertie, gertie) VALUES(@freddie, @bertie, @gertie)", UNDropDown.SelectedItem.Text)


PiggieWeightsDataSource.InsertParameters.Add("freddie", P0TB.Text)
PiggieWeightsDataSource.InsertParameters.Add("bertie", P1TB.Text)
PiggieWeightsDataSource.InsertParameters.Add("gertie", P2TB.Text)



ie. "freddie" is the result of the selected text from dropdown box 2

bertie is the result of dropdown box 3

etc

Dave

3   L A T E S T    R E P L I E S    (Newest First)
ruirib Posted - 20 February 2011 : 05:56:46
Great .
thermal_seeker Posted - 20 February 2011 : 04:39:34
Thanks Rui
That pointed me in the right direction
ruirib Posted - 19 February 2011 : 10:32:20
I guess you would need to create the SQL dinamically, considering the chosen values in the dropdowns.

Snitz Forums 2000 © 2000-2021 Snitz™ Communications Go To Top Of Page
This page was generated in 0.02 seconds. Powered By: Snitz Forums 2000 Version 3.4.07