The following JSON call always hits the AJAX error handler, and I can't figure out why:[code]All I get is Failed to load resource: the server responded with a status of 500 (Internal Server Error)url...When I set a breakpoint in the controller, I can see that it's being reached, so I'm not sure where the request is falling down. Here's the action in the DetailController:[code]
My ASMX call is returning Content-Type = text/xml; charset=utf-8 I am using ASP.NET 3.5 and jQuery.Ajax. Have added these things are per numerous suggestions from Stack Overflow. I have done these things
Done this at web.config <remove verb="*" path="*.asmx"/> <add verb="*" path="*.asmx" validate="false" type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/> [Code] .....
But whatever I do, the response header is still of type xml. What part am I missing here?
I am been stuck on this for 3 days now...I have been accessing the twitter api to pull a user_timeline for a list of users and the json that comes back is impossible to work with. I tried to deserialize it using javascriptserializer and get an error:invalid object passed in , ':' or '}'
Now this is frustrating since I expect the json being returned to be error free. Then I tried json.net and split the posts using string.split and tried to convert each post to Jobject or jarray. for Jarray I get
'unexpected end of content while loading jArray
[Code]...
Now I have formatted the code here and not pasted the whole file but it does look like valid json to me and I do not alter anything after receiving the stream from the twitter api. Can someone please point me in the right direction? I really need to get this stuff parsed?
how to receive and send back json. Hope someone can help me on this. I understand by examples.
On my clientside, I am sending a ajax json string "name":"theName" to the server side and would like the server side to return a string saying "welcome &name ".
{"AliasName": "ysiCountryInfo", "DataClass": {"Description":"United States 111","Code":"usa","WriteOffTaxPointAdjustment":0,"IndexationRounding":6}} I would like to deserialize object into below class
I have a JSON response from a web service that I need to be converted to an object then to an array. My response is similar to the one below:
{"status":{"error":"NO","code":"200","description":"none","message":"Request ok"},"geolocation":{"lat":"38.89515","lng":"-77.0310"},"stations":[{"country":"United States","regPrice":"0.00","midPrice":"0.00","prePrice":"0.00","streetAddress":"1401, I St[code]....
I am doing this is VB.NET within a console for now. Basically I am trying to create a simple way to test my API calls and output the information. What I am trying to accomplish is having to loop through the JSON array and list the stations.
I'm using Microsoft Visual Studio 2010 Express: the C++ and VB versions.
There is some VB code that forms the body of a program, and all the GUI.There is also some C++ code that does some fast processing (lots of loops).
I am trying to call the C++ code, compiled as a dll, using:
Private Declare Sub CalcGraph Lib "Model.dll" ()
And at the moment keep getting the error: Unhandled exception has occurred in your application. Unable to find an entry point named 'CalcGraph' in DLL 'Model.dll'I'm fairly new to programming, so please be patient with me That said, I'm prepared to do the leg-work, and have already spent quite a while reading around on this and other sites. Nothing seems to match quite well enough to help me understand what's going wrong.
Is there a way to call a procedure in Visual Basic (.net) with a variable name? For example, the variable strColour can be one of 10 pre-defined values, green blue black white red pink orange yellow indigo purple. How to handle each one is in it's own Sub Routine, colgreen, colblue, colblack and so on.
I can use a bunch of if..then..else and select case, but what I'd like to have is something like VBA Excel's Run "col" & strColour
How can I convert a JSON string to an array OR a JSON string to XML in VB.NET? I know how to do this in C#, as I have read dozens of articles on it, however, I am unable to figure out how to achieve the same result in VB.NET.
I'm using the System.Web.Script namespace via System.Web.Extensions.dll (from Microsoft).
I'm willing to use an additional DLL file if needed.
I'm sure this has been asked before but I'm not finding quite the information I'm needing so I thought I'd post this.
I've written a PHP script that returns a simple JSON object that looks like this:
{"status":"success","level":"admin"}
I'm doing a standard web request that submits the required data to the script over the internet and that's working fine.
Now, I want to use JSON.NET to pull out the individual variables so I can know what the values of "status" and "level" are. The problem is, I have no idea where to start.
I'm doing this in VB.NET (on the .NET Compact Framework).
I am using SendInput to send some keyboard commands to a dialog box. It is already the active foreground window when I call SendInput. I first send "Return" and then a bunch of other stuff. The dialog box opens with a button selected by default, and when manually selecting Enter, the button is clicked on the dialog progresses to the next screen, but my SendInput call doesn't advance the dialog.
I have a sub procedure called ServiceCharge in the CheckingAccount Class now I am trying to call it from the CheckingAccountForm Class but its not cooperating Here is my code I put a bunch of and comments where I want to call the Sub Procedure
I am working to make a function that will update the back color of a text box based on multiple variables values. I can write the code to do the calculation, but I am not sure how to make the function realize which text box to update (as I will have about 30 different boxes). Below is the code that I have for each box so far, but I will have quite a few more, and would rather use a function to reduce the amount of code, and also make it cleaner as well.
If sngPreviousPrimaryPropertyTotal >= sngPrimaryPropertyTotalCost Then txtPreviousPrimaryPropertyTotal.BackColor = ColorProgramLightGreen Else txtPreviousPrimaryPropertyTotal.BackColor = ColorProgramLightRed End If [Code] .....
Or is there a way that I can tell the function that it's updating the text box that call the function in the first place? Say if txtBox1 has updated text and calls the function, then the function 'knows' to update txtBox1, but will update txtBox2 when it's called by txtBox2.
I am getting the following message in VS 2005 Standard Edition using VB for a Windows Form Application:Microsoft (R) Visual Basic Compiler has Stopped Working.A problem caused the program to stop working correctly.Windows will close the program and notify you if a solution is available.<Debug> <Close Program>Clicking on either Debug or Close Program shuts down Visual Studio.Happens when pasting code from 1 form into another. Seems random but usually about 5-7 pastes or every 10-15 minutes.I have looked at FIX: The Visual Studio 2005 IDE may randomly crash when you build a Visual Basic .NET solution (Article 942124) but it states this should happen when doing a Build or Rebuild.The Workaround says:To work around this problem, use the whole project as the reference.What exactly does this mean and how would I do this?Installed Products:
Microsoft Visual Studio 2005Version 8.0.50727.867 (vsvista.050727-8600)Microsoft .NET FrameworkVersion 2.0.50727 SP1 Installed Edition: Standard Microsoft Visual Basic 2005 77633-235-2833766-41228Microsoft Visual Basic 2005 Microsoft Visual C# 2005 77633-235-2833766-41228Microsoft Visual C# 2005
I am trying to make a project for point of sale and i am having issues with updating inventory table. once cashier make sale items quantity should get subtracted from inventory table. i tried bellow code but it is not updating table, however in message box it does give me new quantity for that item.
in this last weeks i've tried to discover how to use data usin' WPF's. So, in resume, i know how to use data in VB Windows Forms Application Projects, using SQL or Access Files connections.But in WPF and Silverlight i dont know how to bind database. In order to show, per example, data in a datagrid. Or in A Combo.
I have a button on a form that is supposed to run an executable (compiled Intel Fortran v11) on the click event. Here is the code:
Private Sub RunButton_Click() Handles RunButton.Click Try System.Diagnostics.Process.Start("C: estDir estCode.exe")
[Code]....
I'm certain the path is correct and I have verified that running the testCode.exe from the cmd window works as it should (testCode.out file is updated). When I try to run the process via the RunButton it appears to work...no errors are reported or caught. However, the expected output file is not updated indicating testCode.exe did not execute. All of the online support I have researched indicates this should work.
cmd.CommandText = "SELECT * FROM [strfg].[dbo].[Myfunc] (@MyParam)" Dim myparam As New SqlParameter("@MyParam", a) cmd.Parameters.Add(myparam)
The function (runnig on SQL server) returns a table with four columns, one row.How do I call this function from Visual Basic? cmd.ExecuteScalar() is obviously not correct. In c++ I use a recordset. What is the equivalent in vb? Does anyone have a short example?
I am using $.ajax call for download excel from .aspx page. But ajax throwing an error after Response.End. This is the code I used. Control is processing till Response.End() then alert(textStatus); giving parser error.
I am using Compact Framework 3.5 on a Symbol MC50.In my Sub Main it first checks to see if a database exists. If it does, it shows a login screen using the following code:
Dim login As frmLogin = New frmLogin() If login.ShowDialog() = DialogResult.OK Then Application.Run(New frmMain()) End If
This all works correctly and, when I close frmMain, it exits the application as expected.However, if the database check in Sub Main fails, I call the ShowDialog() method of another form that is used to create and fill the database from a live server. Here is the code for calling this form:
If Not File.Exists(SETTINGS_LOCALDB) Then databaseExists = False MessageBox.Show("Local DB does not exist. The database must be created before using the application.")[code].....
All of this code is being hit and frmMain does indeed load. However, when I click the close button in the top right nothing happens, no event occurs. Its as though the Windows events are not occurring.
I am using $.ajax call for download excel from .aspx page. But ajax throwing an error after Response.End. This is the code I used. Control is processing till Response.End() then alert(textStatus); giving parser error.
I'm working on my first Visual basic program and I've hit a snag. I want to make a working search form that pulls data from an access database that i already have linked into my visual basic program.
Basically when they click search, i wan't it to check the textbox (lets say firstName.text box for now) for there name, then find all the entries in my database that have those names and display them in a grid.
I am accessing the facebook api and using the json.net library (newtonsoft.json.net)I declare a Jobject to parse the content and look for the specific elements and get their values. Everything works fine for the first few but then I get this unexplained nullexception error " (Object reference not set to an instance of an object)Now I took a look at the declaration but cannot see how to change it. Dim jobj as JObject = JObject.Parse(responseData) message = jobj("message").tostring
The error occurs at the last line above.I check to see if message is null and then look for the next desired field as follows
[Code]...
This is one example where "message" does not appear in the first few lines but appears later. So what I do is look for position of message and description and which ever is first go and get that and if I get an error or the fields do not return anything, I try and parse by regex and even that is not working right.