Is it possible to insert unicode strings with input VB6 control's in a SQL Database? - sql-server

I am trying to Insert Unicode strings into a table using the Internal vb6 controls(text,List,ect..) .
But when I try to do that , VB6 Control's convert that string , and different string is stored.
Am I forgetting something or is it a visual studio issue?

I found a reference to a software package(3rd-party controls) :
http://www.cyberactivex.com/UniSuiteFree.htm
I used This package and it done , but would also be curious to hear feedback from anyone who has used these or other ones :)

Original VB6 forms components did not do a good job with Unicode, although once you get Unicode strings into VB6 code you are mostly ok. You need to use the 'B' forms of string operators, like midb(), lenb() etc if you are doing any string maniputaion. You also may want to check your SQL parameter declarations to ensure you are using the unicode options. Otherwise it is all do-able.
Try the advise at this MS Support article.
Edit: After prompting from #Bob I read the MS Support article I linked to in more detail and take the point that forms2 is not a great bet for VB6 forms unless you have a more-than-usual level of control over the target machines.
In my own case I used a commercial component named Unitools from Woodbridge Associates but I cannot find their website today. Unitools included Unicode-aware label, text box, combo and list controls. Anyone able to provide a link ?

Related

Read data for Inteliprompts in RadSyntaxEditor from dll or xml

RadSyntaxControl is newly created control from Telerik and has a feature for InteliPrompts but in every sample, I found out the user must manually populate CompletionInfoCollection, as you can see in this example.
CompletionInfoCollection completionList = new CompletionInfoCollection()
{
new CompletionInfo("Achitect", "A software developer expert.", Image.FromFile(#"../../SyntaxEditor/ Achitect.png")),
};
this.radSyntaxEditor1.SyntaxEditorElement.IntelliPrompts.CompletionListWindow.Presenter.CompletionListItems = completionList;
It is ok if there are just a few items for autocomplete but what in a case if I want to autocomplete for language like C#. Telerik has a syntax highlight for C#, but I cannot find a way to populate IntelliPromts with data in that manner.
The sample code is from Telerik Blogs
Thank you :)
Nenad,
As you have already found out, RadSyntaxEditor uses a CompletionInfoCollection to define intelliprompts which aim to speed up coding by reducing typos and other common mistakes. It is just necessary to define a separate CompletionInfo for each item that you want in the completion list window. It is up to you what list to be displayed and how you will get this information. This job is not intended to be done by the RadSyntaxEditor control. Additional information is available in the following help article: https://docs.telerik.com/devtools/winforms/controls/syntax-editor/features/intelliprompts
I have researched in the forums and since the English version of IntelliSense files are embedded in Visual Studio, I have found the following MSDN article which offers different language packs for the IntelliSense. Hence, you can at least use it to investigate what are the keywords and replace the translation according to your needs: https://learn.microsoft.com/en-us/dotnet/core/install/localized-intellisense
I hope this information helps.

Spreadsheet Gear migration errors

I am migrating Spreadsheet gear of my application from 6.0.3.190 to
7.4.1.104.I am getting my issues with Color property.Can any one help me in this.Now I am using using Color = System.Drawing.Color; and also ToSGColor().This became very hectic to do in all places where ever we use color.I expect we should have some shortcut to do this.Can any one suggest me How can i get all functionalities with few changes only.I am also getting exceptions to c onvert IColorFormat.LineColor to system.drawing.Color.
Note the "Breaking Changes" page in the SpreadsheetGear 2012 documentation, which lists this particular change:
In order to support WPF and Silverlight, the core API has been
separated from the GDI+ and Windows Forms APIs and therefore uses the
new SpreadsheetGear.Color type rather than
SpreadsheetGear.Drawing.Color. SpreadsheetGear.Drawing.Color has been
moved to SpreadsheetGear2012.Drawing.dll. See
SpreadsheetGear.Drawing.Color for an example which uses the implicit
and static converters to convert between SpreadsheetGear.Color,
SpreadsheetGear.Drawing.Color and System.Drawing.Color.
SpreadsheetGear.Colors and SpreadsheetGear.SystemColors provide
helpful predefined colors to replace the use of predefined colors in
System.Drawing.Color.
So you'll need to ensure than any place where you were previously using System.Drawing colors now use SpreadsheetGear.Drawing colors, including API like IColorFormat.LineColor.
There aren't really any "migration" tools to automatically convert such instances to the new API. So you'll need to resolve these errors for each code file. Doing a Find/Replace keyword search for "System.Drawing" and "SpreadsheetGear.Drawing" could possibly speed up the process, though this would depend on what using statements you have added to each code file.

format document WebPage via Windows Forms Application?

So, I'm building a windows forms application that uses a StreamReader/StreamWriter to read each line of the .aspx, .ascx and .master pages on our asp.net website. It then removes certain properties and such from the controls through string manipulation, and writes the result back (overriding the page's markup with the edited markup). The problem is some of these pages are being written as one continuous line.
I've been unable to find anyway to call the visual studios 'Format Document' function. I found this question that would likely accomplish my goal if I weren't trying to do this from my Windows Form Application (as it's an automated process).
Any tips or points in the right direction would be appreciated.
A quick-and-dirty-solution would be (and I don't recommend it):
content = content.Replace("></", ">></").Replace("><", ">\n\t<").Replace(">></", "></");
content is the string that holds the web content.
First and last replacements are to avoid the second replacement to add newlines between something like this <tag></tag>. The above code of course has some flaws. Something like <tag1><tag2 /></tag1> will not be formatted correctly. You could avoid this by pre-replacing /></ with something you can safely re-replace at the end.
You may also want to replace \n with \r\n perhaps.

Best way of maintaining versions

I want to maintain version control in following application so what will be best option for maintaining version?
In my app there is tool which will generate resources as input for my frame work.
For the sake of simplicity we can take a eg like in tool there are same options so one can set some values over there.
Just assume there are ten integer ctrl box are on tool and user can set values there so tool will generate the values either as xml file or some struct define in c as follows.
Note here parameters name like TITLE and DIALOG use respectively with Integer ctrl. these string name are ie TITLE/DIALOG will remain fixed.
<root>
<TITLE value = '1' />
<DIALOG value = '2' />
.
.
</root>
and
Struct data
{
1, //TITLE
2. //DIALOG
.
.
.
}
etc
So tomorrow it may possible there are some new parameter like TITLE and DIALOG may also added.
Then what is the best way to keep the version control in this scenario.
actually i am not talking about version control like perforce or svn, my question is regarding like if there are 10 parameters ot wd mine version 1.0 or if there are 12 param then it wd may 1.1 etc, like in that sense i am talking. I always want assurance that with these strings i will generate some key and this key will be write into the xml, then in framework i will calculate that key by those param so there is always assurance that data generated by tool is as same version with the current frame work version.
I know its bit lengthy but i hope it make problem more translucent
Thanks in Advance
Could you be a little more specific ?
If you talking about the versionning of your code, there existe an array of software that you could use. SourceSafe, Team Foundation, SubVersion and CVS are but a few. Some of them are pretty simple and free, while other are quite expensive but can be easily integrated into you IDE if you have one.
Hope that helps.

Macros in SQL Server Management Studio

Is there any way to implement text editing macros in SSMS? I would, e.g. like to convert the the code as shown below, but with a key-press, not a long-winded regex search and replace.
This:
INSERT INTO [TABLE]
([fieldOne]
,[fieldTwo])
VALUES
(<fieldOne, datetime,>
,<fieldTwo, real(24,0))
Must become this:
INSERT INTO [TABLE]
([fieldOne]
,[fieldTwo])
VALUES
(#fieldOne
,#fieldTwo)
I know SSMS doesn't natively support this, but I also know that it is extensible, if undocumented, and there is also room for a totally external application that will take copied text, transform it, and paste it back, without having to open an editor, paste, edit, copy, and paste back to SSMS.
Editing the stored templates is not an option, as these templates are dynamically generated, and using Ctrl+Shift+M is not an option either, as I still have to type each parameter name, but without the convenience of copying and pasting in the query editor.
There is no SSMS solution! I am looking for some sort of external voodoo that can help me do this.
What about an AutoHotKey script?
Depending on the complexity of your templates, you could either
use AutoHotKey to play back the keystrokes
needed for the regex search and
replace, or
copy the template to
the clipboard and manipulate it
directly within AutoHotKey before
pasting it back.
I'm sure the first option will work. I've not tried the second.
This question gives an indication of how an AutoHotKey script can be written to listen for keyboard chords.
If you are using SSMS 2005 upwards it has in built support for templates. It isn't exactly full blown macro's, but non the less it is still pretty useful.
The syntax is exactly as you have shown in your first code snippet and you simply press Ctrl+Shift+M to bring up a dialog box that prompts you for the values to go into your bits enclosed in angle brackets.
SQL server generates script in this format if you right click on a table and select "Script Table as" then pick either the insert, update or delete option.
You can also create your own custom templates, or modify one of the existing built in ones (click on View -> Template explorer to get access to the other inbuilt templates).
There is a short article on MSDN that explains how to get started with templates.
Was looking for something else, but found this question. If you're still looking for something, try SSMS toolpack: http://www.ssmstoolspack.com/ It has macros and a bunch of other neat things. And it's free!
For SSMS 2016 you can use my Visual Commander extension. It supports macros recording/playback and custom C#/VB commands for editor text manipulations.
First code is template from old-good MS Query Analyzer. Shortcut to filling is Ctrl+M (but I'm not sure, maybe it is Ctrl+Shift+M).
There should be same feature in newer SSMS.
I usually copy the code into another editor (Notepad++, or Delphi /RAD Studio editor), do my macro stuff, and then paste it back into SSMS.

Resources