vuyiswamb 17 Posting Whiz

Good Day All

i have a ListView that is defined in a Xamarin Form. i want this ListView to be updated with the Data from the DB every 5 seconds. In a Non Mobile environment , we have a Windows Service , which is a long running Service. but now i search i came across a Service. but now i see this is implemented differently on each platform. Most examples i get are examples where one is binding the Control in Android Project. WhatUp if my Data binding is done in Xamarin Form (Standard Class) .

1) Can i kindly have the example link or code that refresh any control from a Service that runs in Intervals
2) Update the control that is hosting in a PLC or Standard Class

Thanks

vuyiswamb 17 Posting Whiz

Good Day all

i am using Navigation service as depicted below

 <Frame x:Name="_home"     NavigationUIVisibility="Hidden" HorizontalAlignment="Stretch"   Width="2749" Margin="0,12,0,0"   /> 

and i navigate to the Page like this

 (Application.Current.MainWindow.FindName("_home") as Frame).Source = new Uri("/F1.xaml", UriKind.Relative);  

which work fine. now in the Navigated page, lets just say a page shown in the Frame,there is some functionality like Calculate ,e.g that calculates Age based on the years(Example). Now from the Main Page i have a Button that says Calculate , i want to call the function or invoke a button click of Frame page from the Main Page.

Well i have tried this from the main page

 private void btnCalculate_Click(object sender, RoutedEventArgs e)
        {
            F1 f1 = new F1(); 
            f1.CalculateYear();
        } 

no but does not work, the break-point does reach the F1 page but the UI does not have calculated results.

One other thing i tried earlier is to pass the value that will be used in the calculation from the main , but when the one follow the variable value they just return an empty string when you follow it while stepping through it.

How is this done

Thanks

vuyiswamb 17 Posting Whiz

Good Day All

I hope someone can help me. i have a Asp.net web application that is running on 4.51 , When the User login Successfully i return an Object that has info for that user and store this in a Static object. Now my problem is the i

User 1 Login (Welcome James)

and

User 2 Login (WelCome Daniel)

and User 1 refreshes the Page (Welcome Daniel)

My user sessions override each other. i did mess around with the IIS Session before , i just noticed this now. Can anyone help.

Thanks

vuyiswamb 17 Posting Whiz

Good Day All

i have an asp.net 4.5 application. i have hosted it on IIS 7.5 in Windows Server 2008. My application has different folders within it and some are for JS and some are for CSS and etc.. and they are inside a directory named "Shared" in my problem and most of the things especially the css , images etc they are reference like this

 <link href="../Shared/assets/css/bootstrap.css" rel="stylesheet"/> 
 <link rel="apple-touch-icon" sizes="57x57" href="../Shared/assets/ico/apple-touch-icon-57x57.png">

now when i host this Project i have issues with CSS and images because they are not retrieved. i use Fiddler to check what is happening and i realised that after i hosted the application now Fiddler reports a 404 error on the following path

** http://myiisreserver/Shared/assets/css/bootstrap.css**

there are many of them , this is just an Example. now you can see it it can see the server , but instead of adding my Application or website name , it add the Directory within my application. So basically it should look like this

http://myiisreserver/MyWebapplication/Shared/assets/css/bootstrap.css

What could be the Problem.

Thanks

vuyiswamb 17 Posting Whiz

hi Dani

i have updated the post. please check the link

vuyiswamb 17 Posting Whiz

Good Day all

i am reluctantly maintaining a Classic Asp application that will be re-written in few months to come. i have an issue where i have a Code like this

   if(document.frmEntry.optMethod != "undefined")
                        {
                            if (document.frmEntry.optMethod.selectedIndex == 0) {
                                strPrompt=strPrompt+'Please specify the Valuation Method\n';
                                if ( objFocus == null ) {
                                    objFocus = document.frmEntry.optMethod;
                                }
                            }
                        } 

my problem here is that even if document.frmEntry.optMethod is not equal to undefined the code still go into the condition as if it was true. i have attached a proof in my debuger.

http://www.vetauinvest.com/Example/IE_DEBUGGER.png

Thanks

vuyiswamb 17 Posting Whiz

Good Day All

i am opening a Popup and i want to bind the "onbeforeunload" to the popup that if someone clicks on the close button in the window or close button in the page , the event should fire a javascript function that is on the page that opened the popup.

 function ProcessPayment(Downloadurl)
        {


            var url = "http://XXXX.com/cccc_ccccc/2938dc870cd394?tc_id=210&tc_45f=50.0&sig=fc5cbfe44230";
            var popupWindow = window;

   popupWindow.onbeforeunload = function () {
                if (Downloadurl != "") {
                    $.fileDownload(Downloadurl)
                  .done(function () { alert('File download a success!'); })
                  .fail(function () { alert('File download failed!'); });
                }
                else {
                    alert("No URL found");
                }
            }

            //open the Popup window
            popupWindow.open(url, 'popUpWindow', 'height=400,width=500,left=10,top=10,resizable=no,scrollbars=yes,toolbar=no,menubar=no,location=no,directories=no,status=yes')
             //bind the event so that when a user close the windown , we download the file 

when i try this nothing happens the event does not get work and no error in the browsers console

Thanks

vuyiswamb 17 Posting Whiz

Good Day

i have been hit by this error this night.

I have a UDF defined like this

    CREATE FUNCTION [dbo].[funcFormatPercentages_Extended_numeric]
    (

     -- Add the parameters for the function here

     @parPercentageToBeFormatted nvarchar(20)

    ) 
    RETURNS nvarchar(20)

    AS

    BEGIN 
         RETURN CAST(CAST(convert(float,@parPercentageToBeFormatted)* 100 AS decimal(4, 1)) AS nvarchar(5)) + N'%'  
    END 

so i will call the UDF with the value like this

select [dbo].[funcFormatPercentages_Extended_numeric]('-43.4703076923077') 

OR

 select [dbo].[funcFormatPercentages_Extended_numeric]('36.403813624481') 

i get an Error

Msg 8115, Level 16, State 2, Line 1
Arithmetic overflow error converting expression to data type nvarchar.

I tried to change the datatypes and Precision around , but still the error.

Thanks

vuyiswamb 17 Posting Whiz

Good Day All

I imported data into a Ms Access 2013 from SQL and all the data is there. I created a Query and also created a report that will use the Query. So the Query returns all the data. There are around 590 000 records that needs to be displayed by the record and records that are returned by the Query. when i do a Print Preview it gives me

Page 32767 of 12224

So i am afraid to start printing because from this look it seems like it does not show all data, but my assumption is that Print Preview cant show all the data , even if i try to go to the last page, can anyone clear my assumption.

Thanks

vuyiswamb 17 Posting Whiz

Good Day All

i am building Kinect Application, obviously using WPF.. Now i have a problem with Navigation. I have a Window and others are Pages that will use a Frame in a Window. So the Window has Button to Main to the "Menu" so the Page that contains Menu's is called "MainMenu.xaml"

        private void btnEnter_Click(object sender, RoutedEventArgs e)
        { 
            _mainFrame.Source = new Uri("/MainMenu.xaml", UriKind.Relative); 
        }

now when i navigate to the Menu Page , it shows my Menu page ,but the Window Button is not hidden.

So Before i used to have the code to navigate to the "MainMenu.xaml" in the loaded event of the Window so that it directly moved to the Menu, but my Problem is that still behind even if its behind my Kinect Gesture can click or touch the menu's in the "MainMenu.xaml" it looks like they are not out of scope.

When i move from MainMenu.xaml to the selected menu page i do it this way

  (Application.Current.MainWindow.FindName("_mainFrame") as Frame).Source = new Uri("/Alphabets101/Menu.xaml", UriKind.Relative); 

but still you will see that it tries to Access a "MainMenu" even if they are not visible on the screen

Thanks

vuyiswamb 17 Posting Whiz

Good Day All

I have a Kinect Application , i am having trouble with navigation , so i dont like the creation of object of windows everytime i nagivate from one to another page. so i converted all other windows to WPF pages and created only one window wich will be the Startup screen where Navigation will begin. So Other windows might also contain Menu's so to cut the story short , i can nagivate between WPF pages and do anything i want. but i want to be able to go to the Main Page(Window) which has the Menus. Which means i am trying to navigate from a Page to a Window.

Main Window has the Frame

          <DockPanel>
                <Frame x:Name="_mainFrame" />
            </DockPanel>

and i cna navigate to the pages with no problems and between them , but when i want to go to the main Window from a Page i cant.

vuyiswamb 17 Posting Whiz

Its a Requiredment, i have a asmx service that returns a list<dataset> and the schema defination keeps on repeating foreach dataset in the List.

How can i prevent.

Thanks

vuyiswamb 17 Posting Whiz

Good Day Guys

This is an MVC , JQuery, KNockout.js Question.

i have a Controller Action that is being Defined like this

  [HttpGet]
        public JsonResult SearchCars(string searchString)
        {

            string[] searchTerms = (searchString).ToUpper().Split(new char[] { ' ' }, StringSplitOptions.RemoveEmptyEntries);

            string[] searchTermSounds = new string[searchTerms.Length];

            var list = (from r in Cache.CarSearchItems
                       select new Lightstone.UI.Web.LaceWebUI.Models.CarItem(r, searchTerms, searchTermSounds)).ToList();

            var list1 = list.Distinct()
                             .Take(5)
                             .OrderByDescending(l => l.Hits).ToList();

            return Json(list1, JsonRequestBehavior.AllowGet);
        } 

and i have a Jquery function that gets fired onkey up event is fired in a textbox like this

 $(function () {
    $("#txtSearchString").keyup(function () {

        $("#txtSearchString").queue(function 
            () {
            var _this = $(this);
            _this.addClass("newcolor");
            _this.dequeue();
        });


        if ($("#txtSearchString").val().length >= 3) {
            var data = {}
            data.searchString = $("#txtSearchString").val();
            alert("Retrieving Data");

            $.getJSON("/Cars/SearchCars", data, function (result) {
                //Autocomplete binding
                var viewModel = null;

                viewModel =
                 { 
                     SearchOptions: ko.observableArray(result) // These are the initial options 
                 }
                alert("Done Retrieving Data");

                if (viewModel == null || viewModel == undefined) {
                    alert("The ViewModel is null or Undefined");

                    alert("Done with the View Model");
                }
                else {
                    ko.applyBindings(viewModel);
                    alert("THe View Model is no Null");
                }



            });

        }

    })
});

dont mind my alerts i use them to check the code reaches the place that i want it to reach. I can get the Jason the first time and this is the order of my alerts

  alert("Retrieving Data");
  alert("Done Retrieving Data");
 alert("THe View Model is no Null");

and then i bind the data to my HTML view as depicted below

 <table  id="tblsearchresults" …
vuyiswamb 17 Posting Whiz

I have a Counter on a textbox done in Javascript like twitter that counts the text entered. Now It works fine. The Textboxes get field with data and after that i want to calculate the renmaining Text. i have a code for that after i bind the textbox. So i have this

 ScriptManager.RegisterStartupScript(Page, GetType(String), "FF", "InitializeCounter(" + "ctl00_ContentPlaceHolder_Main_Wizard1_Servitudes" + ",'ndacount2','bar','800');", True)
        ScriptManager.RegisterStartupScript(Page, GetType(String), "FF", "InitializeCounter(" + "ctl00_ContentPlaceHolder_Main_Wizard1_Introduction" + ",'NDAcount1','bar','800');", True)

and i realized that it only calculate the textbox counts for only the First one and fail to do it for the second one. Maybe it does not like multiple RegisterStartupScript

Thanks

vuyiswamb 17 Posting Whiz

Good Day ALL

I have tried something and i am not sure what is the problem.

i have inherited the an asp.net app. So i want to add the custom Error Handling. I know there are two methods i can do this.

1) Web Config

2)Global.asa

So i started with the web config just to see how it will look and i accessed the page that normally gives an Exception. so basically i have a page gives a

**500 - Internal server error.
There is a problem with the resource you are looking for, and it cannot be displayed **

So now , if there is an Error i want it to go to that Error Page. In the web config i have the Following

 <customErrors defaultRedirect="content/ErrorPages/SupportError.aspx" mode="On">
  <error statusCode="404" redirect="content/ErrorPages/SupportError.aspx" />
  <error statusCode="400" redirect="content/ErrorPages/SupportError.aspx" />
  <error statusCode="500" redirect="content/ErrorPages/SupportError.aspx" />
</customErrors>

This means that when this kind of Errors occur it should redirect to that page. All these pages are contents of the Master page including the Error page. But this Error Persist it does not show me the Error page. Even if i try to see if it goes to "Application_Error" in the Global.asa nothing goes there.

So i have also tried the second option. so i turned the web config part
"off" and i trapped this in the global.asa like this

Sub Application_Error(ByVal sender As Object, ByVal e As EventArgs)
    Server.Transfer("~/Content/ErrorPages/SupportError.aspx")

    'Response.Redirect("~/Content/ErrorPages/SupportError.aspx", False)
End Sub

but still nothing happens

THanks

vuyiswamb 17 Posting Whiz

Thanks i will consider that in my test controls

vuyiswamb 17 Posting Whiz

Good Day Fellows

i have a Dynamic Questionnaire that is created using dynamic data from the Database. My data in the Database contains the fields like

QuestionID - Primary key
Question - The Question Text
Answer - The Answer
Required - This is a Validation , i used this to enable the Required validator in asp.net
DataType - This is the Datatype, it can be a Heading also.
ReadOnly - This check if that Question is a Read-only , This happens most of the time , when it is a Calculated Field, meaning its values depends on other fields values.
Order - This is the order the Questions will appear
Section - This is the section, So the Questions are Grouped. Normaly in Page1 you will have Questions for Section 1.......
Deleted- This is a bit Field , its either 1 or 0 , 1 is active, so this helps be to Filter only active Questions
QuestionType- This is the Type of Control the Data should be Presented with, It can be a Dropdown ,checkbox or textbox..
QT_ID - There can be many Templates of the Question , this makes sure we use the Correct Template for the Questionnaire

So with this kind of Data , i want to use know , what asp.net Control can i use to achieve this.

Thanks

vuyiswamb 17 Posting Whiz

Good Day All

My Question goes as follows.

I have a DataLayer in a Form of a WCF service and it is being consumed by a Business Layer that is also in a Form of a WCF Service and it is being consumed by a Silverlight Application. Now i have a Model in the DataLayer that defines the structure that comes from the Database, and this strucure model implements INotifyPropertyChanged interface to track the changes on the Properties.

So basically , when the changes are made in silverlight , i want the Interface method to be fired in the Datalayer.

now to go further with my requirement , i am doing the validation on the Properties like this

public string CustomerSurname
        {
            get
            {
                return _CustomerSurname;
            }

            set
            {

                if (!string.IsNullOrEmpty(value))
                {
                    _CustomerSurname = value;

                    OnNotifyPropertyChanged("CustomerSurname");
                }
                else
                {
                    throw new Exception("Invalid Surname");
                }
            }
        }

and obviously set binded control with the Proper binding property to show the Exception.

Text="{Binding CustomerSurname, Mode=TwoWay,ValidatesOnExceptions=True}"

The problem is the "changed" event does not get triggered, or rather my Exception does not show.


Thanks

vuyiswamb 17 Posting Whiz

Good Day All

i have a Jquery code defined like this

// Let's add it to textarea this time
        $(".cnt").focus(function()
        {
            // Check for the change
            if(this.value == this.defaultValue){
                this.select();
            }
        });

and i am creating a textbox on fly and after creating it i bind data to it and after that i want to attach a focus event if there a value "0" on it

If cnt.Text = "0" Then
            cnt.CssClass = "cnt"
        End If

but still when i select a textbox that has "0" it does not select the whole content of the textbox. i went through a breakpoint and it goes through this line

cnt.CssClass = "cnt"

Thanks

vuyiswamb 17 Posting Whiz

hi guys i used another way. so for now its fine.

vuyiswamb 17 Posting Whiz

i do it from code Behind

vuyiswamb 17 Posting Whiz

Good Day All

I have a Dynaically created a Textbox and i have a Dynamically created DIV. So what i want to do is to Find the Position of the Textbox and and Dynamically when this textbox is created , please a Div just next to this textbox. So my plan was to find the position of the textbox and next to it using the position of the textbox and calculate the position of a Div.

Thanks

vuyiswamb 17 Posting Whiz

Thank you very much , that did the Trick :)

vuyiswamb 17 Posting Whiz

Good Day All

i am creating Textboxes at Runtime with something like this

Dim cnt As New TextBox
     
        cnt.ID = "cont_" & x
 
        If multiline Then
            cnt.TextMode = TextBoxMode.MultiLine
 

        End If

These are dynamically created fields. so what i want to do is to use this following JQuery on this textbox

$(document).ready(function()
{
        $("#contentbox").keyup(function()
        {
        var box=$(this).val();
        var main = box.length *100;
        var value= (main / 145);
        var count= 145 - box.length;
 
        if(box.length <= 145)
        {
        $('#count').html(count);
        $('#bar').animate({"width": value+'%',}, 1);
        }
        return false;
        });
 
});

and what this function does it count the number of Characters that have been typed in a Textbox. so i am displaying the remaining characters. So that is working fine on my example because the Element is known at Early Binding. Now my question is what if the textbox is created dynamically ?

contentbox

this is the name of the Textbox in my example.

hOW do we use a J Query in Dynamically created Textbox.


Thanks

vuyiswamb 17 Posting Whiz

Ngiyabonga :)

vuyiswamb 17 Posting Whiz

Ya time is Flying man, probably at the age of 50 i will be back to remind you :)

vuyiswamb 17 Posting Whiz

OOOH NO

Not again , its that day of the year again, i am getting old

vuyiswamb 17 Posting Whiz

Good Morining All

i have an asp.net hosted in IIS. that uses the Com library "Microsoft Word 14.0 Object Library". I am using this to convert the word Document to PDF, on my machine it works. I have Office 2010 on my machine and on the server we have installed Office 2011 too. but when i try to run my app on the server it gives me the Following error

Retrieving the COM class factory for component with CLSID {000209FF-0000-0000-C000-000000000046} failed due to the following error: 80070005 Access is denied. (Exception from HRESULT: 0x80070005 (E_ACCESSDENIED)).

i have given all the permissions to the aspnet user and other users full access but this does not work ,

Thanks

vuyiswamb 17 Posting Whiz

This problem have been resolved , the answer you just provided is correct. The Problem was fixed in the DNS server.

Thanks

vuyiswamb 17 Posting Whiz

Good Day Friend

The Problem have been resolved and your answers point to the problem.

Thanks

vuyiswamb 17 Posting Whiz

Good Evening All

I have Silverlight application and it is rendering better(not Good) in IE and it renders differently from different browsers, like IE8,Firefox 3, 4, and worse in Chrome. i tried different examples , i used one example that was good , but the moment i view this in different browsers its just a mess.

here is my Page

<%@ Page Language="C#"      AutoEventWireup="true" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
    <title>EchashDev</title>
    <style type="text/css">
    html, body {
	    height: 100%;
	    overflow:auto;
	    float:left;
    }
    body {
	    padding: 0;
	    margin: 0;
    }
    #silverlightControlHost {
	    height: 100%;
	    text-align:left;
    }
    </style>
    <script type="text/javascript" src="Silverlight.js"></script>
    <script type="text/javascript">
        function onSilverlightError(sender, args) {
            var appSource = "";
            if (sender != null && sender != 0) {
              appSource = sender.getHost().Source;
            }
            
            var errorType = args.ErrorType;
            var iErrorCode = args.ErrorCode;

            if (errorType == "ImageError" || errorType == "MediaError") {
              return;
            }

            var errMsg = "Unhandled Error in Silverlight Application " +  appSource + "\n" ;
             
            errMsg += "Code: "+ iErrorCode + "    \n";
            errMsg += "Category: " + errorType + "       \n";
            errMsg += "Message: " + args.ErrorMessage + "     \n";

            if (errorType == "ParserError") {
                errMsg += "File: " + args.xamlFile + "     \n";
                errMsg += "Line: " + args.lineNumber + "     \n";
                errMsg += "Position: " + args.charPosition + "     \n";
            }
            else if (errorType == "RuntimeError") {           
                if (args.lineNumber != 0) {
                    errMsg += "Line: " + args.lineNumber + "     \n";
                    errMsg += "Position: …
vuyiswamb 17 Posting Whiz

Good Day All

i have a IIS server. This IIS Server is publicly available , so i have hosted some WCF services in that server , i can access the URL from outside my network, but i can use it. the url that i access it with is

http://196.XX.XXX.XXX:8095/datalayer/

but now looking at the link to generate the metadata is different, it does not use an IP

svcutil.exe http://Mywebserver.mynetwoorkdomain.local:8095/DataLayer/eCashDatalayer.svc?wsdl

so this makes it not accessible via the wcftestclient or even if i try to make add a reference in my applications in VS

What settings in the IIS do i need to change ?

Thanks

vuyiswamb 17 Posting Whiz

Good Day All

i have a Silverlight application that i have written. Tested and it works well in our internal network. Now in my company we have another server, so our Network guys open a port so that someone who is not in our network can view the website.

Now as you know Silverlight uses WCF services, i came across a problem when accessing the website from outside. You can see the home page, but now there are database work that are done (e.g) when you login , and other things that are related to the database.

"I used netstat -ano to check if really the port is open and i saw it was because it was saying "Listening" , i checked with the network guys to see if there is no firewall blocking that port and they said none"

Obviously i know that this has nothing to do with my code or my application, there is somewhere in the network settings they did not configure well.

Another thing is that when i access the WCF url from outside , i see it. I have used fidler to make sure that i am seeing the correct error here. The says

No Connection Could Be Made Because The Target Machine Actively Refused It X.X.X.X:8495

I goggled this a lot and most of the people point to security issue.

What would you advice in this regard


Thanks

vuyiswamb 17 Posting Whiz

I have tried that, can you please edit the example project and send it back to me.

Thanks

vuyiswamb 17 Posting Whiz

hi all

I am using a third party gateway. The third party gateway does not support query-string , so i will need to post the form to pass the values to the given URL and another thing is that they don't expose the web-services so we need to use their page and that means we need to host it in an iframe in asp.net

so what i did is that i have hidden fields that will be used as parameters as depicted below

<input type="hidden" name="p1" value='4635' />
        <input type="hidden" name="p2" value='Reference_test' />
        <input type="hidden" name="p3" value='Purchase credits' />
        <input type="hidden" name="p4" value='500' />
        <input type="hidden" name="m_1" value='142' />
        <input type="hidden" name="m_2" value='720' />

and i will have a button to demonstrate what i want and i have an iframe as depicted below

<asp:Button ID="Button1" runat="server" Text="Proceed"  PostBackUrl="https://www.vcs.co.za/vvonline/ccform.asp" />
          <iframe id="iframe1"    src=""
            style="width: 744px; height: 333px; margin-top: 16px; margin-bottom: 0px;"> 
		Your browser does not support inline frames or is currently configured not to display inline frames.
		</iframe>

now on form load i have this

<body onload="Loadiframe()"

and the Javascript looks like this

<script type="text/javascript">
        function Loadiframe() {
            document.getElementById("iframe1").src = "https://www.vcs.co.za/vvonline/ccform.asp"
            
            return false;
        }
    </script>

now the purpose of this , is to load the iframe after the page load event of the asp.net gets fired.

Now my problem here is that when the iframe loads , it does not pass the parameters to the url that is being set …

vuyiswamb 17 Posting Whiz

sorry i saw that space in the other URL , i am trying to use the same url , i have change it , but nothing is happening

vuyiswamb 17 Posting Whiz

I have done the following

i have set the SCR to an empty string

<iframe  name="I1" src=""   
            style="width: 744px; height: 305px; margin-top: 16px; margin-bottom: 0px;">
		Your browser does not support inline frames or is currently configured not to display inline frames.
		</iframe>

and on body load i have called a javascript

<body  onload="loadIframe();" >

and my javascript looks like this

<script type="text/javascript">
        function loadIframe() {
            document.getElementById("I1").src = "https: //www.vcs.co.za/vvonline/ccform.asp";
            return false;
        }
    </script>

but it does not show the URL in the Iframe

vuyiswamb 17 Posting Whiz

Every time i am about to post a thread i get an answer while typing the message, maybe i explain it to myself better when i write it , OK so if you have seen this post it means i have not find an answer :)

I have a Silverlight app that passes a query string to an asp.net page that has an iframe that is hosting a third-party gateway page as depicted below

<form id="Form1" runat="server"  method="post" >
        <input type="hidden" name="p1" value='<%=(MerchantID) %>' />
        <input type="hidden" name="p2" value='<%=(GetNextTransID) %>' />
        <input type="hidden" name="p3" value='Purchase credits' />
        <input type="hidden" name="p4" value='<%=(Amount) %>' />
        <input type="hidden" name="m_1" value='<%=(Userid) %>' />
        <input type="hidden" name="m_2" value='<%=(Schoolid) %>' />
    <asp:Panel ID="Panel1"  runat="server">
        <table class="style1">
            <tr>
                <td class="style2">
                    &nbsp;</td>
                <td style="text-align: center">
                    &nbsp;</td>
            </tr>
        </table>
    </asp:Panel>
 
    <div id="layer1" 
        style="position: absolute; width: 759px; height: 357px; z-index: 1; left: 88px; top: 233px">
 
         
        <iframe id="iframecredit" name="I1"    src="https://www.vcs.co.za/vvonline/ccform.asp"
            style="width: 744px; height: 333px; margin-top: 16px; margin-bottom: 0px;">

		Your browser does not support inline frames or is currently configured not to display inline frames.
		</iframe></div>
	<p>
        <asp:ScriptManager ID="ScriptManager1" runat="server">
        </asp:ScriptManager>
        <img alt="Ecash" height="609" src="images/BG.jpg" width="924" />
                </p>

    </form>

This payment gateway page accepts the parameters as you can see them there, so i have Properties that has values "After the Page load" so i cant get the values of the Query string before the page load. now the iframe will load with empty values, now i want to initialize the values before the iframe gets displayed

vuyiswamb 17 Posting Whiz

Good Day all

i have a SQL Job and i want to change the times in the job programmatically from C#. The application that will change the Job Settings will be accessing the job remotely.

Is is possible ?

Thanks

vuyiswamb 17 Posting Whiz

Good Evening All

I want to create a unique value for my User in Silverlight and access this value on the asp.net page that is part of the silverlight website. So i cant use cookies because they wont work and i cant do the client site cookie thing because it does not work for my design, its complicated.

This is my current implementation, i created a temp table that i store a value on t he SQL and retrieve it on the SQL immediately, because the created or the value and the access of the value happens between 1 nanosecond. so i don't want to depend on that because on a multi user system that will be a problem.

So basically i need to store any unique value that i can retrieve from the database even in a multi user environment.

Thanks

vuyiswamb 17 Posting Whiz

Thank you very much for your reply.

The above code is the connection string i used , the problem was that i was supposed to use it like this

Thank you very much for your reply.

The above code is the connection string i used , the problem was that i was supposed to use it like this

User=SYSDBA;Password=masterkey;Database=[B]192.168.03.14:\\Database\SCHOOL.fdb[/B] ;DataSource=192.168.03.14; Port=3050;Dialect=3; Charset=NONE;Role=;Connection lifetime=15;Pooling=true; MinPoolSize=0;MaxPoolSize=50;Packet Size=8192;ServerType=0;

so i have added an extra slash to show that it is a share folder and a Colon, this are firebird rules in the connection string

Thank you


so i have added an extra slash to show that it is a share folder.

Thank you

vuyiswamb 17 Posting Whiz

Good Day All

I am accessing an FDB Database with a WCF service. locally it was working fine, but now i want to access the service that is stting on a remote location. my Connection string looks like this

<add name="FDBConnectionString" connectionString="User=SYSDBA;Password=masterkey;Database=\\192.168.03.14\Database\SCHOOL.fdb;DataSource=192.168.03.14; Port=3050;Dialect=3; Charset=NONE;Role=;Connection lifetime=15;Pooling=true; MinPoolSize=0;MaxPoolSize=50;Packet Size=8192;ServerType=0;"/>

i get an Error when i try to open the Connection

unavailable database

if it take this path and access it fire explorer

\\192.168.03.14\Database\SCHOOL.fdb

i can get to it. i have give all the possible permissions on the file and the Folder. am not sure what is the problem now.

Thanks

vuyiswamb 17 Posting Whiz

i found the reason to this. I had a stored procedure that was retrieving it from the DB and casting it to a varbinary and i realized that if you cast an image to another type it will never work together as an image again. after i removed that , my function that convert the byte[] to Imagesource started to work as it should.

vuyiswamb 17 Posting Whiz

Good Day All

I am not creating a Cookie in ASp.net, i am creating the Cookie in Silverlight, the Implementation of this will be different

vuyiswamb 17 Posting Whiz
;with cteSchools as (SELECT DISTINCT S.SCHOOLID AS [SCHOOLID],S.SCHOOLNAME AS [SCHOOLNAME]
FROM SCHOOL S

WHERE S.SCHOOLID IN (SELECT SCHOOLID FROM #SCHOOLS))


SELECT S.SCHOOLID AS [SCHOOLID],S.SCHOOLNAME AS [SCHOOLNAME],SP.PHOTO AS [PHOTO]
FROM cteSCHOOLS S
CROSS APPLY (Select TOP (1) PHOTO from SchoolPhoto SP
WHERE SP.SCHOOLID = S.SCHOOLID
ORDER BY SCHOOLID DESC) SP

Solved the Problem

vuyiswamb 17 Posting Whiz

i have an interesting question for you guys.

SELECT   S.SCHOOLID AS [SCHOOLID],S.SCHOOLNAME AS [SCHOOLNAME],SP.PHOTO AS [PHOTO]
FROM SCHOOLPHOTO SP
INNER JOIN SCHOOL S
ON SP.SCHOOLID = SP.SCHOOLID
WHERE S.SCHOOLID  IN (SELECT SCHOOLID FROM #SCHOOLS)

the Photo Field is an Image Datatype Field, i now you can use them in a Distinct or group by , How can i go by have that field there without casting it , because if i cast it it will not work together in Silverlight or any other image control.

Thanks

vuyiswamb 17 Posting Whiz

i have been give access. i will check tomorow morning and let you know

thanks guys for your replies

vuyiswamb 17 Posting Whiz

Good Day All
I have an asp.net project that does the CC handling for me and if the cc comes from a certain application it redirects to the page in a certain application. In that Project there is a page named “Buycredit”

That contains a Page_load that has this

if (!Page.IsPostBack)
                        {
                            //handle the response url
                            handleResponse();
                        }

And the handleresponse Method is defined like this

private void handleResponse()
        {   
           // try
          //  {
                //populate VCS object with values
                DataAccess dataAccess = new DataAccess();
                VCSResponse creditResponse = populateVCSObject();

                //Temporary: Check if this needs to be forwarded to eCASH for processing
                if (!string.IsNullOrEmpty(creditResponse.Misc))
                {
                    string forwardAddy = string.Concat("http://111.111.11.118/Ecash/Ecashpos/PurchaseCredit.aspx?", Request.QueryString.ToString());
                    Response.Redirect(forwardAddy,false);
                }
                else
                {
                    //Insert response values to the DB
                    dataAccess.insertReponsevalue(creditResponse);

                    //check if the response = approved
                    if (responseApproved(creditResponse.P3_AuthReponse))
                    {
                        //update the purchase history table with successfull credit purchase
                        dataAccess.insertPurchaseRecord((User)Session["UserDetail_Connector"], creditResponse);
                        //email the user the confirmation that credits were purchased
                        Emailer.sendCreditPurchaseMail("noreply@noreply.co.za", ((User)Session["UserDetail_Connector"]).Email, (User)Session["UserDetail_Connector"], creditResponse);
                        //Show on display the success purchase message
                        divNotify.Visible = true;
                        txtPromptMsg_Prompt.Text = "Credits were successfully purchased.";
                    }
                    else
                    {
                        //show user that purchase was not successful
                        divNotify.Visible = true;
                        txtPromptMsg_Prompt.Text = "Credits were not successfully purchased!";
                    }
                }
                
            //}
         //   catch (Exception ex)
         //   {
         //       throw ex;
        //    }
        }

Now the page “PurchaseCredit.aspx” is the page in the Silverlight Project. On Debug mode, I can step through this project and it will finish and redirect to the “PurchaseCredit.aspx” in that IP and it will work fine, but when I publish …

vuyiswamb 17 Posting Whiz

Good Day All

I have a Generic function that in my Static Class. i have this Class in Silverlight

public static BitmapSource LoadImage(Byte[] imageBytes)
        {
            BitmapImage bmpImage = new BitmapImage();
            MemoryStream mystream = new MemoryStream(imageBytes);
            bmpImage.SetSource(mystream);
            return bmpImage;
        }

Now this looked fine for me until i had to bind an Image in Silverlight like this

PhotoHolder.Source =GenericMethods.LoadImage(model.imbPhoto);

The Images i have in the Database are Supported by silverlight they are jpg type.

and the Elelment that i am binding to look like this in Silverlight

<Image x:Name="PhotoHolder" Height="98" Width="102" OpacityMask="Black"  Canvas.Left="141" Canvas.Top="30">
                <Image.Effect>
                    <DropShadowEffect/>
                </Image.Effect>
            </Image>

so if i bind i get this Error

Catastrophic failure (Exception from HRESULT: 0x8000FFFF (E_UNEXPECTED))

Thanks

vuyiswamb 17 Posting Whiz

Good Evening All

i have another Question. i have created a Function that creates a Cookie with a Domain like this

private static void SetCookieExtedend(String key, String value, String path)
        {

            DateTime expires = DateTime.UtcNow + TimeSpan.FromDays(2000);

            bool secure = false;

            String domain = "Ecash";

            StringBuilder cookie = new StringBuilder();

            cookie.Append(String.Concat(key, "=", value));

            if (expires != null)
            {

                cookie.Append(String.Concat(";expires=", expires.ToString("R")));
            }

            if (!String.IsNullOrEmpty(path))
            {
                cookie.Append(String.Concat(";path=", path));
            }

            if (!String.IsNullOrEmpty(domain))
            {
                cookie.Append(String.Concat(";domain=", domain));
            }

            if (secure)
            {
                cookie.Append(";secure");
            }

            HtmlPage.Document.SetProperty("cookie", cookie.ToString());
        }

and its working well , i have set the Cookie and it was stored as this

UserID=142;expires=Mon, 14 Nov 2016 16:58:19 GMT;domain=Ecash

now i want to retrieve the Value of the Cookie and i have a function that does it like this

public static string GetCookie(string key)
        {
            string[] cookies = HtmlPage.Document.Cookies.Split(';');
            key += '=';
            foreach (string cookie in cookies)
            {
                string cookieStr = cookie.Trim();
                if (cookieStr.StartsWith(key, StringComparison.OrdinalIgnoreCase))
                {
                    string[] vals = cookieStr.Split('=');

                    if (vals.Length >= 2)
                    {
                        return vals[1];
                    }

                    return string.Empty;
                }
            }

            return null;
        }

the Following Line comes back with an empty String

string[] cookies = HtmlPage.Document.Cookies.Split(';');

Why ?

Thanks