PDA

View Full Version : Return SQL Record Set using .NET


illmatic
05-18-2004, 06:47 PM
We are running a user/Pass Authenication and then returning a RecordSet upon successful login..

Testing Run's perfect until the final step which is returning the RecordSet "VPONList"

Say's undefined..

Below is the Debugger and ActionScript.

ConnectString: "http://192.168.1.59/flashremoting/gateway.aspx"
DebugId: 0
EventType: "Connect"
MovieUrl: "file:///C|/Documents and Settings/jgoble/My Documents/Flash Projects/BivuacWeb_Flash/BivuacWeb.swf"
Protocol: "http"
Source: "Client"
Time: 1084908062350
Date (object #1)
....."Tue May 18 15:21:02 GMT-0400 2004"

DebugId: 0
EventType: "Call"
MethodName: "com.bivuac.bivuacweb.Authentication.ValidateUser"
MovieUrl: "file:///C|/Documents and Settings/jgoble/My Documents/Flash Projects/BivuacWeb_Flash/BivuacWeb.swf"
Protocol: "http"
Source: "Client"
Time: 1084908062350
Date (object #1)
....."Tue May 18 15:21:02 GMT-0400 2004"
Parameters (object #2)
.....[0]: "admin"
.....[1]: "******"

DebugId: 0
EventType: "Result"
MovieUrl: "file:///C|/Documents and Settings/jgoble/My Documents/Flash Projects/BivuacWeb_Flash/BivuacWeb.swf"
Protocol: "http"
Result: 1
Source: "Client"
Time: 1084908062382
Date (object #1)
....."Tue May 18 15:21:02 GMT-0400 2004"

ConnectString: "http://192.168.1.59/flashremoting/gateway.aspx"
DebugId: 1
EventType: "Connect"
MovieUrl: "file:///C|/Documents and Settings/jgoble/My Documents/Flash Projects/BivuacWeb_Flash/BivuacWeb.swf"
Protocol: "http"
Source: "Client"
Time: 1084908062397
Date (object #1)
....."Tue May 18 15:21:02 GMT-0400 2004"

DebugId: 1
EventType: "Call"
MethodName: "com.bivuac.bivuacweb.VideoServers.GetVPONList"
MovieUrl: "file:///C|/Documents and Settings/jgoble/My Documents/Flash Projects/BivuacWeb_Flash/BivuacWeb.swf"
Protocol: "http"
Source: "Client"
Time: 1084908062397
Date (object #1)
....."Tue May 18 15:21:02 GMT-0400 2004"
Parameters (object #2)
.....[0]: 1

DebugId: 1
EventType: "Result"
MovieUrl: "file:///C|/Documents and Settings/jgoble/My Documents/Flash Projects/BivuacWeb_Flash/BivuacWeb.swf"
Protocol: "http"
Result: (undefined)
Source: "Client"
Time: 1084908062507
Date (object #1)
....."Tue May 18 15:21:02 GMT-0400 2004"


=== Frame 1 ==================================================
============

#include "NetServices.as"
#include "NetDebug.as"
#include "DataGlue.as"

stop();

var myURL = "http://192.168.1.59/flashremoting/gateway.aspx";
var serviceName = "com.bivuac.bivuacweb.";
var userID:Number = 0;

if (inited == null) {
inited = true;
NetServices.setDefaultGatewayUrl(myURL);
}

function loginButtonOnClick () {
var connection = NetServices.createGatewayConnection();
var oAR:AuthenticationResponse = new AuthenticationResponse();
var service = connection.getService(serviceName + "Authentication", oAR);
service.ValidateUser(txtLogin.text, txtPassword.text);

// Override object's method for this job

oAR.onResult = function (result) {
if (result > 0) {
userID = result;
gotoAndStop(2);
} else {
lblError.text = "Login failed ... try again.";
}
}

}
btnLogin.addEventListener("click", loginButtonOnClick);

==================================================
============

=== Frame 2 ==================================================
============
var connection = NetServices.createGatewayConnection();
var oAR = new AuthenticationResponse();
var service = connection.getService(serviceName + "VideoServers", oAR);
service.GetVPONList(userID);

// Override object's method for this job
oAR.onResult = function (result) {
traceRecordSet(result);
//grdData.setDataProvider(result);
//stop();
}

function traceRecordSet(rs) {
var len = rs.getLength();
var columnNames_array = rs.getColumnNames();
var row_str = "";
var tmpObj;
for (var i = 0; i < len; i++) {
tmpObj = rs.getItemAt(i);
row_str = "";
for (var x = 0; x < columnNames_array.length; x++) {
row_str += columnNames_array[x] + ":" + tmpObj[columnNames_array[x]] + ", ";
}
//trace(row_str.substr(0, row_str.length - 2));
results_txt.htmlText += row_str.substr(0, row_str.length - 2);
}
}
var connection = NetServices.createGatewayConnection();
var oAR = new AuthenticationResponse();
var service = connection.getService(serviceName + "VideoServers", oAR);
service.GetVPONList(userID);

// Override object's method for this job
oAR.onResult = function (result) {
grdData.setDataProvider(result);
stop();
}

==================================================
============

J_Miller
06-06-2004, 05:54 PM
Looks like a ASP.NET error, and not an ActionScript error. According to your debug info, it looks like the recordset is not even leaving the server-side script on its way back to Flash. You can test this by commenting out your Flash code in your ASP.NET script, hardcode Flash.param value being sent, response.write your result, then run your ASP.NET page inside of your browser. This will show you exactly what your ASP.NET page is doing with the result. If you dont figure it out, post your ActionScript file, as well as your ASP.NET file and maybe I can help you a little further as to what the problem might be.