Why Is Basic Json Call Not Working

Nov 7, 2011

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]

View 1 Replies


ADVERTISEMENT

.net - JSON.Net VB Deserialize Not Working?

Mar 18, 2011

I'm new to VB and trying to write a webservice that exports and imports JSON.I'm using JSON.NET 3.5 and can serialize fine:My Token class is:

<DataContract()> _
Public Class Token
<DataMember()> _
Public TokenID As String
<DataMember()> _
Public Issued As Date

[Code]...

View 1 Replies

JSON.Net VB Deserialize Not Working?

Mar 3, 2009

I'm new to VB and trying to write a webservice that exports and imports JSON.I'm using JSON.NET 3.5 and can serialize fine:

My Token class is:
<DataContract()> _
Public Class Token

[code].....

View 4 Replies

ASMX Call - Returning Response Header As XML Instead Of JSON

Dec 29, 2011

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?

View 1 Replies

Twitter Json - Unable To Convert To Jobject Or Jarray Using Json.net / Javascriptserializer?

May 9, 2012

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?

View 1 Replies

JSON.NET Deserialize - Next JSON String - Returns Always An Empty Result

Feb 21, 2011

I'm strugling the whole day with the next JSON string

{
"0":{"link":"afbeeldingenplaatje1.jpg"},
"1":{"link":"afbeeldingenplaatje2.jpg"},
"2":{"link":"afbeeldingenplaatje3.jpg"}
}

How can i deserialize this? What's wrong with the next code (vb.net)

Public Class DataString
Private m_link As String
Public Property link() As String
Get

[CODE]...

It returns always an empty result.

View 1 Replies

Receiving Json And Send Back Json On Server-side?

Jul 28, 2011

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 ".

Client-side code
<!DOCTYPE html>
<html>

[Code]....

View 2 Replies

Deserializing JSON Into Byrefrence ParametrizedConstructor Object With Json?

Nov 12, 2010

Below is my JSON formated String

{"AliasName": "ysiCountryInfo", "DataClass": {"Description":"United States 111","Code":"usa","WriteOffTaxPointAdjustment":0,"IndexationRounding":6}}
I would like to deserialize object into below class

[code].....

View 1 Replies

Convert JSON String To JSON Object?

Jan 18, 2012

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.

View 3 Replies

How To Call A C++ Dll File From Visual Basic 2010

Mar 9, 2012

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.

View 3 Replies

Visual Basic .net - Call Procedure From A Variable Name?

Jan 19, 2010

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

View 5 Replies

Convert JSON To Array OR JSON To XML?

Jul 17, 2011

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.

View 1 Replies

Using JSON.NET To Parse JSON Generated Through PHP?

Mar 2, 2010

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).

View 1 Replies

Why Is Call To SendInput Not Working

Jul 17, 2009

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.

[Code]...

View 1 Replies

Insert Image In Microsoft Access And Call In Visual Basic?

Dec 6, 2010

HOW i insert image in microsoft access and how to call in visual basic

View 1 Replies

Working With SQL Databases In Visual Basic.NET?

Aug 25, 2010

Is SQL Server 2008 Express work with visual basic 2005, i want to use it because the maximum size of its database 10 GB

View 1 Replies

Call A Sub Procedure From Another Class But Its Not Working?

May 26, 2009

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

[Code]...

View 2 Replies

Function Call For Multiple Textboxes Using Visual Basic Studio 2008

Feb 17, 2010

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.

View 3 Replies

How To Call WPF MediaElement From Windows Forms Application In Visual Basic 2010

Oct 23, 2010

I am a novice in programming and wrote several simple Windows Forms applications. I need to play mp3 file in Windows 7 x64 application.

Could you, please, explain in simple words, how to call MediaElement.Play() method from Windows Forms?

View 8 Replies

IDE :: Visual Basic Compiler Has Stopped Working?

Aug 13, 2008

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

[code]....

View 7 Replies

UPDATE Query In Visual Basic Not Working?

Apr 20, 2012

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.

[Code]...

View 2 Replies

Visual Basic 2010 Calculator Not Working

Sep 14, 2011

I am slowly learning to program in visual basic and just spent the past 5 hours trying to fix this but just cant.

View 8 Replies

Working With Databases In Visual Basic .Net And WPF's Or Silverlight?

Jun 5, 2009

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.

View 4 Replies

Call To Fortran EXE From VB Express 2010 Not Working

Apr 27, 2012

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.

View 8 Replies

Sql Server - Call A Table Valued Function From Visual Basic.Net And How To Store The Result?

Nov 4, 2011

In my VB.net code i have:

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?

View 2 Replies

Asp.net - Jquery $.ajax Call For Download Excel Not Working?

Mar 29, 2012

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.

MasterPage.Master
$.ajax({
type: "POST",

[Code].....

View 2 Replies

Call To Application.Run(New MyForm()) Not Working When Called Outside Sub Main?

May 2, 2012

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.

View 2 Replies

Jquery $.ajax Call For Download Excel Not Working?

Aug 30, 2010

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.

MasterPage.Master
$.ajax({
type: "POST",

[code].....

View 5 Replies

Start A Working Search Form In Visual Basic Express Using An Access DB?

Apr 1, 2011

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.

View 10 Replies

.net - JSON Parsing Using JSON.net?

Feb 15, 2011

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.

View 1 Replies







Copyrights 2005-15 www.BigResource.com, All rights reserved