Reading a result from a database to a string

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • DaveRook
    New Member
    • Jul 2007
    • 147

    Reading a result from a database to a string

    Hello

    2 quick questions

    I have a database (SQLExpress) to populate my web page with some products.

    Some times, I want to perform an if else function to the result (which seems to be very difficult in asp.net for some reason - compared to asp.classic).

    The code works fine

    Code:
    string PN = (Convert.ToString(ds.Tables["B2B"].Rows[0]["PartNumber"]));
    Is there a better way to do this? Or is this the correct way?


    Second question is:
    Code:
    ds.Tables["B2B"].Rows.Count;
    also works. Please correct my terminology but the ds parameters(?) Tables, Rows and Count all belong to ds. How does any one know this? How would I know what else I can use with ds? I have viewed the microsoft website to try to work out what I can and can't apply and have gotten no where! Is there a site which says if you use XX, then you can use the following parameters...

    Thanks

    Dave
  • tlhintoq
    Recognized Expert Specialist
    • Mar 2008
    • 3532

    #2
    Second question:
    Please correct my terminology but the ds parameters(?) Tables, Rows and Count all belong to ds. How does any one know this? How would I know what else I can use with ds?
    As you type, IntelliSense inside Visual Studio will show you a popup menu of such things. As soon as you type the period in ds. a menu should appear showing the properties and methods available at that point

    Comment

    Working...