Azure Data Studio set NULL in cell in edit mode - azure-data-studio

Is there any way to enter in a cell the DB NULL value in Microsoft Azure Data Studio (VSCode version of SQL Management Studio) while I'm in edit mode? I can't find any related. No context menu and no keyboard shortcut.
Thanks

I think you can simply type NULL in capital letters, it will automatically be converted to a NULL value. It seems to stand out from the rest as it initially isn't displayed in italics, but after refreshing it will be.

Related

How can I make a VisualStudio ApplicationSetting's default value be conditional?

I have a C# application in Visual Studio 2010 that uses several application settings. For one of these, I want its default value to be conditional, depending on whether the C# application is running as 32-bit or 64-bit. That way, if the user manually assigns the setting a value, it'll be persisted, but otherwise we choose an appropriate value on the user's behalf.
It's clear that I can set a value of the setting's type in the Value data grid cell. But is there a way to use a conditional so the default value is chosen based on specific logic?

Can I change code/values while in debugging mode?

In Visual Studio 2010 (Ultimate), is it possible to step through some code, and, if a variable is not correct (e.g. you want to get all records beginning with 'A' but there is none, so you want to try 'B' instead), is it possible to change the code while in debug mode, to do this (change variables while in debug mode)?
It is quite annoying to have to stop debugging, change a value, then debug again and see the result. It'd be much easier to do it all in debug mode, anyway.
Thanks
In the watch window just enter the statement you want executed. For example if you want to set the variable prefix to "B" then just type prefix = "B" and hit enter.
You may also change code while running, however there are a number of limitations to this feature. See Microsoft's Edit and Continue documentation for details: http://msdn.microsoft.com/en-us/library/bcew296c(v=vs.80).aspx.
In the Solution Explorer view, right-click on each reference of References, choose Properties. In the Properties view, sign False to the field of Embed Interop Types. This works for me.
c

Debugging in Dynamics AX

I'm facing some troubles still while learning, so I guess it tends to get worse once I play with the big kids: warnings in dynamics aren't as precise and informative as VS's, there are no mouse-over tips, and exceptions to show me exactly where I've got it wrong.
I'm just too used to Visual Studio, it's intellisense and all the tools (dynamics is quite new when compared to Visual Studio)
More than solving simple code issues, i'd like to learn how to solve upcomming ones i might have in code not written by me or anything else i'd solve in 3 minutes in Visual Studio, as well as tips on how to survive in dynamics ax without all the Visual Studio tools.
The code editor in Dynamics AX has some intellisense, typing the name of a table or class variable followed by . or :: will give you a list of fields or methods available for that item. After you type the ( to start a method call, a tooltip pops up with parameters available on that method. When starting a new line, you can right click and List Tables, List Classes, List Types, etc. Most of those commands are also available via Shortcut Keys. Note that the intellisense only works if all the code in the method up to the location of your cursor is syntactically correct.
Make sure you have updated the cross reference in your development environment (Tools/Development tools/Cross-reference/Periodic/Update). With an updated cross reference, you can right click an any table, field, class, method, extended data type, or enum in the AOT and choose Add-Ins/Cross-reference/Used by to see where that item is used in the system.
You can also use Tools/Development tools/Code explorer to view the source to the application with all types, variables, and methods turned into hyperlinks so you can click to go right to the definition of that item.
Another useful tool is Application hierarchy tree, available either under Tools/Development tools, or on the right click Add-Ins menu. This will show you the class hierarchy, so you can easily see, for example, that SalesFormLetter derives from FormLetter, which derives from RunBaseBatch.
In the editor, you can highlight text and right click to Lookup Properties/Methods or Lookup Definition.
If you are trying to track down where in the system a particular infolog message is generated there are two strategies to use:
Set a breakpoint on the first line
of the method Info.add(). Then when
you run the code generating the
message, you will pop into the
debugger as soon as the infolog is
generated. You can then look at the stack
trace in the debugger to see where the code is that
generated the message.
Run Tools/Development
tools/Label/Label editor and search
for the text of the message. Select
the Label ID of the message, then
click Used by to see where that
message is used in the system.
There is also http://www.axassist.com/ which extends intellisense and many other extensions
What these guys said already is very interesting and helpful.
I'd like to add that within AX in real life you are probably working with multiple contexts. e.g. Code running in the client, code running in server, code running in p-code and in IL, COM integrations, Enterprise portal and so on.
My point is, if you want to figure something out through debugging, you must first understand where the code(s) you'd like to debug is running.
Knowing that is important because you might have to allow debugging or give permissions in multiple places.
Examples:
Windows AD debugging users (add yourself)
Allow debugging on client
Allow it on server
Disable IL if you want to use MorphX, otherwise attach the process in VS.
Allow World Wide Web Publishing Service to interact with desktop for EP.
One last thing, you are starting to work with ax right now, perhaps you will need to work with AX7(Dynamics 365 for Operations). This version of the system works only with visual studio. It is still x++, but you have a lot of the things VS provides you.
Take a look on EditorScripts Class,On AX Editor you can use it by right click and choose "Scripts". It is a kind of intellisense that can make by your self, for example: here is my in-line comment whenever I type "mycom" and press "tab"
public void template_flow_mycom(Editor editor)
{
xppSource xppSource = new xppSource(editor.columnNo());
int currentline = editor.currentLineNo();
int currentcol = editor.columnNo();
Source template = "//Partner comment "+date2str(today(),123,2,1,3,1,4, DateFlags::FormatAll )+" at "+time2str(timenow(), 1, 1)+" by MAX - Begin\n";
template+=strRep(" ", currentcol)+ "\n";
template+=strRep(" ", currentcol)+ "//Partner comment "+date2str(today(),123,2,1,3,1,4, DateFlags::FormatAll )+" at "+time2str(timenow(), 1, 1)+" by MAX - End\n";
editor.insertLines(template);
//move cursor to the empty line between the comments
editor.gotoLine(currentline+2);
editor.gotoCol(currentcol+4);
}

VS 2008 MSI Installer: Context.Parameters["TARGETSITE"] empty when repairing

i created a web setup project in vs 2008 and added some custom actions.
While installing i get the default forms (apppool, appname, website), some pre-defined custom forms and some selfmade custom forms.
Now while installation i add some data in the registry.
I have only one problem: TARGETSITE property.
This property is filled by default form (Context.Parameters["TargetSite"] is something like "/LM/W3SVC/1" for defaultWebSite) and its value properly added to the registry.
Everthing is fine until i use the repair function...
Whilst repairing, the first few default forms will be skipped by installation, therefore the TARGETSITE property will be empty (Context.Parameters["Targetsite"] is "").
Sadly i can not interfere with that to get the needed value from registry where i added it for exactly that reason.
Because the registry values will be updated before custom code is triggered in the "override Install" method.
Even onBeforeInstall is fired after the registry has been updated.
If a rollback is done, while repairing, the registry key will be reset to the correct value before, so i have to believe, that somehow i can access this value from within my custom action code.
Someone has any suggestion on how to get this important value?
P.S.:
i tried to set the condition within the registrykey, so that it would only be updated when the TARGETSITE value is not empty, but i´m afraid this will be ignored big time...
TARGETSITE != "" in the registry keys condition-field has absolutely no efect whatsoever...
I solved the problem by working around the installers registry key.
I manually create a subKey under the installers registryEntry, where I store my Context.Parameters["TARGETSITE"] value.
So the repair feature will not overwrite the keyValue because it´s a custom key.
Now I have my value either in the context or in the registry.
FunFacts:
When I create the customKey within the Installers own key, I take advantage of the standart meachnism, which delets the installers registry key and with that my customKey will also vanish.
Maybe this might help if someone else faces this problem sometime...

How to keep Visual Studio debugger visualizers from timing out?

I've successfully made several Visual Studio debugger visualizers, and they're working very well, except that on some objects I get a time out error when I try to deserialize the object with objectProvider.GetObject()
System.Exception: Function evaluation timed out.
at Microsoft.VisualStudio.DebuggerVisualizers.DebugViewerShim.PrivateCallback.MaybeDeserializeAndThrowException(Byte[] data)
The time out happens rather quickly (maybe about a second after I click on the visualizer icon), even though some of my other visualizers work fine even with large data objects that much longer to display (5-10 seconds) and still don't timeout.
I've already made a custom object source to limit the serialization to the fields I need to display. What else can I do to get the data to deserialize without timing out?
HKEY_CURRENT_USER\Software\Microsoft\VisualStudio\9.0\Debugger
I think this is not documented, but you can try changing some of the Timeouts in the above registry key, and restart Visual Studio.
I was recently hit by this in VS2012 and after googling I found this:
As the exception message says, this exception means the debugger
visualizer for the datatable is timed out. In VS debugger, each
expression evaluation windows(such as watch window, locals window,
datatips, autos window etc..) has different default max expression
evaluation timed out value. For datatip, we prefer to give a short
time out value because otherwise it will provide a poor user
expression. If you do want to use the visualizer functionality for
that datatable, you may add the expression to a watch and try to
visualize it.(Because watch window has a longer timeout value). If you
do want to get rid of this timeout in datatip, you may try to increase
the timeout value for datatip. The timeout value is a setting in
"DataTipTimeout" registry key under:
HKEY_CURRENT_USER\Software\Microsoft\VisualStudio\10.0\Debugger Note:
you should probe WOW64Node for 64bit OS. You can also see other
windows' default timeout value under this key.
To Visual Studio debugger work well - "Locals" window in "WPF visualizer" (tested in WPF application), you need to find in registry:
HKEY_CURRENT_USER\Software\Microsoft\VisualStudio\12.0\Debugger\
DWORD parameter "LocalsTimeout" and default value (1000) set to big enough value, 5000, for example.

Resources