clr

How do I prevent my SQL statements from SQL injection when using CLR/C++ with multiple variables?

断了今生、忘了曾经 提交于 2020-02-02 13:08:53
问题 I am having a major problem where I do not know how to prevent SQL injection when writing SQL statements in CLR/C++ Below is the code String^ sqlstr = "SELECT * FROM "; sqlstr += tableName + " WHERE " + field + " = " + fieldEntity; I need to be able to input correct SQL Injection preventions to this statement. Background code class database { protected: string fieldEntity; string tableName; string field; ... ____ OleDbDataReader^ openData(String^ fieldEntity, String^ field, String^ tableName)

GCHandle.FromIntPointer does not work as expected

痴心易碎 提交于 2020-02-01 04:53:25
问题 Here's a very simple (complete) program for exercising the use of GCHandle.FromIntPointer: using System; using System.Runtime.InteropServices; namespace GCHandleBugTest { class Program { static void Main(string[] args) { int[] arr = new int[10]; GCHandle handle = GCHandle.Alloc(arr, GCHandleType.Pinned); IntPtr pointer = handle.AddrOfPinnedObject(); GCHandle handle2 = GCHandle.FromIntPtr(pointer); } } } Note that this program is essentially a transliteration of the procedure described in

SQL CLR: Streaming table valued function results

流过昼夜 提交于 2020-01-31 18:16:27
问题 My issue is very similar to this issue. However, I'm using SQL Server 2005 Service Pack 2 (SP2) (v9.0.3042) and the solution posted there does not work for me. I tried using both connection strings. One is commented out in my code. I realize I can store all the results in a List or ArrayList in memory and return that. I've done that successfully, but that is not the goal here. The goal is to be able to stream the results as they are available. Is this possible using my version of SQL Server?

Difference between CLR 2.0 and CLR 4.0

断了今生、忘了曾经 提交于 2020-01-30 14:23:07
问题 I have read countless blogs, posts and StackOverflow questions about the new features of C# 4.0. Even new WPF 4.0 features have started to come out in the open. What I could not find and will like to know: What are the major changes to CLR 4.0 from a C#/WPF developer perspective? What are the major changes to CLR 4.0 as a whole? I think, internally, most changes are for the new dynamic languages and parallel programming. But are there any other major improvements? Because language

How to create a dump of the current ASP.NET managed process for debugging?

若如初见. 提交于 2020-01-24 00:25:09
问题 I'm attempting to debug an ASP.NET application. It's particularly difficult as the bug only occurs in the released code deployed to production . It cannot be reproduced in the development or test environments. I'd like to investigate further by creating a dump file at a particular line in the code where the problem is happening. However the production environment cannot be taken down at any point due to business requirements. That's also why remote debugging can't be used. Does anyone know

OutOfMemoryException when a lot of memory is available

ぃ、小莉子 提交于 2020-01-22 17:23:10
问题 We have an application that is running on 5 (server) nodes (16 cores, 128 GB Memory each) that loads almost 70 GB data on each machine. This application is distributed and serves concurrent clients, therefore, there is a lot of sockets usage. Similarly, for synchronization between multiple threads, there are a few synchronization techniques being used, mostly using System.Threading.Monitor . Now the problem is that while application is running and the data is traveling between these server

What kind of problem can cause a TypeLoadException?

◇◆丶佛笑我妖孽 提交于 2020-01-21 06:13:56
问题 I have a big and bloated software and I want to add a new GUI element to it. The GUI element was written using XAML and WPF. I created the UI element in a separate assembly, and reference it in the big software. The two projects compiled smoothly under VS2010, but when I run my application I get a TypeLoadException . Looking into the exception with the debugger, I get the following message : Could not load type GUI.Dashboard from assembly GUI, blah, blah . There is no InnerException nor any

What kind of problem can cause a TypeLoadException?

大兔子大兔子 提交于 2020-01-21 06:12:47
问题 I have a big and bloated software and I want to add a new GUI element to it. The GUI element was written using XAML and WPF. I created the UI element in a separate assembly, and reference it in the big software. The two projects compiled smoothly under VS2010, but when I run my application I get a TypeLoadException . Looking into the exception with the debugger, I get the following message : Could not load type GUI.Dashboard from assembly GUI, blah, blah . There is no InnerException nor any

How to get MFC serialization going without a CWinApp-derived class?

送分小仙女□ 提交于 2020-01-17 06:04:19
问题 I am writing a C++/CLI wrapper for an old MFC application, so far i have been able to read most of the data and convert the same into C# readable format. As of now i am only struggling with reading data and am worried will writing data back to old MFC code affect serialization ? Can you guys share/mention any other risks i might face while writing C++/CLI wrapper for MFC code ? Thanks for your inputs. this question is a continuation of "Redirecting data from MFC CArchive to boost::archive:

Inheritance between clr project dlls

五迷三道 提交于 2020-01-15 11:44:07
问题 I have an abstract base class which is written with c++/cli. This class is located in a project. And i have other projects which inherit the abtract base class. So, the structure is like the following. Base Project: public ref class Base abstract { // implementation virtual CommonFunc(); }; public delegate void Foo(); Derived Project A: public ref class A : public Base { // implementation }; Derived Project B: public ref class B : public Base { // implementation }; And, so on. I can call both