Snitz Forums 2000
Snitz Forums 2000
Home | Profile | Register | Active Topics | Members | Search | FAQ
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 Community Forums
 Community Discussions (All other subjects)
 A little SQL problem
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

thermal_seeker
Junior Member

United Kingdom
430 Posts

Posted - 19 February 2011 :  09:07:47  Show Profile  Reply with Quote
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


No good at coding, but I can plough a field !!

ruirib
Snitz Forums Admin

Portugal
26364 Posts

Posted - 19 February 2011 :  10:32:20  Show Profile  Send ruirib a Yahoo! Message  Reply with Quote
I guess you would need to create the SQL dinamically, considering the chosen values in the dropdowns.


Snitz 3.4 Readme | Like the support? Support Snitz too
Go to Top of Page

thermal_seeker
Junior Member

United Kingdom
430 Posts

Posted - 20 February 2011 :  04:39:34  Show Profile  Reply with Quote
Thanks Rui
That pointed me in the right direction

No good at coding, but I can plough a field !!
Go to Top of Page

ruirib
Snitz Forums Admin

Portugal
26364 Posts

Posted - 20 February 2011 :  05:56:46  Show Profile  Send ruirib a Yahoo! Message  Reply with Quote
Great .


Snitz 3.4 Readme | Like the support? Support Snitz too
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
Snitz Forums 2000 © 2000-2021 Snitz™ Communications Go To Top Of Page
This page was generated in 0.07 seconds. Powered By: Snitz Forums 2000 Version 3.4.07