Search Results

Search found 4 results on 1 pages for 'craigjste'.

Page 1/1 | 1 

  • calll html button onclick event from asp server side login authenticate event

    - by CraigJSte
    Need to programmatically click an html button from a login event (code behind? the html button sends variables to Flash using method: no response - with no postback and uses ExternalInterface API via javascript. Going from SWF ASPX is great, but need to send User.Identity to SWF from ASPX via javascript after authenticate with login event which am having impossible time getting to work... (calling HTML event from Login button) tried scripting in javascript to login event with no luck, possibly because postback clears SWF variables - so perhaps keeping separate (login then html send) would work... Here is my relevant code: function sendToActionScript(value) { swfobject.getObjectById("Property").sendToActionScript(value); } </script> <object ..// SWF File embedded> </object <form id="form1" runat="server"> <asp:Login id="login1" OnAuthenticate="login1_Authenticate"/> </form> <form id="form" onsubmit="return false;"> <input type="text" name="input" id="input" value="" runat="server" /> <button id="btnInput" runat="server" causesvalidation="false" visible="true" style="width: 51px" onclick="sendToActionScript(this.form.input.value);" >Send</button><br /> </form> // CODE BEHIND protected void Login1_Authenticate(object sender, AuthenticateEventArgs e) { // do something to get User Id and Role //bind the string (user or role) to input.value //then call the HTML button onclick event to send it to SWF file. //which I could put in separate function and call from Login_Authenticate } Can anyone help me I am out of ideas. Craig

    Read the article

  • Can anyone help convert this VB Webservice?

    - by CraigJSte
    I can't figure it out for the life of me.. I'm using SQL DataSet Query to iterate to a Class Object which acts as a Data Model for Flex... Initially I used VB.net but now need to convert to C#.. This conversion is done except for the last section where I create a DataRow arow and then try to add the DataSet Values to the Class (Results Class)... I get an error message.. 'VTResults.Results.Ticker' is inaccessible due to its protection level (this is down at the bottom) using System; using System.Web; using System.Collections; using System.Web.Services; using System.Web.Services.Protocols; using System.Data; using System.Data.SqlClient; using System.Configuration; /// <summary> /// Summary description for VTResults /// </summary> [WebService(Namespace = "http://velocitytrading.net/ResultsVT.aspx")] [WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)] public class VTResults : System.Web.Services.WebService { public class Results { string Ticker; string BuyDate; decimal Buy; string SellDate; decimal Sell; string Profit; decimal Period; } [WebMethod] public Results[] GetResults() { string conn = ConfigurationManager.ConnectionStrings["LocalSqlServer"].ConnectionString; SqlConnection myconn = new SqlConnection(conn); SqlCommand mycomm = new SqlCommand(); SqlDataAdapter myda = new SqlDataAdapter(); DataSet myds = new DataSet(); mycomm.CommandType = CommandType.StoredProcedure; mycomm.Connection = myconn; mycomm.CommandText = "dbo.Results"; myconn.Open(); myda.SelectCommand = mycomm; myda.Fill(myds); myconn.Close(); myconn.Dispose(); int i = 0; Results[] dts = new Results[myds.Tables[0].Rows.Count]; foreach(DataRow arow in myds.Tables[0].Rows) { dts[i] = new Results(); dts[i].Ticker = arow["Ticker"]; dts[i].BuyDate = arow["BuyDate"]; dts[1].Buy = arow["Buy"]; dts[i].SellDate = arow["SellDate"]; dts[i].Sell = arow["Sell"]; dts[i].Profit = arow["Profit"]; dts[i].Period = arow["Period"]; i+=1; } return dts; } } The VB.NET WEBSERVICE that runs fine which I am trying to convert to C# is here. Imports System.Web Imports System.Web.Services Imports System.Web.Services.Protocols Imports System.Data Imports System.Data.SqlClient <WebService(Namespace:="http://localhost:2597/Results/ResultsVT.aspx")> _ <WebServiceBinding(ConformsTo:=WsiProfiles.BasicProfile1_1)> _ <Global.Microsoft.VisualBasic.CompilerServices.DesignerGenerated()> _ Public Class VTResults Inherits System.Web.Services.WebService Public Class Results Public Ticker As String Public BuyDate As String Public Buy As Decimal Public SellDate As String Public Sell As Decimal Public Profit As String Public Period As Decimal End Class <WebMethod()> _ Public Function GetResults() As Results() Try Dim conn As String = ConfigurationManager.ConnectionStrings("LocalSqlServer").ConnectionString Dim myconn = New SqlConnection(conn) Dim mycomm As New SqlCommand Dim myda As New SqlDataAdapter Dim myds As New DataSet mycomm.CommandType = CommandType.StoredProcedure mycomm.Connection = myconn mycomm.CommandText = "dbo.Results" myconn.Open() myda.SelectCommand = mycomm myda.Fill(myds) myconn.Close() myconn.Dispose() Dim i As Integer i = 0 Dim dts As Results() = New Results(myds.Tables(0).Rows.Count - 1) {} Dim aRow As DataRow For Each aRow In myds.Tables(0).Rows dts(i) = New Results dts(i).Ticker = aRow("Ticker") dts(i).BuyDate = aRow("BuyDate") dts(i).Buy = aRow("Buy") dts(i).SellDate = aRow("SellDate") dts(i).Sell = aRow("Sell") dts(i).Profit = aRow("Profit") dts(i).Period = aRow("Period") i += 1 Next Return dts Catch ex As DataException Throw ex End Try End Function End Class

    Read the article

  • C# Can anyone help convert this VB Webservice?

    - by CraigJSte
    I can't figure it out for the life of me.. I'm using SQL DataSet Query to iterate to a Class Object which acts as a Data Model for Flex... Initially I used VB.net but now need to convert to C#.. This conversion is done except for the last section where I create a DataRow arow and then try to add the DataSet Values to the Class (Results Class)... I get an error message.. 'VTResults.Results.Ticker' is inaccessible due to its protection level (this is down at the bottom) using System; using System.Web; using System.Collections; using System.Web.Services; using System.Web.Services.Protocols; using System.Data; using System.Data.SqlClient; using System.Configuration; /// <summary> /// Summary description for VTResults /// </summary> [WebService(Namespace = "http://velocitytrading.net/ResultsVT.aspx")] [WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)] public class VTResults : System.Web.Services.WebService { public class Results { string Ticker; string BuyDate; decimal Buy; string SellDate; decimal Sell; string Profit; decimal Period; } [WebMethod] public Results[] GetResults() { string conn = ConfigurationManager.ConnectionStrings["LocalSqlServer"].ConnectionString; SqlConnection myconn = new SqlConnection(conn); SqlCommand mycomm = new SqlCommand(); SqlDataAdapter myda = new SqlDataAdapter(); DataSet myds = new DataSet(); mycomm.CommandType = CommandType.StoredProcedure; mycomm.Connection = myconn; mycomm.CommandText = "dbo.Results"; myconn.Open(); myda.SelectCommand = mycomm; myda.Fill(myds); myconn.Close(); myconn.Dispose(); int i = 0; Results[] dts = new Results[myds.Tables[0].Rows.Count]; foreach(DataRow arow in myds.Tables[0].Rows) { dts[i] = new Results(); dts[i].Ticker = arow["Ticker"]; dts[i].BuyDate = arow["BuyDate"]; dts[1].Buy = arow["Buy"]; dts[i].SellDate = arow["SellDate"]; dts[i].Sell = arow["Sell"]; dts[i].Profit = arow["Profit"]; dts[i].Period = arow["Period"]; i+=1; } return dts; } } The VB.NET WEBSERVICE that runs fine which I am trying to convert to C# is here. Imports System.Web Imports System.Web.Services Imports System.Web.Services.Protocols Imports System.Data Imports System.Data.SqlClient <WebService(Namespace:="http://localhost:2597/Results/ResultsVT.aspx")> _ <WebServiceBinding(ConformsTo:=WsiProfiles.BasicProfile1_1)> _ <Global.Microsoft.VisualBasic.CompilerServices.DesignerGenerated()> _ Public Class VTResults Inherits System.Web.Services.WebService Public Class Results Public Ticker As String Public BuyDate As String Public Buy As Decimal Public SellDate As String Public Sell As Decimal Public Profit As String Public Period As Decimal End Class <WebMethod()> _ Public Function GetResults() As Results() Try Dim conn As String = ConfigurationManager.ConnectionStrings("LocalSqlServer").ConnectionString Dim myconn = New SqlConnection(conn) Dim mycomm As New SqlCommand Dim myda As New SqlDataAdapter Dim myds As New DataSet mycomm.CommandType = CommandType.StoredProcedure mycomm.Connection = myconn mycomm.CommandText = "dbo.Results" myconn.Open() myda.SelectCommand = mycomm myda.Fill(myds) myconn.Close() myconn.Dispose() Dim i As Integer i = 0 Dim dts As Results() = New Results(myds.Tables(0).Rows.Count - 1) {} Dim aRow As DataRow For Each aRow In myds.Tables(0).Rows dts(i) = New Results dts(i).Ticker = aRow("Ticker") dts(i).BuyDate = aRow("BuyDate") dts(i).Buy = aRow("Buy") dts(i).SellDate = aRow("SellDate") dts(i).Sell = aRow("Sell") dts(i).Profit = aRow("Profit") dts(i).Period = aRow("Period") i += 1 Next Return dts Catch ex As DataException Throw ex End Try End Function End Class

    Read the article

  • SQL Function for On Balance Volume (Financial Query)

    - by CraigJSte
    I would like to create a function for On Balance Volume (SQL Function). This is too complex of a calculation for met to figure out but here is the outline of the User Defined Table Function. If someone could help me to fill in the blanks I would appreciate it. Craig CREATE FUNCTION [dbo].[GetStdDev3] (@TKR VARCHAR(10)) RETURNS @results TABLE ( dayno SMALLINT IDENTITY(1,1) PRIMARY KEY , [date] DATETIME , [obv] FLOAT ) AS BEGIN DECLARE @rowcount SMALLINT INSERT @results ([date], [obv]) // CREATE A FUNCTION FOR ON BALANCE VOLUME // On Balance Volume is the Summ of Volume for Total Periods // OBV = 1000 at Period = 0 // OBV = OBV Previous + Previous Volume if Close Previous Close // OBV = OBV Previous - Previous Volume if Close < Previous Close // OBV = OBV Previous if Close = Previous Close // The actual Value of OBV is not important so to keep the ratio low we reduce the // Total Value of Tickers by 1/10th or 1/100th // For Value of Volume = Volume * .01 if Volume < 999 // For Value of Volume = Volume * .001 If Volume = 999 FROM Tickers RETURN END This is the Tickers table [dbo].[Tickers]( [ticker] [varchar](10) NULL, [date] [datetime] NULL, [high] [float] NULL, [low] [float] NULL, [open] [float] NULL, [close] [float] NULL, [volume] [float] NULL, [time] [datetime] NULL, [change] [float] NULL )

    Read the article

1