spot7.org logo
Home PHP C# C++ Android Java Javascript Python IOS SQL HTML Categories
  Home » DOTNET » Page 1
Some bytes missing or added after encrypting/decrypting with RijndaelManaged
The problem you are having is you are misusing TrasnformBlock, If you where working with just a stream think of TransformBlock as a call to Stream.Read( or Stream.Write(. Where TransformFinalBlock is like calling Stream.Read( or Stream.Write( followed by a Stream.Close() The reason for the two functions is sometimes you want to start encrypting or decrypting your data before you have received all

Categories : Dotnet

QTP How to record context menu
The problem is QTP doesn’t record the contextmenustrip step. While running the test QTP faces a context menu and doesn’t know what to do and hangs. This can be solved with the following step : while recording the steps when the context menu opens up Right Click to select the option on the context menu. This generates code similar to the following : SwfWindow("Form1").SwfToolbar("contextMen

Categories : Dotnet

Registering custom URL schemes with ClickOnce installations
I found this workaround for adding and removing custom registry keys for ClickOnce installations: http://www.codeproject.com/Articles/506162/ClickOnce-application-autostart-and-clean-uninstal It basically works as follows: Installation: ClickOnce installs your application Your application starts the first time and writes the required registry keys (e.g. for registering a custom URL scheme) Yo

Categories : Dotnet

It is possible to get any keystrokes in application regardless of active window?
according to msdn the system sends keyboard messages only to the foreground thread, does the modal windows start in another thread ? if yes you can just message the main from the modal window thread with some simple thread messaging using the same handles you used in the main window form , now if you don't have any idea of what thread is .... you can always learn here are some nice articles

Categories : Dotnet

Double.ToString("N") rules on rounding
From the Standard Numeric Format strings docs, it's always away from zero: To perform a rounding operation, use the Math.Ceiling, Math.Floor, or Math.Round method. When precision specifier controls the number of fractional digits in the result string, the result strings reflect numbers that are rounded away from zero (that is, using MidpointRounding.AwayFromZero). From that page, and fr

Categories : Dotnet

How to get AD user's 'memberof' property value in terms of objectGUID?
You can make use of the "Extended DN" LDAP extended control. It can be used only in AD search. C# code: // Here I get the user object and then do a AD search. // Instead, you may search for that user object directly. DirectoryEntry userEntry = new DirectoryEntry("LDAP://<server>/<user DN>", "user", "pwd"); DirectorySearcher searcher = new DirectorySearcher(userEntry); searcher.Searc

Categories : Dotnet

PrintDialog : The calling thread cannot access this object because a different thread owns it
The problem is that the document, or visual, that you're trying to print is currently displayed on the UI thread. In order to get around that, you'll need to recreate the visual. This means that you need something like a copy constructor. What this means is that you need to do ControlX doc = new ControlX(visualToPrint) which will create a new reference to the control on non-UI thread. From tha

Categories : Dotnet

Transaction open for many hours
How often to commit? Basically the question is: What is YOUR smallest Transaction? Consider the example of a bank account (very very simplified): you may have 10000 money Transfers from one account to another, but if you Transfer from account A to account B, (let´s say this will be accomplished by two inserts) THIS IS ONE TRANSACTION - commit this one. and then the next one.

Categories : Dotnet

Import large number of lines from MsAccess in .net fast.
You have to perform database operation from your .NET side. To do that you need to connect to your access database from your .NET side. To do that, you need a valid driver + connection string in situ. using System.Data.OleDb; Access ACE/JET driver is installed .Net side you would be doing something like: string connectionString = String.Format(@"Provider=Microsoft.ACE.OLEDB.12.0;Data Source={

Categories : Dotnet

error in datetime with oracle insert statement
MI in format means minute.. Hope you got it as month and i. I put it here as 10 for example. Same as AM in format means am or pm. INSERT INTO ITEMAPPROVAL ( REQUESTITEMID, USERID, APPROVALSTATUS, REQUESTSTATUSID, ITEMAPPROVALDATE, ITEMAPPROVALNOTE , APPROVEDAMOUNT) VALUES ('132568', '15', '1', '4', TO_DATE('06/02/1436:10:10:41am', 'mm/dd/yyyy:hh:mi:ssam'), '' ,'20000');

Categories : Dotnet

AZURE VM scalable design environment for testing
Part of your question is subjective and opinion-soliciting (the part about architecture pointers/advice), and should be removed (since there's no right answer). As to Roles and Cloud Services: Each role just defines what will be running on a virtual machine, and each instance of a role translates to a separate VM. Two roles? Two sets of vm's (one per instance per role). If you want your code all

Categories : Dotnet

Changing References Folder (Assemblies) to /bin
It isn't <Probing>. It is <probing>. XML is case-sensitive. <configuration> <runtime> <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1"> <probing privatePath="bin"/> </assemblyBinding> </runtime> </configuration> should do it, in the Test.exe.config file.

Categories : Dotnet

How to get a value for form active state in vb.net
How about this? It is using the ActiveForm property of the Form class: If Form.ActiveForm.Name = "yourForm" Then 'Do Events 1 Else 'Do Events 2 End If

Categories : Dotnet

How to reference and ship an external / third-party .NET DLL with a solution under version control at Visual Studio?
You can create a new folder in the project where the dll is required then reference the dll in the project from there and then chekck-in the dll. When the other users will get latest project/solution they will get this dll automatically and they will not get problem in building.

Categories : Dotnet

How to set up .net RSA with a specific key?
You're talking about symmetric encryption where only a single secret key is used which must be present for both (or more) parties. See also Difference between asymmetric and symmetric encryption methods? This question provides code, but uses ECB mode which is not recommended. You should use some authenticated mode like GCM or CCM. It seems to me that the API doesn't provide it, so CBC mode should

Categories : Dotnet

Windows RT/Universal app, Checking Stock from yahoo finance
Well, the short answer to this is that you should extract the second part of the result and show that. This can be done by splitting the string by the delimiter ,, and then using the second part. string[] values = result.ToString().Split(","); string stockValue = values[1]; // values are 0-indexed, so 1 is the second string ActualStock.Text = stockValue;

Categories : Dotnet

POP3/IMAP/SMTP client for asp.net MVC
You could always use MailKit from source at my GitHub or via easy-to-install packages from NuGet

Categories : Dotnet

How to change Custom Control default size
Try this Public Class CustomControl : Inherits Windows.Forms.PictureBox Private ReadOnly INMUTABLE_SIZE As Size = New Size(20, 20) Public Shadows Property Size As Size Get Return INMUTABLE_SIZE End Get Set(value As Size) MyBase.Size = INMUTABLE_SIZE End Set End Property Protected Overrides Sub OnSizeChanged(e As System.Eve

Categories : Dotnet

Async & Await to determine when button disable event completed
Maybe you are looking for something like this? private async Task<int> FilesCountAsync() { .... } protected async void btnStart_Click(object sender, EventArgs e) { btnStart.Enabled = false; var fileCount = await FilesCountAsync(); SetFileCountInUI(fileCount); btnStart.Enabled = true; }

Categories : Dotnet

Getting random stack overflows from Gembox Spreadsheets .NET
if I were you I would could contact GemBox.Spreadsheet support and provide them a VS test project that reproduces the issue: http://www.gemboxsoftware.com/support-center/new-ticket

Categories : Dotnet

MS Release management data release to multiple databases
You should be able to parameterize the SQL Scripts using the SQL Command parameters and inject them at execution time. I would also recommend having a separate activity for executing the data scripts. Updating the Schema and data load should be separate activities.

Categories : Dotnet

F# type matching with ":? Type as name": why do we need a new name?
One obvious reason why you need a new name is when the parameter of match is an expression: match some.Method() with | :? Button -> // What to do here?? Of course, the language could support of the notations. In that case, there is no technical reason why you could not do this, but I think there is a pretty good logical reason for not doing this. Every value in F# has a location where it is

Categories : Dotnet

Reset a .NET dictionary keeping the keys
you can use keys and set all values to null for example var d = new Dictionary<int, string>(); d.Keys.ToList().ForEach(x => d[x] = null); here is a list of extension methods you can use, choose which suites better in your situation and test their performance public static class DictionaryExtensions { public static Dictionary<K, V> ResetValues<K, V>(this Dictionary<

Categories : Dotnet

Certificate to pfx with private key...?
There are two possibilites (starting from less-probable): Certificate's private key uses unsupported by .NET key storage provider to store the keys. For example, Microsoft KSP or its own. There is no private key at all. You can run certutil -store with appropriate parameters (depending on where the certificate is installed) to verify whether there is a private key. Also this command gives you an

Categories : Dotnet

How to add text to image
Your code is correct, but it's missing something. When you modify the viewer's Image member, which is a Leadtools.RasterImage, this is not the image that actually gets displayed. It must first get converted to a WPF ImageSource then stored in the viewer's Source property. When you use one of LEADTOOLS image processing classes, it automatically does this conversion, such as this code: Leadtools.I

Categories : Dotnet

How to use Boost classes in a .NET C++CLI GUI application
The compiler message is clear: you cannot be exporting native DLL entries from a CLR (or mixed mode) assembly. Therefore, the code that specifies __delcspec(dllexport) is outlawed. Boost Serialization is - perhaps - helpfully adding these exportables so that you can define serializable classes in one DLL and deserialize them from another module (based on the runtime type information). However,

Categories : Dotnet

Paypal sandbox all payments are pending and all pending status is unilateral
It seems like the receiver email "Landlordlookup@gmail.com" address you are trying to use doesn't even exist . I mean you need to make sure that you have a sandbox account with the email address "Landlordlookup@gmail.com" . If you send the payments to an email address that doesn't exist , You will get the pending_reason=unilateral

Categories : Dotnet

How to reserve a file name in a thread-safe and process-safe manner
Write the PDF to a temporary file that is guaranteed no to be taken (e.g. using Guid.NewGuid()). Then, rename the file to the desired file name. This rename is atomic. If it fails you can decide what to do. The PDF component only needs to be called once. The rename can be executed multiple times, possibly with different target names.

Categories : Dotnet

Decimal Separator From Control Panel Customize Setting
Set the NumberFormat property of the CultureInfo: Dim myCI As New CultureInfo("en-US", False) myCI.NumberFormat.CurrencyDecimalSeparator = "." Thread.CurrentThread.CurrentCulture = Thread.CurrentThread.CurrentUICulture = myCI

Categories : Dotnet

.NET MVC standards
Your models / viewmodels can be in another class library project as long as that project is referenced by your MVC project. The following post debates the finer points of why you might choose to do this one way instead of the other: ViewModel Best Practices

Categories : Dotnet

Cannot create activex component 64 bit on Win64bit?
Your application is obviously running as 32 bit or the error would occur the other way around. You should either set the "Target CPU" to either "Any CPU" or "x64" if you don't plan on supporting 32 bit OS. [Depending on the version of VS] Open "Project Properties", click the "Compile" tab, then change the "Target CPU".

Categories : Dotnet

No overload for method 'GetActiveInstructors' takes 2 arguments
As indicated by the exception, your method GetActiveInstructors does not expect two arguments. Therefore the exception is caused by this line: var result = context.GetActiveInstructors(txtLastName.Text, txtFirstName.Text).ToList(); Please look at the definition of GetActiveInstructors. Does it expect both a first name and last name, as separate arguments? You either provided an extra argument,

Categories : Dotnet

1MB application using Visual Studio
You need the .Net Framework for c#. No way around it. Most newer versions of Windows come with a version of the .Net Framework so depending on which version you target and which Windows versions you support, you may not need to distribute .Net. Here's a post showing which versions of the framework come on which versions of Windows. http://blogs.msdn.com/b/astebner/archive/2007/03/14/mailbag-wh

Categories : Dotnet

.NET KRuntime as a Windows Service?
There shouldn't be any problem running an app based on the KRuntime (also known as KRE, XRE, etc.) as a service. You may indeed need to wrap it in some container, but ultimately it's just another program. You won't get any service-aware behavior, such as stop notifications, though. But to just run arbitrary code in a service you don't need that.

Categories : Dotnet

Why does "await LoadAsync()" freeze the UI while "await Task.Run(() => Load())" does not?
Even if a method ends with *Async does not mean it is fully async or async at all... Example: public async Task FooAsync() { Thread.Sleep(10000); // This blocks the calling thread return Task.FromResult(true); } Usage (looks like an async call): await FooAsync(); The sample method is completely synchronous even though it returns a task... You need to check the implementation of Load

Categories : Dotnet

.NET String object and invalid Unicode code points
Well i think invalid codepoints within a .NET String can only occur if someone sets an individual element to a hi- or lo-surrogate. It can also happen that someone deletes a hi- or lo-surrogate from a valid surrogate pair, the latter can not just happen by deletion of an element but also by changing the value of an element. In my opinion, the answer is "yes", it can happen and the only reason can

Categories : Dotnet

Permission based authorization .net identity
You can implement your custom AuthorizationAttribute where you will specify your parameters and can get a blogId from request public class AuthorizeEntryPermission : AuthorizeAttribute { public string Permission { get; set; } public AuthorizeEntryPermission(){ } public AuthorizeEntryPermission(string Permission) { this.Permission = Permission;

Categories : Dotnet

Hide main Form on load
You can't do it that way. You have a couple options: 1.) You need to either do what Plutonix said. 2.) Handle the hiding of the main form in an event AFTER loading: Private Sub Button1_Click(sender As System.Object, e As System.EventArgs) Handles Button1.Click Form2.Show() Hide() End Sub 3.) Finally, use an event handler (after it's loaded, itll run events): Private Sub FrmMain_Load

Categories : Dotnet

How to create custom module for Microsoft Navision
You are right that open information on Nav development is rather scarce, and mibuso.com is probably the most active community you can find on the Internet. Development documentation is distributed mostly through the partnersource , but it requires a partner's account to access. Now a lot of documentation is published on msdn, so you could look there. It is not as rich as .NET library, still quite

Categories : Dotnet


Recently Add
Object deserialized from XML has default values for some of the fields
Some bytes missing or added after encrypting/decrypting with RijndaelManaged
QTP How to record context menu
Registering custom URL schemes with ClickOnce installations
It is possible to get any keystrokes in application regardless of active window?
Double.ToString("N") rules on rounding
How to get AD user's 'memberof' property value in terms of objectGUID?
PrintDialog : The calling thread cannot access this object because a different thread owns it
Transaction open for many hours
Import large number of lines from MsAccess in .net fast.
error in datetime with oracle insert statement
AZURE VM scalable design environment for testing
Changing References Folder (Assemblies) to /bin
How to get a value for form active state in vb.net
How to reference and ship an external / third-party .NET DLL with a solution under version control at Visual Studio?
How to set up .net RSA with a specific key?
Windows RT/Universal app, Checking Stock from yahoo finance
POP3/IMAP/SMTP client for asp.net MVC
How to change Custom Control default size
Async & Await to determine when button disable event completed
Getting random stack overflows from Gembox Spreadsheets .NET
MS Release management data release to multiple databases
F# type matching with ":? Type as name": why do we need a new name?
Reset a .NET dictionary keeping the keys
Certificate to pfx with private key...?
How to add text to image
How to use Boost classes in a .NET C++CLI GUI application
Paypal sandbox all payments are pending and all pending status is unilateral
How to reserve a file name in a thread-safe and process-safe manner
Decimal Separator From Control Panel Customize Setting
© Copyright 2017 spot7.org Publishing Limited. All rights reserved.