473,385 Members | 1,769 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,385 software developers and data experts.

Debugging Immediate Window

Hey all,

when i'm in debug mode, is there a way to get to a certain record in a
dataset (say like in the Immediate window or something)?

thanks,
rodchar
Nov 21 '05 #1
7 5867

"rodchar" <ro*****@discussions.microsoft.com> wrote in message
news:A3**********************************@microsof t.com...
Hey all,

when i'm in debug mode, is there a way to get to a certain record in a
dataset (say like in the Immediate window or something)?

thanks,
rodchar


Yep. Asumming you've breakpointed your way into debug mode at the scope of the datset is such that
it is "alive" when your break point is hit you can use the Immediate window to :

? MyDataset.Tables.Count

...... you can do anything you like here

Note the ? is very imkportant as it asks a question which returns a result. You can also make
assignment by dropping the ?.

MyDataset.Tables(0).Rows(0)(1) = "Assign value"

hth
Richard
Nov 21 '05 #2
This will return the datarow in the command window
?me.dsFleet.Tables(0).Rows(0) ' first table, firstrow

To return the datacolumn
?me.dsFleet.Tables("Customers").Rows(2)("Address") ' customer table, third
row, address datacolumn

--
Walt Ritscher
www.waltritscher.com\blogs
www.scandiasoft.com
yahoo email account is a spam trap - I will not reply to any mail sent to
this address.
"rodchar" <ro*****@discussions.microsoft.com> wrote in message
news:A3**********************************@microsof t.com...
Hey all,

when i'm in debug mode, is there a way to get to a certain record in a
dataset (say like in the Immediate window or something)?

thanks,
rodchar

Nov 21 '05 #3
Richard Myers wrote:
? MyDataset.Tables.Count

..... you can do anything you like here

Note the ? is very imkportant as it asks a question which returns a result. You can also make
assignment by dropping the ?.


Note that the use of a question mark to get the Basic language to print
something goes back to the late 1970's. If you entered "?" in your Quick
Basic program, it would be converted to "PRINT" automatically.

--
Ken Halter - MS-MVP-VB - http://www.vbsight.com
Please keep all discussions in the groups..
Nov 21 '05 #4
> Note that the use of a question mark to get the Basic language to print
something goes back to the late 1970's. If you entered "?" in your Quick
Basic program, it would be converted to "PRINT" automatically.


Now thats legacy code!
I wonder if "?" still wears flares?

Nov 21 '05 #5
But what if I didn't know what the record number was. Let's say in a dataset
of 500 records I want to look at a record where a field = a specific value.
Kinda like, querying it in debug mode, is that possible?

"rodchar" wrote:
Hey all,

when i'm in debug mode, is there a way to get to a certain record in a
dataset (say like in the Immediate window or something)?

thanks,
rodchar

Nov 21 '05 #6
Awesome, thank you.

"Richard Myers" wrote:

"rodchar" <ro*****@discussions.microsoft.com> wrote in message
news:22**********************************@microsof t.com...
But what if I didn't know what the record number was. Let's say in a dataset
of 500 records I want to look at a record where a field = a specific value.
Kinda like, querying it in debug mode, is that possible?


? MyDataset.MyTable.Select("CustomerId=5").Length

Will give the number of rows satifying the filter condition.

If you want to display the row

? MyDataset.MyTable.Select("CustomerId=5")(0)

Would return the first rowin the array of return rows that satisfied the criteria of the filter
condition. If you are using a untyped dataset you will get a bunch of lines about

Item: <cannot view indexed property>

so you will have to further refine your search

? MyDataset.MyTable.Select("CustomerId=5")(0)("My Property")

If you are using typed datasets your own version of the query below should pull up enough info to be
of use

? ctype(_customers.Customer.Select("CustomerId=90004 ")(0), dsCustomer.CustomerRow)

Here i am querying the Customer table in a dataset called _customer which is of type dsCustomer for
all rows which have a customerId of 90004. This will return an array of datarows;of which i am
casting the first from the base type of datarow as returned by the select method to the strongly
typed dsCustomer.CustomerRow:

Assumming a row matching this criteria is found the immediate window will return a list of field
values for this particular row:

{dsCustomer.CustomerRow}
AKey: "fffffff"
CustomerId: 90004
DCity: <error: an exception of type: {System.Data.StrongTypingException} occurred>
DCountry: <error: an exception of type: {System.Data.StrongTypingException} occurred>
DStateRegion: <error: an exception of type: {System.Data.StrongTypingException} occurred>
DStreet1: <error: an exception of type: {System.Data.StrongTypingException} occurred>
DStreet2: <error: an exception of type: {System.Data.StrongTypingException} occurred>
DSuburb: <error: an exception of type: {System.Data.StrongTypingException} occurred>
DZipcode: <error: an exception of type: {System.Data.StrongTypingException} occurred>
Email: <error: an exception of type: {System.Data.StrongTypingException} occurred>
Fax: <error: an exception of type: {System.Data.StrongTypingException} occurred>
HasErrors: False
Item: <cannot view indexed property>
Item: <cannot view indexed property>
Item: <cannot view indexed property>
Item: <cannot view indexed property>
ItemArray: {Length=26}
Name: "Rodger Bannister"
PCity: <error: an exception of type: {System.Data.StrongTypingException} occurred>
PCountry: <error: an exception of type: {System.Data.StrongTypingException} occurred>
Phone1: "021 240 7444"
Phone2: <error: an exception of type: {System.Data.StrongTypingException} occurred>
PhoneFree: <error: an exception of type: {System.Data.StrongTypingException} occurred>
PStateRegion: <error: an exception of type: {System.Data.StrongTypingException} occurred>
PStreet1: <error: an exception of type: {System.Data.StrongTypingException} occurred>
PStreet2: <error: an exception of type: {System.Data.StrongTypingException} occurred>
PSuburb: <error: an exception of type: {System.Data.StrongTypingException} occurred>
PZipcode: <error: an exception of type: {System.Data.StrongTypingException} occurred>
RowError: ""
RowState: Unchanged
SalesCallStatus: 4
SalesRoute: 2
SalesTerritoryId: 3
Table: {dsCustomer.CustomerDataTable}
Website: <error: an exception of type: {System.Data.StrongTypingException} occurred>
Anything like <error: an exception of type: {System.Data.StrongTypingException} occurred> generally
means that the strongly typed dataset contains a value of Null for that field.

hth
Richard

Nov 21 '05 #7
Awesome, thank you.

"Richard Myers" wrote:

"rodchar" <ro*****@discussions.microsoft.com> wrote in message
news:22**********************************@microsof t.com...
But what if I didn't know what the record number was. Let's say in a dataset
of 500 records I want to look at a record where a field = a specific value.
Kinda like, querying it in debug mode, is that possible?


? MyDataset.MyTable.Select("CustomerId=5").Length

Will give the number of rows satifying the filter condition.

If you want to display the row

? MyDataset.MyTable.Select("CustomerId=5")(0)

Would return the first rowin the array of return rows that satisfied the criteria of the filter
condition. If you are using a untyped dataset you will get a bunch of lines about

Item: <cannot view indexed property>

so you will have to further refine your search

? MyDataset.MyTable.Select("CustomerId=5")(0)("My Property")

If you are using typed datasets your own version of the query below should pull up enough info to be
of use

? ctype(_customers.Customer.Select("CustomerId=90004 ")(0), dsCustomer.CustomerRow)

Here i am querying the Customer table in a dataset called _customer which is of type dsCustomer for
all rows which have a customerId of 90004. This will return an array of datarows;of which i am
casting the first from the base type of datarow as returned by the select method to the strongly
typed dsCustomer.CustomerRow:

Assumming a row matching this criteria is found the immediate window will return a list of field
values for this particular row:

{dsCustomer.CustomerRow}
AKey: "fffffff"
CustomerId: 90004
DCity: <error: an exception of type: {System.Data.StrongTypingException} occurred>
DCountry: <error: an exception of type: {System.Data.StrongTypingException} occurred>
DStateRegion: <error: an exception of type: {System.Data.StrongTypingException} occurred>
DStreet1: <error: an exception of type: {System.Data.StrongTypingException} occurred>
DStreet2: <error: an exception of type: {System.Data.StrongTypingException} occurred>
DSuburb: <error: an exception of type: {System.Data.StrongTypingException} occurred>
DZipcode: <error: an exception of type: {System.Data.StrongTypingException} occurred>
Email: <error: an exception of type: {System.Data.StrongTypingException} occurred>
Fax: <error: an exception of type: {System.Data.StrongTypingException} occurred>
HasErrors: False
Item: <cannot view indexed property>
Item: <cannot view indexed property>
Item: <cannot view indexed property>
Item: <cannot view indexed property>
ItemArray: {Length=26}
Name: "Rodger Bannister"
PCity: <error: an exception of type: {System.Data.StrongTypingException} occurred>
PCountry: <error: an exception of type: {System.Data.StrongTypingException} occurred>
Phone1: "021 240 7444"
Phone2: <error: an exception of type: {System.Data.StrongTypingException} occurred>
PhoneFree: <error: an exception of type: {System.Data.StrongTypingException} occurred>
PStateRegion: <error: an exception of type: {System.Data.StrongTypingException} occurred>
PStreet1: <error: an exception of type: {System.Data.StrongTypingException} occurred>
PStreet2: <error: an exception of type: {System.Data.StrongTypingException} occurred>
PSuburb: <error: an exception of type: {System.Data.StrongTypingException} occurred>
PZipcode: <error: an exception of type: {System.Data.StrongTypingException} occurred>
RowError: ""
RowState: Unchanged
SalesCallStatus: 4
SalesRoute: 2
SalesTerritoryId: 3
Table: {dsCustomer.CustomerDataTable}
Website: <error: an exception of type: {System.Data.StrongTypingException} occurred>
Anything like <error: an exception of type: {System.Data.StrongTypingException} occurred> generally
means that the strongly typed dataset contains a value of Null for that field.

hth
Richard

Nov 21 '05 #8

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: Dave | last post by:
Hi everyone, (I already posted this to the VS.NET IDE news group without any responses, so I'm attempting one more time in this group) The issue I'm having is occuring in the IDE of VS.NET...
0
by: rodchar | last post by:
hey all, forgive me i'm a normally a new vb.net developer but i found some c# code i'd like to debug and learn about. is the debugging different in anyway because when an object get instatiated...
15
by: Darren Gulliver | last post by:
In VB6 you could change your code while in debug. But in VB.NET I'm told it is read only can this be changed? A bit annoying if you have to keep stopping the app to make your changes then start it...
2
by: James | last post by:
I start my ASP.NET application with Debugging. I set a breakpoint for a certain line that references a DataTable. I open the immediate window and do: ? dt.Rows.Count This used to work, now...
23
by: keyser_Soze | last post by:
I have MS Visual Studio 2003 on Windows XP Pro. I have IIS running on this machine and I am trying to debug some existing code which has both ASP and ASP.NET components. When I try and launch...
3
by: jsh02_nova | last post by:
During debugging a console application using my Visual Studio, I have an instance of a string reference type that I want to watch. When I check the value of a property for that instance, such as...
4
by: cj | last post by:
I run my programs with F5. I can use F11 to step through them. But, if it moves to another class or something suddenly it just runs w/o asking or telling me. I want it to continue making me...
5
by: rn5a | last post by:
Can someone please suggest me a text editor especially for DEBUGGING ASP scripts apart from Microsoft Visual Interdev? I tried using Visual Interdev & created a project but Interdev generates...
0
by: Armin Zingler | last post by:
Hi, as I did not get a response in the vstudio group, I try it here: My problem is that I don't know how to display values while debugging a managed application. The Exe was written in VB 2008...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
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
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...

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.