473,320 Members | 1,872 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

Reading a result from a database to a string

147 100+
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

Expand|Select|Wrap|Line Numbers
  1. 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:
Expand|Select|Wrap|Line Numbers
  1. 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
Feb 22 '10 #1
1 1025
tlhintoq
3,525 Expert 2GB
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


Feb 22 '10 #2

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

Similar topics

5
by: Dariusz | last post by:
I have PHP code (below) which reads data from a MySQL format database. The problem I am having is trying to find out when the last ID entry was made. When the script is executed, the $gbID is...
2
by: Dariusz | last post by:
Below is part of a code I have for a database. While the database table is created correctly (if it doesn't exist), and data is input correctly into the database when executed, I have a problem...
3
by: Johan Vervoort | last post by:
How can I read a binary value from a blob via ODBC (Microsoft VFP driver-win32all)? The value seems to be truncated at the first '\0' TIA
1
by: fabrice | last post by:
Hello, I've got trouble reading a text file (event viewer dump) by using the getline() function... After 200 - 300 lines that are read correctly, it suddenly stops reading the rest of the...
1
by: Ldaled | last post by:
Okay, I had a previous post called reading an XML document. Since this post I have revised my code and got it to work. Now, Like Derek had mentioned in answer to my previous post, I am getting an...
4
by: MLH | last post by:
It has been mentioned that a ghosted machine or a machine linked by cable modem and USB may result in my reading a MAC address other than one burned onto a NIC in the machine. That being the case,...
2
by: Joe | last post by:
Anyone can suggest the best method of reading XML and adding data to ListView? Here is the xml data structure:: <xml> <site> <url>http://www.yahoo.com</url> <lastupdate></lastupdate>...
7
by: ianenis.tiryaki | last post by:
well i got this assignment which i dont even have a clue what i am supposed to do. it is about reading me data from the file and load them into a parallel array here is the question: Step (1) ...
4
by: Shark | last post by:
Hi, I need a help. My application reads data from COM port, this data is then parsed and displyed on: 1. two plotters 2. text box. I'm using Invoke method to update UI when new data is...
6
by: jcasique.torres | last post by:
Hi everyboy. I trying to create a C promang in an AIX System to read JPG files but when it read just the first 4 bytes when it found a DLE character (^P) doesn't read anymore. I using fread...
0
by: DolphinDB | last post by:
The formulas of 101 quantitative trading alphas used by WorldQuant were presented in the paper 101 Formulaic Alphas. However, some formulas are complex, leading to challenges in calculation. Take...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
0
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

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.