473,499 Members | 1,562 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

problems with Update form with drop down list Submit button

5 New Member
Hi all,
I was wondering if someone could help me solve this problem,
I have created a form which is supposed to do a simple update,
these are my fields
ProductId.text
ItemName.Text
ItemPrice.Text
OrderUnitCost.Text
OrderUnitSize.Text
QuantityOnHand.Text
ReorderLevel.Text
ReStockCharge.text
category (for category i have a dropwonlist) and a text box to be able to add a new Category.
for my save button I have the following:
Protected Sub SaveProduct_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles SaveProduct.Click

If ValidData() = True Then
Dim systemmgr As New eRaceSystem.eRace
Dim Categorylistinfo As DataSet
Dim theCategory As String

If Category.Text.Trim.Length > 0 Then
theCategory = Category.Text.Trim
Else
theCategory = CategoryList.SelectedValue
End If
Try
systemmgr.UpdateProduct(ProductId.Text, ItemName.Text, ItemPrice.Text, OrderUnitCost.Text, _
OrderUnitSize.Text, QuantityOnHand.Text, ReorderLevel.Text, ReStockCharge.Text, Category.selectedvalue)----this keeps telling that selected value isnot a member of systems.ui.webcontrols. textbox------
iknow if i only had my drop down list I could just have category.selectedvalue, but i dont know why i get this error----- I would really apreciate some help.
FormMessages.Text = "Product Updated."
Catch ex As Exception
FormMessages.Text = ex.Message
End Try
End If
End Sub

thanks
nueva
Oct 10 '07 #1
5 1288
Shashi Sadasivan
1,435 Recognized Expert Top Contributor
Hi all,
I was wondering if someone could help me solve this problem,
I have created a form which is supposed to do a simple update,
these are my fields
Expand|Select|Wrap|Line Numbers
  1. ProductId.text 
  2. ItemName.Text 
  3. ItemPrice.Text 
  4. OrderUnitCost.Text 
  5. OrderUnitSize.Text 
  6. QuantityOnHand.Text 
  7. ReorderLevel.Text 
  8. ReStockCharge.text
  9. 'category (for category i have a dropwonlist) and a text box to be able to 'add a new Category.
  10. 'for my save button I have the following:
  11. Protected Sub SaveProduct_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles SaveProduct.Click
  12.  
  13. If ValidData() = True Then
  14. Dim systemmgr As New eRaceSystem.eRace
  15. Dim Categorylistinfo As DataSet
  16. Dim theCategory As String
  17.  
  18. If Category.Text.Trim.Length > 0 Then
  19. theCategory = Category.Text.Trim
  20. Else
  21. theCategory = CategoryList.SelectedValue
  22. End If
  23. Try
  24. systemmgr.UpdateProduct(ProductId.Text, ItemName.Text, ItemPrice.Text, OrderUnitCost.Text, _
  25. OrderUnitSize.Text, QuantityOnHand.Text, ReorderLevel.Text, ReStockCharge.Text, Category.selectedvalue)'----this keeps telling that 'selected value isnot a member of systems.ui.webcontrols. textbox------
  26. 'iknow if i only had my drop down list I could just have 'category.selectedvalue, but i dont know why i get this error----- I would 'really apreciate some help.
  27. FormMessages.Text = "Product Updated."
  28. Catch ex As Exception
  29. FormMessages.Text = ex.Message
  30. End Try
  31. End If
  32. End Sub
  33.  
thanks
nueva
For starters, Please put your code in CODE tags so that we can spend less time decyphering the visual appearance of your code. :)

Is category a dropdown list or a text box?
Because i see you have a categoryList and a category.
It seems your categoryList is the dropdown and category is a text box.
a text box doest not have a selectedValue member

cheers
Oct 10 '07 #2
nuevaenvb
5 New Member
Hi
Sorry I should have done that first, and yes category is a text box, but i also have a drop down which is category list.



For starters, Please put your code in CODE tags so that we can spend less time decyphering the visual appearance of your code. :)

Is category a dropdown list or a text box?
Because i see you have a categoryList and a category.
It seems your categoryList is the dropdown and category is a text box.
a text box doest not have a selectedValue member

cheers
Oct 10 '07 #3
Shashi Sadasivan
1,435 Recognized Expert Top Contributor
Well,, I dont think you got my point from the previous post

Expand|Select|Wrap|Line Numbers
  1.  theCategory = Category 
  2. Else
  3. theCategory = CategoryList.SelectedValue
  4.  
From your code(in the update statement)....Category.SelectedValue is an invalid syntax. Intellisense should tell you that.
So iin your update statement change it to Category.Text
Oct 10 '07 #4
nuevaenvb
5 New Member
ok, thanks.
catepory.text doesnt work for some reason. I will try to figure out, thanks for looking into it.
Oct 10 '07 #5
Shashi Sadasivan
1,435 Recognized Expert Top Contributor
Good luck,

Try using the debugging feature on why it isint working,
Something that will make you find it out faster
Oct 10 '07 #6

Sign in to post your reply or Sign up for a free account.

Similar topics

6
1831
by: Flos | last post by:
Hello! (sorry for my bad english) the following problem: i have i site where one must enter data which is safed in a database. There are also drop down lists, which values are database...
4
4272
by: Eric | last post by:
Hey Everyone.. I have a form that has approximately 7 text fields and 1 checkbox. Generally when this form is submitted(to itself BTW) it works fine, however, when the checkbox is only field...
7
2299
by: jason | last post by:
Is there a way - possibly a disconnected rs? - to update the contents of an existing pulldown on a page without having to re-submit the page for the user to see the pulldown populated with an...
3
3124
by: daveland | last post by:
I am working on some JavaScript that dynamically adds rows to a table in response to a button click. A new row does appear on the screen when the button is clicked. However, that table to which a...
1
10162
by: Ian Davies | last post by:
Hello In a php file I have a drop down list with index numbers in whos default value is feed into an sql query that filters records from my database and displays them in an html table. Trouble...
2
8893
by: Wes Weems | last post by:
I'd like to have a 3 values in a drop down, and have a validator not allow a form submit unless its 2 of the 3 values (eg, one of the values says "select one") I used custom validator and did a...
4
2604
by: Greg Scharlemann | last post by:
I'm trying to setup a dyamic dropdown list that displays a number of text fields based on the selected number in the dropdown. The problem I am running into is capturing the data already entered...
4
1736
by: gihope | last post by:
Hi, I have an ASP.NET 2.0 C# issue that has been troubling me for some time, and if someone could shed some light on this I would appreciate it. This seems to be a commonly themed question,...
1
1844
by: bdbeames | last post by:
I have a page with google maps up and running. When a user clicks on a location from the map I would like to populate a drop down with data from the database related to that location. I have it up...
0
7007
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
7171
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
7220
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
7386
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
5468
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
4599
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
3090
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1427
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
1
664
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.