locked
populating data on postback RRS feed

  • Question

  • Hi

    I would like to know if i had two columns from a database called SellerID and Product letter in a table called product, and on a new form i want to be able to combine the columns i.e if the user enters the sellerId and product ID e.g 1A in a SellerProductID in a new table on a new for i want the program to do a postback and have the Description Field be populated with the data from the Products ID

    Therefore the SellerID + Product letter = SellerProductID and it should select the description in the description field.

    Please could someone help.


    Regards Ismail

    Friday, June 8, 2012 6:56 AM

Answers

  • You are saying "form" and "postback" so I'm not sure if this is a Windows Forms application (if so, what do you mean by postback? the user clicks a button?) or an ASP.Net application (which has Pages and postbacks, but isn't covered on these forums).

    It sounds like you need to parse the selected SellerProductID into its two parts - SellerID and ProductLetter, and then pass the ProductLetter to a query that retrieves the Description.

    If the SellerProductID always ends with 1 letter, then you can split it pretty easily:

    SellerID = SellerProductID.SubString(0, SellerProductID.Length - 1)

    ProductLetter = SellerProductID.SubString(SellerProductID.Length - 1)


    Reed Kimble - "When you do things right, people won't be sure you've done anything at all"

    Monday, June 11, 2012 11:09 PM
    Moderator

All replies

  • Hello,

    The product letter and Products ID in your post are the same? I think you just need to divide SellerProductID and get the Products ID then get its description. Moreover, please add some marks in your post since it's quite hard for a poor English man to read like me.

    Cheers!

    Monday, June 11, 2012 8:48 AM
  • You are saying "form" and "postback" so I'm not sure if this is a Windows Forms application (if so, what do you mean by postback? the user clicks a button?) or an ASP.Net application (which has Pages and postbacks, but isn't covered on these forums).

    It sounds like you need to parse the selected SellerProductID into its two parts - SellerID and ProductLetter, and then pass the ProductLetter to a query that retrieves the Description.

    If the SellerProductID always ends with 1 letter, then you can split it pretty easily:

    SellerID = SellerProductID.SubString(0, SellerProductID.Length - 1)

    ProductLetter = SellerProductID.SubString(SellerProductID.Length - 1)


    Reed Kimble - "When you do things right, people won't be sure you've done anything at all"

    Monday, June 11, 2012 11:09 PM
    Moderator