compact-framework

C#/SQL - What's wrong with SqlDbType.Xml in procedures?

非 Y 不嫁゛ 提交于 2019-12-17 17:05:27
问题 I've asked few people why using xml as a parameter in stored procedure doesn't work and everyone said , that's just the way it is. I can't belive that. command.Parameters.Add("@xmldoc", SqlDbType.Xml); That's where compiler returns error and I can't use NVarChar beacouse it's limiteed to 4k sings. XML would be perfect as it can be 2gigs big. How come other SqlDbTypes work well and this one retruns error ? * Error: Specified argument was out of the range of valid values. Parameter name:

failing to compile a project, missing io.h file

ε祈祈猫儿з 提交于 2019-12-17 17:05:09
问题 I fail to compile a C++ project for mobile device with Windows Mobile (Windows CE-based) operating system and Visual C++ compiler from Visual Studio fails with: Error 1 fatal error C1083: Cannot open include file: 'io.h' EDIT I am trying to compile the SQLite amalgamation, the shell.c file includes the call to this io.h but the io.h is missing from the files. I googled and I couldn't locate how can I get this .h file. Can someone point me in the right direction? 回答1: The io.h file is not

How to lock file

假装没事ソ 提交于 2019-12-17 16:32:57
问题 please tell me how to lock file in c# Thanks 回答1: Simply open it exclusively: using (FileStream fs = File.Open("MyFile.txt", FileMode.Open, FileAccess.Read, FileShare.None)) { // use fs } Ref. Update : In response to comment from poster: According to the online MSDN doco, File.Open is supported in .Net Compact Framework 1.0 and 2.0. 回答2: FileShare.None would throw a "System.IO.IOException" error if another thread is trying to access the file. You could use some function using try/catch to

PBKDF2 in Bouncy Castle C#

穿精又带淫゛_ 提交于 2019-12-17 16:08:40
问题 I've being messing around the C# Bouncy Castle API to find how to do a PBKDF2 key derivation. I am really clueless right now. I tried reading through the Pkcs5S2ParametersGenerator.cs and PBKDF2Params.cs files but i really cant figure out how to do it. According to the research I have done so far, PBKDF2 requires a string (or char[]) which is the password, a salt and an iteration count. So far the most promising and most obvious i've come so far is the PBKDF2Params and

How do I continue running after an unhandled exception?

我怕爱的太早我们不能终老 提交于 2019-12-17 14:14:10
问题 I have the following code in my application that is running after an unhandled exception: AppDomain.CurrentDomain.UnhandledException += new UnhandledExceptionEventHandler(CurrentDomain_UnhandledException); static void CurrentDomain_UnhandledException(object sender, UnhandledExceptionEventArgs e) { var exception = e.ExceptionObject as Exception; if (exception != null) MessageBox.Show(exception.Message + " - " + exception.StackTrace); } but even if i catch unhandled exception my windows mobile

Is there a library to read JSON in C# on Windows Mobile? [closed]

心不动则不痛 提交于 2019-12-17 13:53:30
问题 Closed. This question is off-topic. It is not currently accepting answers. Want to improve this question? Update the question so it's on-topic for Stack Overflow. Closed 5 years ago . I am trying to find a library to parse JSON on C# on Windows Mobile (working with Visual Studio 2005). The libraries that I have found that allow me to parse JSON in C# (litjson and Jayrock) don't work on Windows Mobile, they require classes that are not present in the .NET compact framework. Is there any

Developing .NET Compact Framework apps in Post-2008 Visual Studio?

放肆的年华 提交于 2019-12-17 08:53:32
问题 I want to develop a Compact Framework App for a Windows CE 6.0 target device. Can I do this with Visual Studio 2013? If this is not possible, what would be a development environment for .net compact framework? 回答1: I'm positive this question is a duplicate, but for the life of me I can't find the original so I'll re-answer here. Microsoft's support for Compact Framework development is not completely obvious or well documented. It's a mixed matrix of the target version of Windows CE, the

How best to read a File into List<string>

六月ゝ 毕业季﹏ 提交于 2019-12-17 06:37:10
问题 I am using a list to limit the file size since the target is limited in disk and ram. This is what I am doing now but is there a more efficient way? readonly List<string> LogList = new List<string>(); ... var logFile = File.ReadAllLines(LOG_PATH); foreach (var s in logFile) LogList.Add(s); 回答1: var logFile = File.ReadAllLines(LOG_PATH); var logList = new List<string>(logFile); Since logFile is an array, you can pass it to the List<T> constructor. This eliminates unnecessary overhead when

Using OpenNETCF.Net.Ftp inside a class instead of inside a Windows Form

拥有回忆 提交于 2019-12-14 04:03:53
问题 So far I am using an FTP object inside a Windows form. FTP object runs in a separate thread, so to ensure that my app doesn't freeze up, I use the following piece of code: private void OnResponse(string response) { if (this.InvokeRequired) { this.Invoke(new StringDelegate(OnResponse), new object[] { response }); return; } } //end of OnResponse I am not completely clear on what a string delegate is, but this works. However, I am now refactoring and wish to hide the ftp into a class. My

Unable to use Environment.GetResourceString static method

喜你入骨 提交于 2019-12-14 03:53:01
问题 using System; using System.Collections.Generic; using System.Linq; using System.Text; namespace ConsoleApplication { class Program { static void Main(string[] args) { var x = Environment.GetResourceString("test"); //compile-time error } } } The error is: 'System.Environment' does not contain a definition for 'GetResourceString'. EDIT : OP has stated that he's using the Compact Framework, v3.5. I dont get the picture, what's wrong with my code? Thanks! 回答1: Environment.GetResourceString