473,545 Members | 2,051 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 5879

"rodchar" <ro*****@discus sions.microsoft .com> wrote in message
news:A3******** *************** ***********@mic rosoft.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.Table s.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.Table s(0).Rows(0)(1) = "Assign value"

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

To return the datacolumn
?me.dsFleet.Tab les("Customers" ).Rows(2)("Addr ess") ' 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*****@discus sions.microsoft .com> wrote in message
news:A3******** *************** ***********@mic rosoft.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.Table s.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*****@discus sions.microsoft .com> wrote in message
news:22******** *************** ***********@mic rosoft.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.MyTab le.Select("Cust omerId=5").Leng th

Will give the number of rows satifying the filter condition.

If you want to display the row

? MyDataset.MyTab le.Select("Cust omerId=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.MyTab le.Select("Cust omerId=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(_customer s.Customer.Sele ct("CustomerId= 90004")(0), dsCustomer.Cust omerRow)

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.Cust omerRow:

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

{dsCustomer.Cus tomerRow}
AKey: "fffffff"
CustomerId: 90004
DCity: <error: an exception of type: {System.Data.St rongTypingExcep tion} occurred>
DCountry: <error: an exception of type: {System.Data.St rongTypingExcep tion} occurred>
DStateRegion: <error: an exception of type: {System.Data.St rongTypingExcep tion} occurred>
DStreet1: <error: an exception of type: {System.Data.St rongTypingExcep tion} occurred>
DStreet2: <error: an exception of type: {System.Data.St rongTypingExcep tion} occurred>
DSuburb: <error: an exception of type: {System.Data.St rongTypingExcep tion} occurred>
DZipcode: <error: an exception of type: {System.Data.St rongTypingExcep tion} occurred>
Email: <error: an exception of type: {System.Data.St rongTypingExcep tion} occurred>
Fax: <error: an exception of type: {System.Data.St rongTypingExcep tion} 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.St rongTypingExcep tion} occurred>
PCountry: <error: an exception of type: {System.Data.St rongTypingExcep tion} occurred>
Phone1: "021 240 7444"
Phone2: <error: an exception of type: {System.Data.St rongTypingExcep tion} occurred>
PhoneFree: <error: an exception of type: {System.Data.St rongTypingExcep tion} occurred>
PStateRegion: <error: an exception of type: {System.Data.St rongTypingExcep tion} occurred>
PStreet1: <error: an exception of type: {System.Data.St rongTypingExcep tion} occurred>
PStreet2: <error: an exception of type: {System.Data.St rongTypingExcep tion} occurred>
PSuburb: <error: an exception of type: {System.Data.St rongTypingExcep tion} occurred>
PZipcode: <error: an exception of type: {System.Data.St rongTypingExcep tion} occurred>
RowError: ""
RowState: Unchanged
SalesCallStatus : 4
SalesRoute: 2
SalesTerritoryI d: 3
Table: {dsCustomer.Cus tomerDataTable}
Website: <error: an exception of type: {System.Data.St rongTypingExcep tion} occurred>
Anything like <error: an exception of type: {System.Data.St rongTypingExcep tion} 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*****@discus sions.microsoft .com> wrote in message
news:22******** *************** ***********@mic rosoft.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.MyTab le.Select("Cust omerId=5").Leng th

Will give the number of rows satifying the filter condition.

If you want to display the row

? MyDataset.MyTab le.Select("Cust omerId=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.MyTab le.Select("Cust omerId=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(_customer s.Customer.Sele ct("CustomerId= 90004")(0), dsCustomer.Cust omerRow)

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.Cust omerRow:

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

{dsCustomer.Cus tomerRow}
AKey: "fffffff"
CustomerId: 90004
DCity: <error: an exception of type: {System.Data.St rongTypingExcep tion} occurred>
DCountry: <error: an exception of type: {System.Data.St rongTypingExcep tion} occurred>
DStateRegion: <error: an exception of type: {System.Data.St rongTypingExcep tion} occurred>
DStreet1: <error: an exception of type: {System.Data.St rongTypingExcep tion} occurred>
DStreet2: <error: an exception of type: {System.Data.St rongTypingExcep tion} occurred>
DSuburb: <error: an exception of type: {System.Data.St rongTypingExcep tion} occurred>
DZipcode: <error: an exception of type: {System.Data.St rongTypingExcep tion} occurred>
Email: <error: an exception of type: {System.Data.St rongTypingExcep tion} occurred>
Fax: <error: an exception of type: {System.Data.St rongTypingExcep tion} 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.St rongTypingExcep tion} occurred>
PCountry: <error: an exception of type: {System.Data.St rongTypingExcep tion} occurred>
Phone1: "021 240 7444"
Phone2: <error: an exception of type: {System.Data.St rongTypingExcep tion} occurred>
PhoneFree: <error: an exception of type: {System.Data.St rongTypingExcep tion} occurred>
PStateRegion: <error: an exception of type: {System.Data.St rongTypingExcep tion} occurred>
PStreet1: <error: an exception of type: {System.Data.St rongTypingExcep tion} occurred>
PStreet2: <error: an exception of type: {System.Data.St rongTypingExcep tion} occurred>
PSuburb: <error: an exception of type: {System.Data.St rongTypingExcep tion} occurred>
PZipcode: <error: an exception of type: {System.Data.St rongTypingExcep tion} occurred>
RowError: ""
RowState: Unchanged
SalesCallStatus : 4
SalesRoute: 2
SalesTerritoryI d: 3
Table: {dsCustomer.Cus tomerDataTable}
Website: <error: an exception of type: {System.Data.St rongTypingExcep tion} occurred>
Anything like <error: an exception of type: {System.Data.St rongTypingExcep tion} 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
1849
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 2003, although I'm not sure what is actually causing the problem. I can't summarize the issue, so please read on to find out more. I've created a...
0
1077
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 i see it in the debugging window as an instance, but when i use the Immediate window it doesn't notice any properties or methods for that object. ...
15
1621
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 up again to see if it works. Regards Darren
2
1188
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 I get: "Run-time exception thrown : System.ArgumentException - Cannot find the method on the object instance."
23
3174
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 the debugger from VS, I am told it can't because the project is of output type class library. The error indicates I should set the start action to...
3
1429
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 'string.Substring(7)' by typing it in the command window I get the 'error: 'string.Substring' does not exist' message. What setting do have to change...
4
1114
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 press F11. Any advice? Also at the bottom of the IDE are Index Results, Command Window, and Output windows. I get the command window and output...
5
2793
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 some error related to FrontPage extensions. I couldn't exactly understand the error. I tried to create the project in C: \Inetpub\wwwroot. If I just...
0
1114
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 Express. As the Express version neither has a Threads window nor a Disassembly window, I use VC++ to debug the application. Only in this particular...
0
7475
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main...
0
7664
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. ...
1
7436
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For...
0
7766
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the...
0
5981
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
0
4958
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 then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert...
0
3463
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in...
1
1897
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 we have to send another system
0
715
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating...

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.