| How can I check if a node is an hashtable or Directory |
|
 |
Index ‹ Visual Studio Team System ‹ Visual Studio Code Analysis and Code Metrics
|
- Previous
- 1
- Visual Studio Team System - Database Professionals UI improvement - collapsable code regions
I use #region...#end region directives in Visal Studio quite alot. I like the ability to hide code so I can concentrate only on what I am working on.
It gave me two ideas for data-dude:
- In a script, hide queries in a script that I'm not currently working on. This is analogous to #region...#end region that I just talked about.
- Hide parts of a query that I'm not currently working on. I have a great use case for this: If I am using a derived table in a query and I am happy that that derived table is returning what I need then I don't to see that derived table anymore - I only need to see the alias. Similarly if I am using a CTE I don't need to see the body of the CTE, only its name. Comment regions could also be collapsed. I'm sure there are other use cases.
Do these sound like good ideas Is it worth my submitting them to Connect
I have to be honest, the second idea here would be especially nice to have. Its not unheard of for me to have queries that contain so many derived tables and are so long they disappear off the end of the screen - especially given that I like to put each column in my SELECT/GROUP BY/ORDER clause, each WHERE predicate , and each table in my FROM clause on a new line.
Actually that gives me another idea. How about being able to hide the whole of a SELECT/FROM/WHERE/ORDER/GROUP BY/HAVING clause so we only have to concentrate on one clause at a time
Comments THoughts
Regards
Jamie
- 2
- Visual Basic Express Edition Of Pictureboxes, Transparency, Movement and BackgroundsHi there,
I am trying to make a picturebox move over another in a program - one, a stationary red arrow, the other a moving green arrow. When the green arrow picture box moves over the red, you can clearly see that the green picturebox is only *pretending* to be transparent; you can see that the green picturebox is filling the empty spaces with the form's colour, and that box moving over the arrow beneath it. Basically, it looks fairly unprofessional.
Is there some way to fix this, so that you *only* see the green arrow moving over the red, and not the form's foreground colour with it
I hope that made sense; please let me know if I need to clarify.
- 3
- Visual Basic Express Edition having trouble with lesson video's
I have been 4 days trying to figure this out,,
I new to programing so I've been watching the training video's found at:
http://msdn.microsoft.com/vstudio/express/vb/learning/
I'm watching lesson 09, and I have followed the lesson just exaclty as it was done in the video. My table will not update with any new or changed information, so I downloaded the project that accompanies the training video's and ran their example with the exact same results. Is there something with my computers that could prevent this, computer 1 is a HP Pavilion a1612n with Windows XP Media Center 2005. The second computer is Home built running Windows XP SP2. Both fully updated.
Please someone explain why
- 4
- Visual C++ Express Edition LNK2019 Error-Please help
#include <stdio.h>
mail()
{
printf( "hello world/n");
}
....Thats straight out of a book i just ordered and everytime i hit build solution like it tells me to this comes up....
LIBCMT.lib(crt0.obj) : error LNK2019: unresolved external symbol _main referenced in function ___tmainCRTStartup
C:\Documents and Settings\Brett\My Documents\Visual Studio 2005\Projects\hello\Debug\hello.exe : fatal error LNK1120: 1 unresolved externals
Build log was saved at "file://c:\Documents and Settings\Brett\My Documents\Visual Studio 2005\Projects\hello\hello\Debug\BuildLog.htm"
hello - 2 error(s), 0 warning(s)
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========
Anyone know what im doing wrong
Im also using "win 32 Console Application" if that helps
- 5
- Visual Studio Code Analysis and Code Metrics Hi, could i catch the "return null" statment in the code
Hi All:
I want to create a Rule, the detail is:
"if you declare a method, when the return type is Array, String or Collections, you should not explicit return null in the code, otherwise, some unpredictable result maybe will happen."
For example:
A method like:
public int[] tryMethod() { return null; }
the method violates the rule, because the method's return type is Array, but in the code, it explicitly returns null in the code.
My question is: could i get the "return null" in the IL code by view the IL instruction. I had tried to get it, but i only get the "ret" instruction, i couldn't get the real return value, so could help me to find it, I'll be very grateful, thank you~~~
- 6
- Visual C++ Express Edition Newbie at work -- Cannot start application
I wrote, compiled and fine-tuned a CLR Windows Forms Application, and I can't start it up on a different computer than the one I program on. Is there a way to fix it
Something like:
Could not start the application because the configuration settings are incorrect. re-installing the application may solve the problem.
- 7
- Visual C# Express Edition Pass a variable from one form to another... Hey
I've searched and searched but I haven't found a solution to this problem...
All I want to do is pass a string from one form to another. And since C# doesn't allow global variables (or does it... ), I haven't found a way to do this. Let me know if you need more information to solve this problem.
Thanks
- 8
- Visual Basic Express Edition visual basic 2005 command prompt help..
O.k i have been looking around and still have not been able to find the answer.
what i am looking for is the code that will send a command to dos prompt or cmd and execute it.
You know like ipconfig
iprelease / renew or netstat -a
this way you dont have to go and type all this long stuff out everytime you need to release your ip or your trying to configure a network.
- 9
- 10
- Visual Basic Express Edition Displaying Data from Sql databaseI decided that it was time to start looking at Sql Databases and have been working through the dvd series and code and came up with a small program to practice on. I am trying to make a program that will keep track of some of our bank accounts, namely checking, savings and school fund.
This is what I have achieved so far:
I have created two databases, 1 for account details and 1 for transaction details. I have a form (selectaccount) with a combox that displays the account names, which I have linked to the database and is working fine, when you click on the account name it opens my second form (bankingdetails) that I want to show a list of transactions (say the latest 15/20 – maybe scroll up to more ) this form has a button to my third form (transactdetails) that is linked to my Banking details database where I want to enter the actual amounts etc of the transaction (this is in details view). What I can not figure out how to do is show the transactions on the second form in a datagrid type view for only the account that was selected in my select account form.
Sorry this is so long but any help/suggestions with this would be greatly appreciated.
Diane
- 11
- Visual Basic Express Edition Calculation formulas
In my wee banking database I have the expected three columns ie: deposit, withdrawal and balance. I have never used formulas before in excell, programming or anything and after searching on the web for the last two days to find out about them I am at my wits end.
Could somebody please explain how to get these columns to add/delete and update the balance column. and where/how to put the code. Do I use the Formulas property in the database property for the balance column if so what do I type.
Im desperate to make this part work so any help would be great.
Diane
- 12
- Visual Basic Express Edition BindingSource.Filter Question
Hello, I'm looking to find duplicate records but I can't seem to get my bindingsource to do so. I'm looking for something like this:
mybindingsource.Filter = "ssn HAVING COUNT > 2"
I want to return only records that have two or more ssn's.
- 13
- Visual Basic Express Edition Move to cell in previous row?
I need to write a code to move to a cell in the previous row.
I have looked at (offset) , (currentcell) & (currentcelladdress) but i can't quite get the hang of it.
This is what i have so far in a button click event:
Me.MaintableDataGridView.CurrentCell.Selected = False
Me.MaintableDataGridView.Rows(0).Cells(0).Selected = True
This works great but i just want to move 1 cell up, not by coordinates.
Is there some way to utilize code to mimic the arrow keys (sendkeys, etc...)
Any help would be great. Thanks
Jeff
- 14
- Team Foundation Server - Version Control baseless merge not creating a folder relationship?
Hey guys,
I think I understand most of the caveats of a baseless merge, but I saw some behaviour that I wasn't expecting.
I have 2 folders that look something like:
Main
- file1.cs
- file2.cs
- file3.cs
Release
- file1.cs
- file2.cs
- file3.cs
I did a 'tf merge Release Main /baseless /recursive' to merge the 2, resolved conflicts and checked in.
But, when I select a folder like Release and choose Merge in the source code explorer, I don't get any merge target branches. I was expecting to see Main.
If I select a file in Release like file1.cs and choose merge, I get a target file1.cs in Main like I expect.
So when I do a baseless merge, the branch/merge relationship does not seem to extend to the folders. Is this expected behaviour
Thanks!
Eric.
- 15
- Visual Studio Code Analysis and Code Metrics Hi, about class member's access level~~~
Hi All:
I want to create a Rule, the detail is:
"Programmer should explicitly declare the class member's access level."
For example:
A class like:
namespace Microsoft.TestFiles { public class BaseTestSample { String a = ""; int tryMethodA() { return 1; }
public int tryMethodB() { return 2; } } }
the class member a and tryMethodA violates the rule, because they didn't explicitly declare the class member's access level, but tryMethodB, it explicitly declared the access level "public", so it fulfils the rule.
My question is: I had tied to view the IL code to find the access level, but unfortunately, when the programmer miss the access level of the class member, the compiler will add the default access level for you, so when you want to get the class member's access level by viewing the IL code, you will always get the access level, then we couldn't check if the access level is declared by programmer or compiler, so could help me to solve it, I'll be very grateful, thank you~~~
|
| Author |
Message |
CaoxiCao

|
Posted: Visual Studio Code Analysis and Code Metrics, How can I check if a node is an hashtable or Directory |
Top |
Hi,
I have a new problem now. I can get array type by local.Type.NodeType == NodeType.ArrayType
and ,how can i get Hashtable /Directory's type
then,ArrayList/List
thank you!
Visual Studio Team System34
|
| |
|
| |
 |
Todd King - MSFT

|
Posted: Visual Studio Code Analysis and Code Metrics, How can I check if a node is an hashtable or Directory |
Top |
To check for these types (or any type for that matter) you are going to need to check the name of the type. So to check if a type is a Dictionary you would do the following:
if (type.GetFullUnmangledNameWithoutTypeParameters().Equals("System.Collections.Generic.Dictionary", StringComparison.Ordinal)) { ... }
For Hashtable you do the same thing specifying the fully qualified path to the Hashtable type.
if (type.GetFullUnmangledNameWithoutTypeParameters().Equals("System.Collections.Hashtable", StringComparison.Ordinal)) { ... }
etc...
-Todd King
|
| |
|
| |
 |
CaoxiCao

|
Posted: Visual Studio Code Analysis and Code Metrics, How can I check if a node is an hashtable or Directory |
Top |
thank you first.
i just do it as follow:
if (objField.Type.NodeType == NodeType.ArrayType || objField.Type == SystemTypes.ArrayList || objField.Type == SystemTypes.Hashtable || RuleUtilities.IsAssignableToInstanceOf(objField.Type, SystemTypes.GenericList) || RuleUtilities.IsAssignableToInstanceOf(objField.Type, SystemTypes.GenericDictionary) )
|
| |
|
| |
 |
| |
 |
Index ‹ Visual Studio Team System ‹ Visual Studio Code Analysis and Code Metrics |
- Next
- 1
- Visual Studio Code Analysis and Code Metrics hi, about recurrence block in the code~~~
Hi All:
I want to create a Rule, the detail is:
"Programmer should not do the String connect operate in the recurrence block, it will reduce the performance."
For example:
A method like:
public void testStringAdd() { String a = "a"; for(int i = 0; i < 10; i++) { a += a; //violate the rule } }
My Question is how to orientation the loop block in the IL code, Thank you very much.
- 2
- Visual Basic Express Edition Capture a picturebox
I am trying to capture the contents of a picturebox. The picturebox's location property is 0, 0 Only the upper left corner of the picturebox and part of whatever is in the background, is captured.
Dim b As Bitmap
Private Sub CapturePictureBox1()
Dim myGraphics As Graphics = PictureBox1.CreateGraphics() Dim s As Size = PictureBox1.Size b = New Bitmap(s.Width, s.Height, myGraphics) Dim capturedGraphics As Graphics = Graphics.FromImage(b) capturedGraphics.CopyFromScreen(PictureBox1.Location.X, PictureBox1.Location.Y, 0, 0, s) End Sub
Private Sub Button1_Click(ByVal sender As System.Object, _ ByVal e As System.EventArgs) Handles Button1.Click
CapturePictureBox1() End Sub
- 3
- Visual Basic Express Edition Using PrintDialog(), can I specify "Preview"?
When using PrintDialog(), where the user selects which printer to use, is it possible to specify a preview, that is whithout the user having to select preview
Private Sub btnPrintDialog_Click(ByVal sender As System.Object, _ ByVal e As System.EventArgs) Handles btnPrintDialog.Click
Dim dlg As New PrintDialog() dlg.Document = mDoc If dlg.ShowDialog = DialogResult.OK Then mDoc.Print() End If
End Sub
- 4
- 5
- 6
- Visual Basic Express Edition about sqlconnection? hi gud day ppol.... i have a problem regarding sqlconnection for example
dim theConnectionString as new sqlclient.sqlconnection(" what's NEXT "no idea"") thx in advance... sorry for stupid question
- 7
- Visual Studio Code Analysis and Code Metrics How to realise to check if there is goto or return in the try block;
Hi all:
How to realise to check if there is goto or return in the try block;
For Example:
try { if (method(12)) goto aaa; else return; }
I want to check this condition.
I have look at the IL code and managed to find the Try block but I find that If There is return or goto In the try block there have more than one "leave.s" . Can I use this feature to check if there is try block use return or goto Is there any other methods to check this rule Thanks.
- 8
- Visual Basic Express Edition Is their a value for a line wrap?
I am making a simple program that takes a textbox and splits it into 2 different text boxes with random characters in each. It fills in the missing characters with spaces. So if you print out both of the new text boxes and put one on top of the other you can see the whole message. The problem is with the line wrap in the original textbox. The new textboes don't see this and the message can get screwed up at the line feeds.
I am just wondering if their is a char value for the line wrap so I can put it back into the other text boxes.
Ex
- 9
- Visual Studio Code Analysis and Code Metrics Hi~~ About String.IsNullOrEmpty
Hi all:
If I want to make the rule: If a programmer want to test if a String variable is null or not, he should use String.IsNullOrEmpty instead of just typing "someone == null", so my question is: how to find the "someone == null" in the IL code...
For Example:
the method is:
public void testStringAdd() { String a = "a"; if (a == null) { } }
could I find the "a == null"'s corresponding IL code thank you~~~
- 10
- Visual Studio Code Analysis and Code Metrics About [CA1062]ValidateArgumentsOfPublicMethods
Hi,
the rule of CA1062,it only can check methods of public, i wanna check not visible methods,how can i do it
Thank you very much.
----------------------------------- Validate arguments of public methods
| TypeName: |
ValidateArgumentsOfPublicMethods |
| CheckId: |
CA1062 |
| Category: |
Microsoft.Design |
| Message Level: |
Error |
| Certainty: |
95% |
| Breaking Change: |
NonBreaking | Cause: An externally visible method does not check whether one of its reference arguments is null
- 11
- 12
- 13
- 14
- 15
- Visual C# Express Edition I want to use cascadingDroDown control with SQL Server 2000 database?
I want to use cascadingDroDown control with SQL Server 2000 database, i have three table called province, District, Street.
Province: (ProID, ProvinceName)
District: (DistID, ProID, DistrictName)
Street: (StreetID, DistID, StreetName)
How can i use it with cascadingDroDown when i select province in Dropdown1 then all Disttrict belong this province are displayed, then when i select District, all streeet belong that district are displayed in dropdown3. Can you help me
Thanks,
|
|
|