c#,asp.net-mvc,jsonRelated issues-Collection of common programming errors
Danzomida
c# database-connection connection-string sqlanywhere sybase-iq
I’m trying to create an SAConnection into a Sybase IQ database. I’m attempting to create the connection through a simple visual studio C# application.My code fails at: SAConnection connection = new SAConnection(connString);And pops up with a message box: SQL Anywhere ADO.NET DataProviderFailed to load native dll (C:\Users\<Username>\AppData\Local\Temp\{16AA8FB8-4A98-4757-B7A5-0FF22C0A6E33}_0\dbdata.dllLink to picture of messageboxThe code subsequently throws an exception: “The type initial
Xcelled194
c# c++ winapi dll
This a question arising from this thread: Native C++ use C# dll via proxy C++ managed dllIn a nutshell, I’m loading (my) C# extension into a native process via a DLL. The extension needs to show a form so that the user can control it. I’m using standard .NET forms, no 3rd party librarys or anything, and my form is not showing up. Worse yet, it hangs the target process. It’s not using any CPU, so I get the feeling its waiting for some function to return, but never does.Also of interest is that th
user75569
c# c++ windows-mobile native
I have a windows mobile solution which contains two projects. One written in C# and another in C++ (unmaneged code that compiles into a dll). The part written in C# invokes some C++ functions from dll to connect to a server.If I open my application and I connect to the server everything works ok. If I minimize it , or if I open another windows mobile application over my application and try again to connect to the server it fails with a native exception code. (Exception code: 0xc000001d.)Any ide
torrential coding
c# visual-studio-2010 dllimport
I have used DLL Export viewer to try and find the functions that are in this DLL, I have found a list of functions and here it is:public: int __thiscall CSTVdsDisk::GetPartitionCount(void);the question is within in C# I am not able to call the function using either: [DllImport(“Some.dll”, ExactSpelling = true,EntryPoint = “GetPartitionCount”,CallingConvention = CallingConvention.StdCall,SetLastError = true)]or:[DllImport(“Some.dll”, ExactSpelling = true,EntryPoint = “CSTVdsDisk::GetPartitionCoun
krishna555
c# visual-c++ c++-cli
i have written a c++/cli program which calls my native c++ function which has the struct pointers as parameter to it. so its like i wrote a wrapper for my native c++ using c++/cli so that i can expose it to c# wcf program(which acts a server to another c++ client). now when i compile my c++/cli program, i didn’t get any errors and it got compiled and the dll for this c++/cli is generated, but when look at output window i see some thing like this failed in linking(which didn’t effect the compilat
Seth
c# c++ interop c++-cli
I have a mixed mode dll with native dll dependencies.I am loading the mixed mode dll from a C# exe using Assembly.Load. However, the location of the mixed mode dll is not in the application bin directory, therefore it fails because it only looks for the native C++ dll’s in the bin and the folders in the PATH environment variable.I thought using the option /assemblylinkresource was suppose to stop this and force the native dll’s to be found in the alternate directory alongside the deployed mixed
user3220513
c# c++ wcf
I run a WCF-Service in IIS-Express 8.0 and use Visual Studio 2010. The service calls a C++/CLI Wrapper, which calls the native C++ dll. If I start the client (C# Application), I am able to debug client, service and wrapper. If I try to step from the wrapper into the native C++ – Code, I fail. But from the return code I can see, that the function in the native C++ dll was called. In Addition: The native C++ dll is delay loaded from a path, I configure in the service via Global.asax-File. I also
Stormenet
c# winforms compact-framework formborderstyle
On a WindowsCE platform (custom build) our C# gui uses regular forms to show an “popup menu”. We set the FormBorderstyle to None as we don’t want the form controls to be visible.Some clients reported “Gray boxes” after a while. After some testing here we could reproduce the problem quite fast. When we open 2 different menu’s (forms) constantly the platform shows us an native exception.ErrorA native exception has occurredin Tiger.CEHost.exe. Select Quit andthen restart this program, or selectDeta
Kasper Hansen
c# fusion
I have installed a Windows service via a new MSI build. But the service just finishes going through the constructor before stopping without explanation. I get the following in the fusion log:*** Assembly Binder Log Entry (2013-07-17 @ 12:48:29) ***The operation failed. Bind result: hr = 0x80070002. The system cannot find the file specified.Assembly manager loaded from: C:\Windows\Microsoft.NET\Framework64\v2.0.50727\mscorwks.dll Running under executable C:\Program Files\SoW\Market Communicato
Tyler Durden
c# arrays pinvoke
I am completely confused with how to go about calling functions in native dll with array arguments.Example:The function is defined in the C# project as:[DllImport(“Project2.dll”, SetLastError = true, CallingConvention = CallingConvention.Cdecl)] static extern void modifyArray([MarshalAs(UnmanagedType.LPArray)] int[] x, int len);And the function call is:modifyArray(arr, 3)where arr = {4,5,6}The native C++ function definition is as follows:extern “C” _declspec(dllexport) void modifyArray(int* x,in
Noel
c# asp.net-mvc asp.net-mvc-4 asp.net-web-api asp.net-web-api-routing
I created a new ASP.NET MVC4 Web Api Project. In addition to the default ValuesController, I added another controller, ScenarioController. It has the exact same methods as ValuesController. But for some reason, it behaves differently./api/values/ => “value1″,”value2” /api/values/1 => “value” /api/scenario/ => “value1″,”value2” /api/scenario/1 => “value1”,”value2″^^^^^^^^^^^^^^^^^should return “value”!Using breakpoints, I know that /api/scenario/1 actually gets sent to the public IEnu
Muaz Khan
asp.net-mvc
I’ve got an unexpected situation when using Remote Attribute in ASP.NET MVC3. The model type I used:using System; using System.Web.Mvc; using System.ComponentModel.DataAnnotations;namespace dTweets.Models {// at first time, user should create his account with unique username// as in twitter.com, user dopublic class UserMetadata{[HiddenInput]internal int Identity { get; set; }[Remote(“IsUserExist”, “Account”)] // at any HttpPost, username should// be unique – not appropriate if // updating/editin
Rudi Visser
asp.net asp.net-mvc asp.net-mvc-2 asp.net-mvc-4
In ASP.NET MVC 2, the lifespan of an entry in the TempDataDictionary was just one HTTP Request.That translated to setting a value in one request, redirecting, and having access to the same item at the other end of the line. After this the entry would be no longer available, regardless of whether you read the value out of the dictionary at the latter end of the line or not.Since ASP.NET MVC 3 (I believe), this implementation detail has changed quite significantly.Entries in the TempDataDictionary
Martin Devillers
c# .net asp.net-mvc asp.net-web-api asp.net-mvc-areas
I am currently working on a ASP.NET MVC 4 Web Application project that must adhere to the following design decisions:The main MVC application resides in the root of the solution. All administrator functionality resides in a separate area. Each external party (e.g. suppliers) has its own area. Each area, including the root, constitutes a well separated functional block. Functionality from one area may not be exposed to another area. This is to prevent unauthorized access of data. Each area, inclu
abatishchev
c# ajax asp.net-mvc http-post
This behavior is making me wonder about my sanity..I have a form that has two places that accept input, let’s call them ValueA and ValueB. The user can enter a value in either one and the form submits.<div id=”MyUpdateTarget”><% using (Ajax.BeginForm(“MyControllerAction”, new AjaxOptions { UpdateTargetId = “MyUpdateTarget” })) { %><%=Html.TextBox(“ValueA”, Model.ValueA, new Dictionary<string, object> {{ “onchange”, “$(‘#SubmitButton’).click(); return false;” },}) %><%=
bigmac
asp.net-mvc log4net ninject
I am trying to properly use Ninject to inject log4net logging into my MVC3 application. I am using the Ninject.MVC3 package, so I have the NinjectMVC3 class that automatically extends the App_Start method and contains the RegisterServices method that binds all dependencies. I also have the Ninject.Extensions.Logging.Log4Net package, but I don’t know how to use it. I already know how to configure log4net in my web.config, but don’t know how to use this extension for DI.I have read all the foll
Carl Manaster
asp.net-mvc unit-testing tdd
So I want to learn a little bit of TDD and wanted to see if I could test an Index action which should simply return a View.The test doesn’t pass and the error isTest methodSummumnet.Tests.Controllers.PhysicalTestsControllerTest.IndexShouldReturnViewthrew exception: System.ArgumentException: Expression is not aproperty access: c => c.FindById(1)Here’s my controller action code:[Authorize][AllowedToEditEHR]public class PhysicalTestsController : Controller{private IUnitOfWork unitOfWork;private IR
Runscope API Tools
asp.net-mvc linq-to-sql
This is a little out there but I have a customer object coming back to my controller. I want to just reconnect this object back to the database, is it even possible? I know there is a datacontext.customers.insertonsubmit(customer), but is there the equivalent datacontext.customers.updateonsubmit(customer)???
TomHastjarjanto
c# .net asp.net-mvc
My question actually consists of multiple questions. I’m frequently reading about companies who deploy a small subset of features for a select amount of customers using the live “database”. Ruby on Rails and its ecosystem have deployment tools and database migrations to deploy or rollback such features in a live production or staging environment.My question, how is this done for an asp.net (mvc in particular) application? How do you test your newly released features against live data? Do you hav
SamWM
asp.net-mvc subsonic t4
In Visual Web Developer Express 2008 the SubSonic ASP.NET MVC template doesn’t seem to work with a new database I added. I removed the Chinook Database and created my own one. I understand the the .tt files in the Models folder are used to generate code, but they don’t (despite changing the ConnectionStringName to what I set in the web.config)Right clicking on each .tt file and selecting ‘Run Custom Tool’ does not generate anything, except an error message:Cannot find custom tool ‘TextTemplating
user2955302
ruby json gem install devkit
I installed 1.9.3 ruby from http://dl.bintray.com/oneclick/rubyinstaller/rubyinstaller-1.9.3-p448.exe to C:\Ruby193.I downloaded https://github.com/downloads/oneclick/rubyinstaller/DevKit-tdm-32-4.5.2-20111229-1559-sfx.exe to C:\ruby_dev_kit and from there ran ruby dk.rb init then ruby dk.rb installIt all installed successfully.Then when I ran gem install json I keep getting Installing json (1.4.6) The system cannot find the path specified.Gem::Installer::ExtensionBuildError: ERROR: Failed to bu
user984621
ruby-on-rails ruby json amazon-ec2 bundle
I just deployed some new code (only some text update in views) and while processing the command cap deploy, I got following error message:** [out :: IP] Gem::Installer::ExtensionBuildError: ERROR: Failed to build gem native extension.** [out :: IP]** [out :: IP] /usr/local/bin/ruby extconf.rb** [out :: IP] creating Makefile** [out :: IP]** [out :: IP] make “DESTDIR=”** [out :: IP]** [out :: IP] Gem files will remain installed in /home/deployer/fileto/shared/bundle/ruby/2.0.0/gems/json-1.8.1 for
Simon Reed
ruby-on-rails json ruby-on-rails-3 gem bundler
I’m running bundle install on my staging environment on my Ubuntu machine. It keeps failing trying to install json 1.4.6 with the native extensions. Using bundler (1.0.7) Installing thor (0.14.6) Installing railties (3.0.3) Installing rails (3.0.3) Installing geokit-rails3 (0.1.2) Installing json (1.4.6) with native extensions /usr/local/lib/site_ruby/1.8/rubygems/installer.rb:483:in `build_extensions’: ERROR: Failed to build gem native extension. (Gem::Installer::ExtensionBuildError)/usr/b
John Yeung
ruby json ruby-on-rails-3 rubygems bundler
I was trying to fix a strange problem in Rails so I resorted to uninstalling all the gems (using a command found here: http://geekystuff.net/2009/01/14/remove-all-ruby-gems/) and then running bundle install.The removal was successful, but when I ran bundle install, I got the following error:Installing activeresource (3.2.13)Using bundler (1.3.5) Installingrack-ssl (1.3.3) Installing json (1.8.0)Gem::Installer::ExtensionBuildError: ERROR: Failed to build gem nativeextension .c:/RailsInstaller/Rub
Chopper_5
javascript json internet-explorer parsing
I am using JSON3 and in Internet Explorer the Parse method fails the feature tests (as discussed here), I am just wondering if someone could explain what impact it could have if I use JSON2, which would use the native parsing in IE?I assume that it could cause some issue at some point, I just don’t know what it could be? Ideally I want to use the native IE parse method because the performance improvement is fairly significant, I just don’t want to run into problems down the road.Any help would b
Salahuddin559
rhel gem json
When I try to install json gem (gem install json), at first it fails to do so, because of some dev package issue. After fixing it, it fails saying that “sh: make: command not found” and “ERROR: Error installing json: ERROR: Failed to build gem native extension.”. Why is it failing on make? Notice this is not Mac, this is in RHEL 5 (4 or 5, not sure). Why is it not able to do some “build gem native extension”?
John
iphone json http post
Hi I need help in making a HTTP POST connection to a web service. I am totally clueless on how to do it. I only had experienced in making a NSURLConnection whereby I pass the required input parameters as part of the URL. Now it seems different as I am only provided a website and the request JSON body.{ “lastmodified”:”String content”, “passengerId”:9223372036854775807, “password”:”String content”, “userId”:”String content” }Could anyone shed some light on this? Say the website is www.myURL/opera
leemes
c++ json qt parsing qt5
I have a string which contains (not is) JSON-encoded data, like in this example:foo([1, 2, 3], “some more stuff”)| |start end (of JSON-encoded data)The complete language we use in our application nests JSON-encoded data, while the rest of the language is trivial (just recursive stuff). When parsing strings like this from left to right in a recursive parser, I know when I encounter a JSON-encoded value, like here the [1, 2, 3] starting at index 4. After parsing this substring, I need
huzeyfe
json oop playframework
I am using Play Framework 1.2.4 with Java and using JPA to persist my database objects. I have several Model classes to be rendered as JSON. But the problem is I would like to customize these JSON responses and simplify the objects just before rendering as JSON.For instance, assume that I have an object named ComplexClass and having properties id, name, property1,…,propertyN. In JSON response I would like to render only id and name fields.What is the most elegant way of doing this? Writing cus
sreeraag
json jackson
I’m trying to recursively parse a sample Json file that has many sets of complex elements. And the code that i’m trying is this : public class Jsonex {public static void main(String argv[]) {try {Jsonex jsonExample = new Jsonex();jsonExample.testJackson();} catch (Exception e){System.out.println(“Exception ” + e);} }public static void testJackson() throws IOException { JsonFactory factory = new JsonFactory();// System.out.println(“hello”);ObjectMapper mapper = new ObjectMapper(factor
Web site is in building